| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef _FIXEDJITTERBUF_H_ |
| 27 |
#define _FIXEDJITTERBUF_H_ |
| 28 |
|
| 29 |
#if defined(__cplusplus) || defined(c_plusplus) |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
enum { |
| 36 |
FIXED_JB_OK, |
| 37 |
FIXED_JB_DROP, |
| 38 |
FIXED_JB_INTERP, |
| 39 |
FIXED_JB_NOFRAME |
| 40 |
}; |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
#define FIXED_JB_SIZE_DEFAULT 200 |
| 45 |
#define FIXED_JB_RESYNCH_THRESHOLD_DEFAULT 1000 |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
struct fixed_jb_conf |
| 50 |
{ |
| 51 |
long jbsize; |
| 52 |
long resync_threshold; |
| 53 |
}; |
| 54 |
|
| 55 |
|
| 56 |
struct fixed_jb_frame |
| 57 |
{ |
| 58 |
void *data; |
| 59 |
long ts; |
| 60 |
long ms; |
| 61 |
long delivery; |
| 62 |
struct fixed_jb_frame *next; |
| 63 |
struct fixed_jb_frame *prev; |
| 64 |
}; |
| 65 |
|
| 66 |
|
| 67 |
struct fixed_jb; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
struct fixed_jb * fixed_jb_new(struct fixed_jb_conf *conf); |
| 73 |
|
| 74 |
void fixed_jb_destroy(struct fixed_jb *jb); |
| 75 |
|
| 76 |
int fixed_jb_put_first(struct fixed_jb *jb, void *data, long ms, long ts, long now); |
| 77 |
|
| 78 |
int fixed_jb_put(struct fixed_jb *jb, void *data, long ms, long ts, long now); |
| 79 |
|
| 80 |
int fixed_jb_get(struct fixed_jb *jb, struct fixed_jb_frame *frame, long now, long interpl); |
| 81 |
|
| 82 |
long fixed_jb_next(struct fixed_jb *jb); |
| 83 |
|
| 84 |
int fixed_jb_remove(struct fixed_jb *jb, struct fixed_jb_frame *frameout); |
| 85 |
|
| 86 |
void fixed_jb_set_force_resynch(struct fixed_jb *jb); |
| 87 |
|
| 88 |
|
| 89 |
int fixed_jb_is_late(struct fixed_jb *jb, long ts); |
| 90 |
|
| 91 |
#if defined(__cplusplus) || defined(c_plusplus) |
| 92 |
} |
| 93 |
#endif |
| 94 |
|
| 95 |
#endif |