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
|
2012-07-09 15:20:49 +00:00
|
|
|
- STREAM_START (START)
|
|
|
|
- SEGMENT (SEGMENT)
|
|
|
|
- EOS * (EOS)
|
2006-02-28 15:54:06 +00:00
|
|
|
- TAG (T)
|
2012-07-09 15:20:49 +00:00
|
|
|
- buffers * (B)
|
2006-02-28 15:54:06 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2012-07-09 15:20:49 +00:00
|
|
|
A typical stream starts with a stream start event that marks the
|
|
|
|
start of the stream, followed by 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
|
|
|
|
2012-07-09 15:20:49 +00:00
|
|
|
+-----+-------+ +-++-+ +-+ +---+
|
|
|
|
|START|SEGMENT| |B||B| ... |B| |EOS|
|
|
|
|
+-----+-------+ +-++-+ +-+ +---+
|
2006-02-28 15:54:06 +00:00
|
|
|
|
2012-07-09 15:20:49 +00:00
|
|
|
1) STREAM_START
|
|
|
|
- marks the start of a stream; unlike the SEGMENT event, there
|
|
|
|
will be no STREAM_START event after flushing seeks.
|
|
|
|
|
|
|
|
2) 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
|
2015-04-04 17:18:03 +00:00
|
|
|
with a timestamp of S.start.
|
2007-03-07 17:13:17 +00:00
|
|
|
- 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
|
|
|
|
2012-07-09 15:20:49 +00:00
|
|
|
3) N buffers
|
2015-04-04 17:18:03 +00:00
|
|
|
- displayable buffers are between start/stop of the SEGMENT (S). 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:
|
|
|
|
|
2015-04-04 17:18:03 +00:00
|
|
|
if (S.rate > 0.0)
|
|
|
|
running_time = (B.timestamp - S.start) / ABS (S.rate) + S.base
|
2007-03-07 17:13:17 +00:00
|
|
|
else
|
2015-04-04 17:18:03 +00:00
|
|
|
running_time = (S.stop - B.timestamp) / ABS (S.rate) + S.base
|
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:
|
|
|
|
|
2015-04-04 17:18:03 +00:00
|
|
|
stream_time = (B.timestamp - S.start) * ABS (S.applied_rate) + S.time
|
2007-03-07 17:13:17 +00:00
|
|
|
|
|
|
|
* current position in stream between 0 and duration.
|
2006-02-28 15:54:06 +00:00
|
|
|
|
2012-07-09 15:20:49 +00:00
|
|
|
4) EOS
|
2007-10-22 15:37:43 +00:00
|
|
|
- marks the end of data, nothing is to be expected after EOS, elements
|
2012-01-14 18:16:01 +00:00
|
|
|
should refuse more data and return GST_FLOW_EOS. A FLUSH_STOP
|
2007-10-22 15:37:43 +00:00
|
|
|
event clears the EOS state of an element.
|
2006-03-13 10:32:26 +00:00
|
|
|
|
|
|
|
|
2012-07-09 15:20:49 +00:00
|
|
|
Elements
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
These events are generated typically either by the GstBaseSrc class for
|
|
|
|
sources operating in push mode, or by a parser/demuxer operating in pull-mode
|
|
|
|
and pushing parsed/demuxed data downstream.
|