2006-02-28 15:54:06 +00:00
|
|
|
Streams
|
|
|
|
-------
|
|
|
|
|
|
|
|
This document describes the objects that are passed from element to
|
|
|
|
element in the streaming thread.
|
|
|
|
|
|
|
|
|
|
|
|
Stream objects
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~~~~~~~~~~
|
2006-02-28 15:54:06 +00:00
|
|
|
|
|
|
|
The following objects are to be expected in the streaming thread:
|
|
|
|
|
|
|
|
- events
|
2011-06-06 14:11:31 +00:00
|
|
|
- SEGMENT (S)
|
2006-02-28 15:54:06 +00:00
|
|
|
- EOS (EOS) *
|
|
|
|
- TAG (T)
|
|
|
|
- buffers (B) *
|
|
|
|
|
|
|
|
Objects marked with * need to be synchronised to the clock in sinks
|
|
|
|
and live sources.
|
|
|
|
|
|
|
|
|
|
|
|
Typical stream
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~~~~~~~~~~
|
2006-02-28 15:54:06 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
A typical stream starts with a segment event that marks the
|
2011-01-19 15:48:26 +00:00
|
|
|
buffer timestamp range. After that buffers are sent one after the
|
2006-02-28 15:54:06 +00:00
|
|
|
other. After the last buffer an EOS marks the end of the stream. No
|
2011-01-19 15:48:26 +00:00
|
|
|
more buffers are to be processed after the EOS event.
|
2006-02-28 15:54:06 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
+-+ +-++-+ +-+ +---+
|
|
|
|
|S| |B||B| ... |B| |EOS|
|
|
|
|
+-+ +-++-+ +-+ +---+
|
2006-02-28 15:54:06 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
1) SEGMENT, rate, start/stop, time
|
2006-03-13 10:32:26 +00:00
|
|
|
- marks valid buffer timestamp range (start, stop)
|
2007-03-07 17:13:17 +00:00
|
|
|
- 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)
|
2011-06-06 14:11:31 +00:00
|
|
|
- marks running_time of buffers. This is the time used to synchronize
|
|
|
|
against the clock.
|
2006-02-28 15:54:06 +00:00
|
|
|
|
|
|
|
2) N buffers
|
2011-06-06 14:11:31 +00:00
|
|
|
- displayable buffers are between start/stop of the SEGMENT. Buffers
|
2007-03-07 17:13:17 +00:00
|
|
|
outside the segment range should be dropped or clipped.
|
2006-03-13 10:32:26 +00:00
|
|
|
|
2007-03-07 17:13:17 +00:00
|
|
|
- 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
|
2006-03-13 10:32:26 +00:00
|
|
|
|
2007-10-22 15:37:43 +00:00
|
|
|
* a monotonically increasing value that can be used to synchronize
|
|
|
|
against the clock (See also part-synchronisation.txt).
|
2006-03-13 10:32:26 +00:00
|
|
|
|
2007-03-07 17:13:17 +00:00
|
|
|
- stream_time:
|
|
|
|
|
|
|
|
stream_time = (B.timestamp - NS.start) * NS.abs_applied_rate + NS.time
|
|
|
|
|
|
|
|
* current position in stream between 0 and duration.
|
2006-02-28 15:54:06 +00:00
|
|
|
|
|
|
|
3) EOS
|
2007-10-22 15:37:43 +00:00
|
|
|
- marks the end of data, nothing is to be expected after EOS, elements
|
|
|
|
should refuse more data and return GST_FLOW_UNEXPECTED. A FLUSH_STOP
|
|
|
|
event clears the EOS state of an element.
|
2006-03-13 10:32:26 +00:00
|
|
|
|
|
|
|
|