summaryrefslogtreecommitdiff
path: root/gst/rtpmanager/rtpjitterbuffer.h
diff options
context:
space:
mode:
authorHavard Graff <havard.graff@gmail.com>2016-10-09 15:59:05 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-04 16:51:20 +0200
commitfb9c75db360ff1aa61710804b08788b6c35f44df (patch)
tree72b2e5fc7d2e8fc850ea47cda2cf39c0da847ff7 /gst/rtpmanager/rtpjitterbuffer.h
parentbea35f97c8eeca4f78a99d61d4bd04a2be2124cf (diff)
rtpjitterbuffer: fix lost-event using dts instead of pts
The lost-event was using a different time-domain (dts) than the outgoing buffers (pts). Given certain network-conditions these two would become sufficiently different and the lost-event contained timestamp/duration that was really wrong. As an example GstAudioDecoder could produce a stream that jumps back and forth in time after receiving a lost-event. The previous behavior calculated the pts (based on the rtptime) inside the rtp_jitter_buffer_insert function, but now this functionality has been refactored into a new function rtp_jitter_buffer_calculate_pts that is called much earlier in the _chain function to make pts available to various calculations that wrongly used dts previously (like the lost-event). There are however two calculations where using dts is the right thing to do: calculating the receive-jitter and the rtx-round-trip-time, where the arrival time of the buffer from the network is the right metric (and is what dts in fact is today). The patch also adds two tests regarding B-frames or the “rtptime-going-backwards”-scenario, as there were some concerns that this patch might break this behavior (which the tests shows it does not).
Diffstat (limited to 'gst/rtpmanager/rtpjitterbuffer.h')
-rw-r--r--gst/rtpmanager/rtpjitterbuffer.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/rtpmanager/rtpjitterbuffer.h b/gst/rtpmanager/rtpjitterbuffer.h
index 08ce169f9..d04b5fd96 100644
--- a/gst/rtpmanager/rtpjitterbuffer.h
+++ b/gst/rtpmanager/rtpjitterbuffer.h
@@ -168,8 +168,7 @@ void rtp_jitter_buffer_reset_skew (RTPJitterBuffer *jbuf)
gboolean rtp_jitter_buffer_insert (RTPJitterBuffer *jbuf,
RTPJitterBufferItem *item,
- gboolean *head, gint *percent,
- GstClockTime base_time);
+ gboolean *head, gint *percent);
void rtp_jitter_buffer_disable_buffering (RTPJitterBuffer *jbuf, gboolean disabled);
@@ -190,4 +189,7 @@ void rtp_jitter_buffer_get_sync (RTPJitterBuffer *jbuf,
guint64 *timestamp, guint32 *clock_rate,
guint64 *last_rtptime);
+GstClockTime rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts,
+ guint32 rtptime, GstClockTime base_time);
+
#endif /* __RTP_JITTER_BUFFER_H__ */