gstreamer/docs/design/part-streams.txt
Wim Taymans 88be8ba00f docs/design/: Add doc about synchronisation
Original commit message from CVS:
* docs/design/Makefile.am:
* docs/design/part-synchronisation.txt:
Add doc about synchronisation
* docs/design/draft-latency.txt:
* docs/design/part-TODO.txt:
* docs/design/part-clocks.txt:
* docs/design/part-events.txt:
* docs/design/part-gstbus.txt:
* docs/design/part-gstpipeline.txt:
* docs/design/part-live-source.txt:
* docs/design/part-messages.txt:
* docs/design/part-overview.txt:
* docs/design/part-streams.txt:
* docs/design/part-trickmodes.txt:
Documentation updates.
2007-03-07 17:13:17 +00:00

67 lines
1.9 KiB
Plaintext

Streams
-------
This document describes the objects that are passed from element to
element in the streaming thread.
Stream objects
--------------
The following objects are to be expected in the streaming thread:
- events
- NEW_SEGMENT (NS)
- EOS (EOS) *
- TAG (T)
- buffers (B) *
Objects marked with * need to be synchronised to the clock in sinks
and live sources.
Typical stream
--------------
A typical stream starts with a newsegment event that marks the
buffer timestamp range. After that buffers are send one after the
other. After the last buffer an EOS marks the end of the stream. No
more buffer are to be processed after the EOS event.
+--+ +-++-+ +-+ +---+
|NS| |B||B| ... |B| |EOS|
+--+ +-++-+ +-+ +---+
1) NEW_SEGMENT, rate, start/stop, time
- marks valid buffer timestamp range (start, stop)
- marks stream_time of buffers (time). This is the stream time of buffers
with a timestamp of NS.start.
- marks playback rate (rate). This is the required playback rate.
- marks applied rate (applied_rate). This is the already applied playback
rate. (See also part-trickmodes.txt)
2) N buffers
- displayable buffers are between start/stop of the NEW_SEGMENT. Buffers
outside the segment range should be dropped or clipped.
- running_time:
if (NS.rate > 0.0)
running_time = (B.timestamp - NS.start) / NS.abs_rate + NS.accum
else
running_time = (NS.stop - B.timestamp) / NS.abs_rate + NS.accum
* used to synchronize against the clock (See also
part-synchronisation.txt).
- stream_time:
stream_time = (B.timestamp - NS.start) * NS.abs_applied_rate + NS.time
* current position in stream between 0 and duration.
3) EOS
- marks the end of data, nothing is to be expected after EOS