diff options
Diffstat (limited to 'toxav/media.h')
-rw-r--r-- | toxav/media.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/toxav/media.h b/toxav/media.h index 57817516..66798351 100644 --- a/toxav/media.h +++ b/toxav/media.h | |||
@@ -38,8 +38,7 @@ | |||
38 | /* Audio encoding/decoding */ | 38 | /* Audio encoding/decoding */ |
39 | #include <opus.h> | 39 | #include <opus.h> |
40 | 40 | ||
41 | typedef enum _Capabilities | 41 | typedef enum _Capabilities { |
42 | { | ||
43 | none, | 42 | none, |
44 | a_encoding = 1 << 0, | 43 | a_encoding = 1 << 0, |
45 | a_decoding = 1 << 1, | 44 | a_decoding = 1 << 1, |
@@ -65,13 +64,26 @@ typedef struct _CodecState { | |||
65 | OpusDecoder *audio_decoder; | 64 | OpusDecoder *audio_decoder; |
66 | 65 | ||
67 | uint64_t capabilities; /* supports*/ | 66 | uint64_t capabilities; /* supports*/ |
68 | 67 | ||
69 | } CodecState; | 68 | } CodecState; |
70 | 69 | ||
71 | struct jitter_buffer *create_queue(int capacity); | ||
72 | 70 | ||
73 | int queue(struct jitter_buffer *q, RTPMessage *pk); | 71 | typedef struct _JitterBuffer { |
74 | RTPMessage *dequeue(struct jitter_buffer *q, int *success); | 72 | RTPMessage **queue; |
73 | uint16_t capacity; | ||
74 | uint16_t size; | ||
75 | uint16_t front; | ||
76 | uint16_t rear; | ||
77 | uint8_t queue_ready; | ||
78 | uint16_t current_id; | ||
79 | uint32_t current_ts; | ||
80 | uint8_t id_set; | ||
81 | } JitterBuffer; | ||
82 | |||
83 | JitterBuffer *create_queue(int capacity); | ||
84 | void terminate_queue(JitterBuffer *q); | ||
85 | void queue(JitterBuffer *q, RTPMessage *pk); | ||
86 | RTPMessage *dequeue(JitterBuffer *q, int *success); | ||
75 | 87 | ||
76 | 88 | ||
77 | CodecState *codec_init_session ( uint32_t audio_bitrate, | 89 | CodecState *codec_init_session ( uint32_t audio_bitrate, |