Hello again,
there's been a lot of talk about gst clock and time handling in general,
and it seems to cause a lot of confusion when mixed with RTP issues. I'm
still not 100% I understand everything right, but I decided to write down
my current understanding of the situation. Maybe this will help future
discussions. Corrections and comments are very welcome.
Use of clocks in gstreamer RTP
------------------------------
Design for gst clocks and time handling can be found at:
http://cvs.freedesktop.org/gstreamer/gstreamer/docs/design/part-clocks.txt?view=markup
Key points for RTP:
- every buffer has a timestamp (although not always
a valid one)
- there can be multiple clocks in a pipeline
- one of the clocks is selected as the pipeline clock,
which provides the base time (BT; see part-clocks.txt)
- when you run a pipeline with rtpbin, the media src (for
example "alsasrc") will be chosen as the clock source
- stream time (TS) in the case of RTP is the duration
since start of the RTP stream (or last NEWSEGMENT)
For RTP reception, timestamps are used as follows:
- upon scheduling out the first packet, or on resync, playout
buffer (seperate element or basertpdepayload) sets
the NEWSEGMENT time (DT) to value in the RTP 'timestamp'
header (the 32bit value converted into a gstreamer timestamp (64bit))
- DT is the start point for timestamps in the gst buffers sent
to depay->decoder->sink chain
- timestamps in the gst buffers are incremented according
to the _nominal_ rate of the RTP stream, not according
to the clock, nor according to the rate the packets
are received
- pipeline sink element uses the pipeline clock to schedule data
for playback
- drift will occur between playback (consumption) and the
rate the sender is creating the packets, and this must be
handled by the receive pipeline (multiple options)
For RTP sending side:
- gstbasertppayload.c sets the 'timestamp' header of
outgoing RTP packets according to current
pipeline clock, plus a random TS offset
- i.e. pipeline clock is used directly to generate
the RTP timestamps
--
under work: Sofia-SIP at http://sofia-sip.sf.net
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Farsight-devel mailing list
Farsight-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/farsight-devel