|
struct osmo_jibuf * | osmo_jibuf_alloc (void *talloc_ctx) |
| Allocate a new jitter buffer instance. More...
|
|
void | osmo_jibuf_delete (struct osmo_jibuf *jb) |
| Destroy a previously allocated jitter buffer instance. More...
|
|
int | osmo_jibuf_enqueue (struct osmo_jibuf *jb, struct msgb *msg) |
| Try to enqueue a packet into the jitter buffer. More...
|
|
bool | osmo_jibuf_empty (struct osmo_jibuf *jb) |
| Check whether the jitter buffer instance has packets queued or not. More...
|
|
void | osmo_jibuf_set_min_delay (struct osmo_jibuf *jb, uint32_t min_delay) |
| Set minimum buffer size for the jitter buffer. More...
|
|
void | osmo_jibuf_set_max_delay (struct osmo_jibuf *jb, uint32_t max_delay) |
| Set maximum buffer size for the jitter buffer. More...
|
|
void | osmo_jibuf_enable_skew_compensation (struct osmo_jibuf *jb, bool enable) |
| Toggle use of skew detection and compensation mechanism. More...
|
|
void | osmo_jibuf_set_dequeue_cb (struct osmo_jibuf *jb, osmo_jibuf_dequeue_cb dequeue_cb, void *cb_data) |
| Set dequeue callback for the jitter buffer. More...
|
|
static void | ms2timeval (struct timeval *ts, uint32_t ms) |
|
static uint32_t | timeval2ms (const struct timeval *ts) |
|
static int | clock_gettime_timeval (clockid_t clk_id, struct timeval *tp) |
|
static struct timeval * | msgb_scheduled_ts (const struct msgb *msg) |
|
static void | llist_add_sorted (struct msgb *msg, struct llist_head *msg_list) |
|
static void | enqueue_pkt (struct osmo_jibuf *jb, struct msgb *msg, bool is_syncpoint) |
|
static bool | msg_get_marker (struct msgb *msg) |
|
static uint16_t | msg_get_sequence (struct msgb *msg) |
|
static uint32_t | msg_get_timestamp (struct msgb *msg) |
|
static int32_t | samples2ms (int32_t samples) |
|
static int | calc_pkt_rel_delay (struct osmo_jibuf *jb, struct msgb *msg) |
|
static bool | msg_is_in_sequence (struct osmo_jibuf *jb, struct msgb *msg) |
|
static bool | msg_is_syncpoint (struct osmo_jibuf *jb, struct msgb *msg) |
|
static void | msg_set_as_reference (struct osmo_jibuf *jb, struct msgb *msg) |
|
static void | dequeue_msg (struct osmo_jibuf *jb, struct msgb *msg) |
|
static void | timer_expired (void *data) |
|
static void | recalc_clock_skew (struct osmo_jibuf *jb, int32_t rel_delay) |
|
static void | recalc_threshold_delay (struct osmo_jibuf *jb) |
|
int osmo_jibuf_enqueue |
( |
struct osmo_jibuf * |
jb, |
|
|
struct msgb * |
msg |
|
) |
| |
Try to enqueue a packet into the jitter buffer.
- Parameters
-
[in] | jb | jitter buffer instance |
[in] | msg | msgb to enqueue, containing an RTP packet |
- Returns
- <0 if the packet was dropped, 0 otherwise
This function calculates the delay for the enqueued packet. If the delay is bigger than the current buffer size, the function returns -1 and the caller owns the packet again and can free it if required. If the packet is enqueued, 0 is returned and the exact same packet (ownership transfer, no copy is made) will be available again through the dequeue_cb() when the queue timer for this packet expires.