From: Wim Taymans Date: Wed, 30 Oct 2013 15:49:36 +0000 (+0100) Subject: jitterbuffer: add new timestamp mode X-Git-Tag: 1.3.1~607 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43645d5981e6d37d97473cf96a81db92e5237d0c;p=platform%2Fupstream%2Fgst-plugins-good.git jitterbuffer: add new timestamp mode Add a new timestamp mode that assumes the local and remote clock are synchronized. It takes the first timestamp as a base time and then uses the RTP timestamps for the output PTS. --- diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c index b7aac10..76dfa5f 100644 --- a/gst/rtpmanager/rtpjitterbuffer.c +++ b/gst/rtpmanager/rtpjitterbuffer.c @@ -53,6 +53,8 @@ rtp_jitter_buffer_mode_get_type (void) {RTP_JITTER_BUFFER_MODE_SLAVE, "Slave receiver to sender clock", "slave"}, {RTP_JITTER_BUFFER_MODE_BUFFER, "Do low/high watermark buffering", "buffer"}, + {RTP_JITTER_BUFFER_MODE_SYNCED, "Synchronized sender and receiver clocks", + "synced"}, {0, NULL, NULL}, }; @@ -716,6 +718,12 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item, else dts = -1; break; + case RTP_JITTER_BUFFER_MODE_SYNCED: + /* synchronized clocks, take first timestamp as base, use RTP timestamps + * to interpolate */ + if (jbuf->base_time != -1) + dts = -1; + break; case RTP_JITTER_BUFFER_MODE_SLAVE: default: break; diff --git a/gst/rtpmanager/rtpjitterbuffer.h b/gst/rtpmanager/rtpjitterbuffer.h index 1389f26..1f7cbf4 100644 --- a/gst/rtpmanager/rtpjitterbuffer.h +++ b/gst/rtpmanager/rtpjitterbuffer.h @@ -45,6 +45,10 @@ typedef struct _RTPJitterBufferItem RTPJitterBufferItem; * low latency communications. * RTP_JITTER_BUFFER_MODE_BUFFER: buffer packets between low/high watermarks. * This mode is good for streaming communication. + * RTP_JITTER_BUFFER_MODE_SYNCED: sender and receiver clocks are synchronized, + * like #RTP_JITTER_BUFFER_MODE_SLAVE but skew is assumed to be 0. Good for + * low latency communication when sender and receiver clocks are + * synchronized and there is thus no clock skew. * RTP_JITTER_BUFFER_MODE_LAST: last buffer mode. * * The different buffer modes for a jitterbuffer. @@ -53,6 +57,7 @@ typedef enum { RTP_JITTER_BUFFER_MODE_NONE = 0, RTP_JITTER_BUFFER_MODE_SLAVE = 1, RTP_JITTER_BUFFER_MODE_BUFFER = 2, + RTP_JITTER_BUFFER_MODE_SYNCED = 3, RTP_JITTER_BUFFER_MODE_LAST } RTPJitterBufferMode;