• Home
  • Raw
  • Download

Lines Matching refs:jbuf

86 rtp_jitter_buffer_init (RTPJitterBuffer * jbuf)  in rtp_jitter_buffer_init()  argument
88 g_mutex_init (&jbuf->clock_lock); in rtp_jitter_buffer_init()
90 g_queue_init (&jbuf->packets); in rtp_jitter_buffer_init()
91 jbuf->mode = RTP_JITTER_BUFFER_MODE_SLAVE; in rtp_jitter_buffer_init()
93 rtp_jitter_buffer_reset_skew (jbuf); in rtp_jitter_buffer_init()
99 RTPJitterBuffer *jbuf; in rtp_jitter_buffer_finalize() local
101 jbuf = RTP_JITTER_BUFFER_CAST (object); in rtp_jitter_buffer_finalize()
103 if (jbuf->media_clock_synced_id) in rtp_jitter_buffer_finalize()
104 g_signal_handler_disconnect (jbuf->media_clock, in rtp_jitter_buffer_finalize()
105 jbuf->media_clock_synced_id); in rtp_jitter_buffer_finalize()
106 if (jbuf->media_clock) { in rtp_jitter_buffer_finalize()
108 gst_clock_set_master (jbuf->media_clock, NULL); in rtp_jitter_buffer_finalize()
109 gst_object_unref (jbuf->media_clock); in rtp_jitter_buffer_finalize()
112 if (jbuf->pipeline_clock) in rtp_jitter_buffer_finalize()
113 gst_object_unref (jbuf->pipeline_clock); in rtp_jitter_buffer_finalize()
118 rtp_jitter_buffer_flush (jbuf, NULL, NULL); in rtp_jitter_buffer_finalize()
120 g_mutex_clear (&jbuf->clock_lock); in rtp_jitter_buffer_finalize()
135 RTPJitterBuffer *jbuf; in rtp_jitter_buffer_new() local
137 jbuf = g_object_new (RTP_TYPE_JITTER_BUFFER, NULL); in rtp_jitter_buffer_new()
139 return jbuf; in rtp_jitter_buffer_new()
151 rtp_jitter_buffer_get_mode (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_mode() argument
153 return jbuf->mode; in rtp_jitter_buffer_get_mode()
164 rtp_jitter_buffer_set_mode (RTPJitterBuffer * jbuf, RTPJitterBufferMode mode) in rtp_jitter_buffer_set_mode() argument
166 jbuf->mode = mode; in rtp_jitter_buffer_set_mode()
170 rtp_jitter_buffer_get_delay (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_delay() argument
172 return jbuf->delay; in rtp_jitter_buffer_get_delay()
176 rtp_jitter_buffer_set_delay (RTPJitterBuffer * jbuf, GstClockTime delay) in rtp_jitter_buffer_set_delay() argument
178 jbuf->delay = delay; in rtp_jitter_buffer_set_delay()
179 jbuf->low_level = (delay * 15) / 100; in rtp_jitter_buffer_set_delay()
182 jbuf->high_level = (delay * 90) / 100; in rtp_jitter_buffer_set_delay()
185 GST_TIME_FORMAT, GST_TIME_ARGS (jbuf->delay), in rtp_jitter_buffer_set_delay()
186 GST_TIME_ARGS (jbuf->low_level), GST_TIME_ARGS (jbuf->high_level)); in rtp_jitter_buffer_set_delay()
197 rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer * jbuf, guint32 clock_rate) in rtp_jitter_buffer_set_clock_rate() argument
199 if (jbuf->clock_rate != clock_rate) { in rtp_jitter_buffer_set_clock_rate()
201 G_GUINT32_FORMAT, jbuf->clock_rate, clock_rate); in rtp_jitter_buffer_set_clock_rate()
202 jbuf->clock_rate = clock_rate; in rtp_jitter_buffer_set_clock_rate()
203 rtp_jitter_buffer_reset_skew (jbuf); in rtp_jitter_buffer_set_clock_rate()
216 rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_clock_rate() argument
218 return jbuf->clock_rate; in rtp_jitter_buffer_get_clock_rate()
223 RTPJitterBuffer * jbuf) in media_clock_synced_cb() argument
227 g_mutex_lock (&jbuf->clock_lock); in media_clock_synced_cb()
228 if (jbuf->pipeline_clock) { in media_clock_synced_cb()
229 internal = gst_clock_get_internal_time (jbuf->media_clock); in media_clock_synced_cb()
230 external = gst_clock_get_time (jbuf->pipeline_clock); in media_clock_synced_cb()
232 gst_clock_set_calibration (jbuf->media_clock, internal, external, 1, 1); in media_clock_synced_cb()
234 g_mutex_unlock (&jbuf->clock_lock); in media_clock_synced_cb()
247 rtp_jitter_buffer_set_media_clock (RTPJitterBuffer * jbuf, GstClock * clock, in rtp_jitter_buffer_set_media_clock() argument
250 g_mutex_lock (&jbuf->clock_lock); in rtp_jitter_buffer_set_media_clock()
251 if (jbuf->media_clock) { in rtp_jitter_buffer_set_media_clock()
252 if (jbuf->media_clock_synced_id) in rtp_jitter_buffer_set_media_clock()
253 g_signal_handler_disconnect (jbuf->media_clock, in rtp_jitter_buffer_set_media_clock()
254 jbuf->media_clock_synced_id); in rtp_jitter_buffer_set_media_clock()
255 jbuf->media_clock_synced_id = 0; in rtp_jitter_buffer_set_media_clock()
256 gst_object_unref (jbuf->media_clock); in rtp_jitter_buffer_set_media_clock()
258 jbuf->media_clock = clock; in rtp_jitter_buffer_set_media_clock()
259 jbuf->media_clock_offset = clock_offset; in rtp_jitter_buffer_set_media_clock()
261 if (jbuf->pipeline_clock && jbuf->media_clock && in rtp_jitter_buffer_set_media_clock()
262 jbuf->pipeline_clock != jbuf->media_clock) { in rtp_jitter_buffer_set_media_clock()
263 jbuf->media_clock_synced_id = in rtp_jitter_buffer_set_media_clock()
264 g_signal_connect (jbuf->media_clock, "synced", in rtp_jitter_buffer_set_media_clock()
265 G_CALLBACK (media_clock_synced_cb), jbuf); in rtp_jitter_buffer_set_media_clock()
266 if (gst_clock_is_synced (jbuf->media_clock)) { in rtp_jitter_buffer_set_media_clock()
269 internal = gst_clock_get_internal_time (jbuf->media_clock); in rtp_jitter_buffer_set_media_clock()
270 external = gst_clock_get_time (jbuf->pipeline_clock); in rtp_jitter_buffer_set_media_clock()
272 gst_clock_set_calibration (jbuf->media_clock, internal, external, 1, 1); in rtp_jitter_buffer_set_media_clock()
275 gst_clock_set_master (jbuf->media_clock, jbuf->pipeline_clock); in rtp_jitter_buffer_set_media_clock()
277 g_mutex_unlock (&jbuf->clock_lock); in rtp_jitter_buffer_set_media_clock()
289 rtp_jitter_buffer_set_pipeline_clock (RTPJitterBuffer * jbuf, GstClock * clock) in rtp_jitter_buffer_set_pipeline_clock() argument
291 g_mutex_lock (&jbuf->clock_lock); in rtp_jitter_buffer_set_pipeline_clock()
292 if (jbuf->pipeline_clock) in rtp_jitter_buffer_set_pipeline_clock()
293 gst_object_unref (jbuf->pipeline_clock); in rtp_jitter_buffer_set_pipeline_clock()
294 jbuf->pipeline_clock = clock ? gst_object_ref (clock) : NULL; in rtp_jitter_buffer_set_pipeline_clock()
296 if (jbuf->pipeline_clock && jbuf->media_clock && in rtp_jitter_buffer_set_pipeline_clock()
297 jbuf->pipeline_clock != jbuf->media_clock) { in rtp_jitter_buffer_set_pipeline_clock()
298 if (gst_clock_is_synced (jbuf->media_clock)) { in rtp_jitter_buffer_set_pipeline_clock()
301 internal = gst_clock_get_internal_time (jbuf->media_clock); in rtp_jitter_buffer_set_pipeline_clock()
302 external = gst_clock_get_time (jbuf->pipeline_clock); in rtp_jitter_buffer_set_pipeline_clock()
304 gst_clock_set_calibration (jbuf->media_clock, internal, external, 1, 1); in rtp_jitter_buffer_set_pipeline_clock()
307 gst_clock_set_master (jbuf->media_clock, jbuf->pipeline_clock); in rtp_jitter_buffer_set_pipeline_clock()
309 g_mutex_unlock (&jbuf->clock_lock); in rtp_jitter_buffer_set_pipeline_clock()
313 rtp_jitter_buffer_get_rfc7273_sync (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_rfc7273_sync() argument
315 return jbuf->rfc7273_sync; in rtp_jitter_buffer_get_rfc7273_sync()
319 rtp_jitter_buffer_set_rfc7273_sync (RTPJitterBuffer * jbuf, in rtp_jitter_buffer_set_rfc7273_sync() argument
322 jbuf->rfc7273_sync = rfc7273_sync; in rtp_jitter_buffer_set_rfc7273_sync()
332 rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_reset_skew() argument
334 jbuf->base_time = -1; in rtp_jitter_buffer_reset_skew()
335 jbuf->base_rtptime = -1; in rtp_jitter_buffer_reset_skew()
336 jbuf->base_extrtp = -1; in rtp_jitter_buffer_reset_skew()
337 jbuf->media_clock_base_time = -1; in rtp_jitter_buffer_reset_skew()
338 jbuf->ext_rtptime = -1; in rtp_jitter_buffer_reset_skew()
339 jbuf->last_rtptime = -1; in rtp_jitter_buffer_reset_skew()
340 jbuf->window_pos = 0; in rtp_jitter_buffer_reset_skew()
341 jbuf->window_filling = TRUE; in rtp_jitter_buffer_reset_skew()
342 jbuf->window_min = 0; in rtp_jitter_buffer_reset_skew()
343 jbuf->skew = 0; in rtp_jitter_buffer_reset_skew()
344 jbuf->prev_send_diff = -1; in rtp_jitter_buffer_reset_skew()
345 jbuf->prev_out_time = -1; in rtp_jitter_buffer_reset_skew()
346 jbuf->need_resync = TRUE; in rtp_jitter_buffer_reset_skew()
359 rtp_jitter_buffer_disable_buffering (RTPJitterBuffer * jbuf, gboolean disabled) in rtp_jitter_buffer_disable_buffering() argument
361 jbuf->buffering_disabled = disabled; in rtp_jitter_buffer_disable_buffering()
365 rtp_jitter_buffer_resync (RTPJitterBuffer * jbuf, GstClockTime time, in rtp_jitter_buffer_resync() argument
368 jbuf->base_time = time; in rtp_jitter_buffer_resync()
369 jbuf->media_clock_base_time = -1; in rtp_jitter_buffer_resync()
370 jbuf->base_rtptime = gstrtptime; in rtp_jitter_buffer_resync()
371 jbuf->base_extrtp = ext_rtptime; in rtp_jitter_buffer_resync()
372 jbuf->prev_out_time = -1; in rtp_jitter_buffer_resync()
373 jbuf->prev_send_diff = -1; in rtp_jitter_buffer_resync()
375 jbuf->window_filling = TRUE; in rtp_jitter_buffer_resync()
376 jbuf->window_pos = 0; in rtp_jitter_buffer_resync()
377 jbuf->window_min = 0; in rtp_jitter_buffer_resync()
378 jbuf->window_size = 0; in rtp_jitter_buffer_resync()
379 jbuf->skew = 0; in rtp_jitter_buffer_resync()
381 jbuf->need_resync = FALSE; in rtp_jitter_buffer_resync()
385 get_buffer_level (RTPJitterBuffer * jbuf) in get_buffer_level() argument
391 high_buf = (RTPJitterBufferItem *) g_queue_peek_tail_link (&jbuf->packets); in get_buffer_level()
399 low_buf = (RTPJitterBufferItem *) g_queue_peek_head_link (&jbuf->packets); in get_buffer_level()
420 GST_LOG_OBJECT (jbuf, in get_buffer_level()
429 update_buffer_level (RTPJitterBuffer * jbuf, gint * percent) in update_buffer_level() argument
434 level = get_buffer_level (jbuf); in update_buffer_level()
437 if (jbuf->buffering_disabled) { in update_buffer_level()
439 level = jbuf->high_level; in update_buffer_level()
442 if (jbuf->buffering) { in update_buffer_level()
444 if (level >= jbuf->high_level) { in update_buffer_level()
446 jbuf->buffering = FALSE; in update_buffer_level()
449 if (level < jbuf->low_level) { in update_buffer_level()
451 jbuf->buffering = TRUE; in update_buffer_level()
458 if (jbuf->buffering && (jbuf->high_level != 0)) { in update_buffer_level()
459 perc = (level * 100 / jbuf->high_level); in update_buffer_level()
535 calculate_skew (RTPJitterBuffer * jbuf, guint64 ext_rtptime, in calculate_skew() argument
546 send_diff = gstrtptime - jbuf->base_rtptime; in calculate_skew()
550 if (time == -1 || jbuf->base_time == -1 || is_rtx) in calculate_skew()
554 recv_diff = time - jbuf->base_time; in calculate_skew()
569 GST_TIME_ARGS (jbuf->base_time), GST_TIME_ARGS (recv_diff), slope); in calculate_skew()
574 if (ABS (delta - jbuf->skew) > GST_SECOND) { in calculate_skew()
576 GST_TIME_ARGS (ABS (delta - jbuf->skew))); in calculate_skew()
577 rtp_jitter_buffer_resync (jbuf, time, gstrtptime, ext_rtptime, TRUE); in calculate_skew()
588 pos = jbuf->window_pos; in calculate_skew()
590 if (G_UNLIKELY (jbuf->window_filling)) { in calculate_skew()
593 jbuf->window[pos++] = delta; in calculate_skew()
595 if (G_UNLIKELY (pos == 1 || delta < jbuf->window_min)) in calculate_skew()
596 jbuf->window_min = delta; in calculate_skew()
599 jbuf->window_size = pos; in calculate_skew()
602 GST_DEBUG ("min %" G_GINT64_FORMAT, jbuf->window_min); in calculate_skew()
605 jbuf->skew = jbuf->window_min; in calculate_skew()
606 jbuf->window_filling = FALSE; in calculate_skew()
622 jbuf->skew = in calculate_skew()
623 (perc * jbuf->window_min + ((10000 - perc) * jbuf->skew)) / 10000; in calculate_skew()
624 jbuf->window_size = pos + 1; in calculate_skew()
629 old = jbuf->window[pos]; in calculate_skew()
630 jbuf->window[pos++] = delta; in calculate_skew()
632 if (G_UNLIKELY (delta <= jbuf->window_min)) { in calculate_skew()
635 jbuf->window_min = delta; in calculate_skew()
636 } else if (G_UNLIKELY (old == jbuf->window_min)) { in calculate_skew()
640 for (i = 0; i < jbuf->window_size; i++) { in calculate_skew()
642 if (jbuf->window[i] == old) { in calculate_skew()
646 if (jbuf->window[i] < min) in calculate_skew()
647 min = jbuf->window[i]; in calculate_skew()
649 jbuf->window_min = min; in calculate_skew()
652 jbuf->skew = (jbuf->window_min + (124 * jbuf->skew)) / 125; in calculate_skew()
654 delta, jbuf->window_min); in calculate_skew()
657 if (G_UNLIKELY (pos >= jbuf->window_size)) in calculate_skew()
659 jbuf->window_pos = pos; in calculate_skew()
664 if (jbuf->base_time != -1) { in calculate_skew()
665 out_time = jbuf->base_time + send_diff; in calculate_skew()
667 if (jbuf->skew < 0 && out_time < -jbuf->skew) { in calculate_skew()
670 out_time += jbuf->skew; in calculate_skew()
676 jbuf->skew, GST_TIME_ARGS (out_time)); in calculate_skew()
682 queue_do_insert (RTPJitterBuffer * jbuf, GList * list, GList * item) in queue_do_insert() argument
684 GQueue *queue = &jbuf->packets; in queue_do_insert()
704 rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts, in rtp_jitter_buffer_calculate_pts() argument
720 jbuf->mode != RTP_JITTER_BUFFER_MODE_SLAVE && in rtp_jitter_buffer_calculate_pts()
721 jbuf->base_time != -1 && jbuf->last_rtptime != -1) { in rtp_jitter_buffer_calculate_pts()
722 GstClockTime ext_rtptime = jbuf->ext_rtptime; in rtp_jitter_buffer_calculate_pts()
725 if (ext_rtptime > jbuf->last_rtptime + 3 * jbuf->clock_rate || in rtp_jitter_buffer_calculate_pts()
726 ext_rtptime + 3 * jbuf->clock_rate < jbuf->last_rtptime) { in rtp_jitter_buffer_calculate_pts()
731 rtp_jitter_buffer_reset_skew (jbuf); in rtp_jitter_buffer_calculate_pts()
743 ext_rtptime = gst_rtp_buffer_ext_timestamp (&jbuf->ext_rtptime, rtptime); in rtp_jitter_buffer_calculate_pts()
744 if (jbuf->last_rtptime != -1 && ext_rtptime == jbuf->last_rtptime) { in rtp_jitter_buffer_calculate_pts()
745 return jbuf->prev_out_time; in rtp_jitter_buffer_calculate_pts()
749 jbuf->last_rtptime = ext_rtptime; in rtp_jitter_buffer_calculate_pts()
751 g_mutex_lock (&jbuf->clock_lock); in rtp_jitter_buffer_calculate_pts()
752 media_clock = jbuf->media_clock ? gst_object_ref (jbuf->media_clock) : NULL; in rtp_jitter_buffer_calculate_pts()
754 jbuf->pipeline_clock ? gst_object_ref (jbuf->pipeline_clock) : NULL; in rtp_jitter_buffer_calculate_pts()
755 media_clock_offset = jbuf->media_clock_offset; in rtp_jitter_buffer_calculate_pts()
756 g_mutex_unlock (&jbuf->clock_lock); in rtp_jitter_buffer_calculate_pts()
759 gst_util_uint64_scale_int (ext_rtptime, GST_SECOND, jbuf->clock_rate); in rtp_jitter_buffer_calculate_pts()
761 if (G_LIKELY (jbuf->base_rtptime != -1)) { in rtp_jitter_buffer_calculate_pts()
763 if (gstrtptime < jbuf->base_rtptime) { in rtp_jitter_buffer_calculate_pts()
769 jbuf->need_resync = TRUE; in rtp_jitter_buffer_calculate_pts()
778 switch (jbuf->mode) { in rtp_jitter_buffer_calculate_pts()
785 if (jbuf->base_time == -1) in rtp_jitter_buffer_calculate_pts()
793 if (jbuf->base_time != -1 && !jbuf->need_resync) in rtp_jitter_buffer_calculate_pts()
803 if (G_UNLIKELY (jbuf->need_resync && dts != -1)) { in rtp_jitter_buffer_calculate_pts()
811 rtp_jitter_buffer_resync (jbuf, dts, gstrtptime, ext_rtptime, FALSE); in rtp_jitter_buffer_calculate_pts()
816 GST_TIME_ARGS (gstrtptime), GST_TIME_ARGS (jbuf->base_rtptime), in rtp_jitter_buffer_calculate_pts()
817 GST_TIME_ARGS (gstrtptime - jbuf->base_rtptime)); in rtp_jitter_buffer_calculate_pts()
822 if (rfc7273_mode && jbuf->mode == RTP_JITTER_BUFFER_MODE_SLAVE in rtp_jitter_buffer_calculate_pts()
823 && (media_clock_offset == -1 || !jbuf->rfc7273_sync)) { in rtp_jitter_buffer_calculate_pts()
834 if (jbuf->media_clock_base_time == -1) { in rtp_jitter_buffer_calculate_pts()
835 if (jbuf->base_time != -1) { in rtp_jitter_buffer_calculate_pts()
836 jbuf->media_clock_base_time = in rtp_jitter_buffer_calculate_pts()
838 jbuf->base_time + base_time, internal, external, rate_num, in rtp_jitter_buffer_calculate_pts()
842 jbuf->media_clock_base_time = in rtp_jitter_buffer_calculate_pts()
846 jbuf->media_clock_base_time = in rtp_jitter_buffer_calculate_pts()
848 jbuf->base_rtptime = gstrtptime; in rtp_jitter_buffer_calculate_pts()
852 if (gstrtptime > jbuf->base_rtptime) in rtp_jitter_buffer_calculate_pts()
853 nsrtptimediff = gstrtptime - jbuf->base_rtptime; in rtp_jitter_buffer_calculate_pts()
857 rtpntptime = nsrtptimediff + jbuf->media_clock_base_time; in rtp_jitter_buffer_calculate_pts()
870 } else if (rfc7273_mode && (jbuf->mode == RTP_JITTER_BUFFER_MODE_SLAVE in rtp_jitter_buffer_calculate_pts()
871 || jbuf->mode == RTP_JITTER_BUFFER_MODE_SYNCED) in rtp_jitter_buffer_calculate_pts()
872 && media_clock_offset != -1 && jbuf->rfc7273_sync) { in rtp_jitter_buffer_calculate_pts()
890 ntprtptime = gst_util_uint64_scale (ntptime, jbuf->clock_rate, GST_SECOND); in rtp_jitter_buffer_calculate_pts()
906 jbuf->clock_rate); in rtp_jitter_buffer_calculate_pts()
910 jbuf->clock_rate); in rtp_jitter_buffer_calculate_pts()
933 jbuf->media_clock_base_time = -1; in rtp_jitter_buffer_calculate_pts()
937 pts = calculate_skew (jbuf, ext_rtptime, gstrtptime, dts, gap, is_rtx); in rtp_jitter_buffer_calculate_pts()
942 if (G_LIKELY (pts != -1 && jbuf->prev_out_time != -1 in rtp_jitter_buffer_calculate_pts()
943 && jbuf->prev_send_diff != -1)) { in rtp_jitter_buffer_calculate_pts()
947 (gstrtptime - jbuf->base_rtptime > jbuf->prev_send_diff in rtp_jitter_buffer_calculate_pts()
948 && pts < jbuf->prev_out_time) || in rtp_jitter_buffer_calculate_pts()
950 (gstrtptime - jbuf->base_rtptime < jbuf->prev_send_diff in rtp_jitter_buffer_calculate_pts()
951 && pts > jbuf->prev_out_time) || in rtp_jitter_buffer_calculate_pts()
953 gstrtptime - jbuf->base_rtptime == jbuf->prev_send_diff)) { in rtp_jitter_buffer_calculate_pts()
955 pts = jbuf->prev_out_time; in rtp_jitter_buffer_calculate_pts()
959 if (gap == 0 && dts != -1 && pts + jbuf->delay < dts) { in rtp_jitter_buffer_calculate_pts()
965 jbuf->delay, GST_TIME_ARGS (dts)); in rtp_jitter_buffer_calculate_pts()
966 rtp_jitter_buffer_reset_skew (jbuf); in rtp_jitter_buffer_calculate_pts()
967 rtp_jitter_buffer_resync (jbuf, dts, gstrtptime, ext_rtptime, TRUE); in rtp_jitter_buffer_calculate_pts()
971 jbuf->prev_out_time = pts; in rtp_jitter_buffer_calculate_pts()
972 jbuf->prev_send_diff = gstrtptime - jbuf->base_rtptime; in rtp_jitter_buffer_calculate_pts()
1002 rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item, in rtp_jitter_buffer_insert() argument
1008 g_return_val_if_fail (jbuf != NULL, FALSE); in rtp_jitter_buffer_insert()
1011 list = jbuf->packets.tail; in rtp_jitter_buffer_insert()
1058 queue_do_insert (jbuf, list, (GList *) item); in rtp_jitter_buffer_insert()
1061 if (jbuf->mode == RTP_JITTER_BUFFER_MODE_BUFFER) in rtp_jitter_buffer_insert()
1062 update_buffer_level (jbuf, percent); in rtp_jitter_buffer_insert()
1139 rtp_jitter_buffer_append_event (RTPJitterBuffer * jbuf, GstEvent * event) in rtp_jitter_buffer_append_event() argument
1143 rtp_jitter_buffer_insert (jbuf, item, &head, NULL); in rtp_jitter_buffer_append_event()
1157 rtp_jitter_buffer_append_query (RTPJitterBuffer * jbuf, GstQuery * query) in rtp_jitter_buffer_append_query() argument
1163 rtp_jitter_buffer_insert (jbuf, item, &head, NULL); in rtp_jitter_buffer_append_query()
1179 rtp_jitter_buffer_append_lost_event (RTPJitterBuffer * jbuf, GstEvent * event, in rtp_jitter_buffer_append_lost_event() argument
1187 if (!rtp_jitter_buffer_insert (jbuf, item, &head, NULL)) { in rtp_jitter_buffer_append_lost_event()
1209 rtp_jitter_buffer_append_buffer (RTPJitterBuffer * jbuf, GstBuffer * buf, in rtp_jitter_buffer_append_buffer() argument
1219 inserted = rtp_jitter_buffer_insert (jbuf, item, &head, percent); in rtp_jitter_buffer_append_buffer()
1241 rtp_jitter_buffer_pop (RTPJitterBuffer * jbuf, gint * percent) in rtp_jitter_buffer_pop() argument
1246 g_return_val_if_fail (jbuf != NULL, NULL); in rtp_jitter_buffer_pop()
1248 queue = &jbuf->packets; in rtp_jitter_buffer_pop()
1261 if (jbuf->mode == RTP_JITTER_BUFFER_MODE_BUFFER) in rtp_jitter_buffer_pop()
1262 update_buffer_level (jbuf, percent); in rtp_jitter_buffer_pop()
1286 rtp_jitter_buffer_peek (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_peek() argument
1288 g_return_val_if_fail (jbuf != NULL, NULL); in rtp_jitter_buffer_peek()
1290 return (RTPJitterBufferItem *) jbuf->packets.head; in rtp_jitter_buffer_peek()
1302 rtp_jitter_buffer_flush (RTPJitterBuffer * jbuf, GFunc free_func, in rtp_jitter_buffer_flush() argument
1307 g_return_if_fail (jbuf != NULL); in rtp_jitter_buffer_flush()
1312 while ((item = g_queue_pop_head_link (&jbuf->packets))) in rtp_jitter_buffer_flush()
1326 rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_is_buffering() argument
1328 return jbuf->buffering && !jbuf->buffering_disabled; in rtp_jitter_buffer_is_buffering()
1339 rtp_jitter_buffer_set_buffering (RTPJitterBuffer * jbuf, gboolean buffering) in rtp_jitter_buffer_set_buffering() argument
1341 jbuf->buffering = buffering; in rtp_jitter_buffer_set_buffering()
1353 rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_percent() argument
1358 if (G_UNLIKELY (jbuf->high_level == 0)) in rtp_jitter_buffer_get_percent()
1361 if (G_UNLIKELY (jbuf->buffering_disabled)) in rtp_jitter_buffer_get_percent()
1364 level = get_buffer_level (jbuf); in rtp_jitter_buffer_get_percent()
1365 percent = (level * 100 / jbuf->high_level); in rtp_jitter_buffer_get_percent()
1380 rtp_jitter_buffer_num_packets (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_num_packets() argument
1382 g_return_val_if_fail (jbuf != NULL, 0); in rtp_jitter_buffer_num_packets()
1384 return jbuf->packets.length; in rtp_jitter_buffer_num_packets()
1397 rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_ts_diff() argument
1403 g_return_val_if_fail (jbuf != NULL, 0); in rtp_jitter_buffer_get_ts_diff()
1405 high_buf = (RTPJitterBufferItem *) g_queue_peek_tail_link (&jbuf->packets); in rtp_jitter_buffer_get_ts_diff()
1406 low_buf = (RTPJitterBufferItem *) g_queue_peek_head_link (&jbuf->packets); in rtp_jitter_buffer_get_ts_diff()
1434 rtp_jitter_buffer_get_seqnum_diff (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_get_seqnum_diff() argument
1440 g_return_val_if_fail (jbuf != NULL, 0); in rtp_jitter_buffer_get_seqnum_diff()
1442 high_buf = (RTPJitterBufferItem *) g_queue_peek_tail_link (&jbuf->packets); in rtp_jitter_buffer_get_seqnum_diff()
1443 low_buf = (RTPJitterBufferItem *) g_queue_peek_head_link (&jbuf->packets); in rtp_jitter_buffer_get_seqnum_diff()
1484 rtp_jitter_buffer_get_sync (RTPJitterBuffer * jbuf, guint64 * rtptime, in rtp_jitter_buffer_get_sync() argument
1488 *rtptime = jbuf->base_extrtp; in rtp_jitter_buffer_get_sync()
1490 *timestamp = jbuf->base_time + jbuf->skew; in rtp_jitter_buffer_get_sync()
1492 *clock_rate = jbuf->clock_rate; in rtp_jitter_buffer_get_sync()
1494 *last_rtptime = jbuf->last_rtptime; in rtp_jitter_buffer_get_sync()
1508 rtp_jitter_buffer_can_fast_start (RTPJitterBuffer * jbuf, gint num_packet) in rtp_jitter_buffer_can_fast_start() argument
1514 if (rtp_jitter_buffer_num_packets (jbuf) < num_packet) in rtp_jitter_buffer_can_fast_start()
1517 item = rtp_jitter_buffer_peek (jbuf); in rtp_jitter_buffer_can_fast_start()
1536 rtp_jitter_buffer_is_full (RTPJitterBuffer * jbuf) in rtp_jitter_buffer_is_full() argument
1538 return rtp_jitter_buffer_get_seqnum_diff (jbuf) >= 32765 && in rtp_jitter_buffer_is_full()
1539 rtp_jitter_buffer_num_packets (jbuf) > 10000; in rtp_jitter_buffer_is_full()