2005-03-22 11:32:59 +00:00
|
|
|
Events
|
|
|
|
------
|
|
|
|
|
|
|
|
Events are objects passed around in parallel to the buffer dataflow to
|
|
|
|
notify elements of various events.
|
|
|
|
|
|
|
|
Events are received on pads using the event function. Some events should
|
|
|
|
be interleaved with the data stream so they require taking the STREAM_LOCK,
|
|
|
|
others don't.
|
|
|
|
|
|
|
|
Different types of events exist to implement various functionalities.
|
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GST_EVENT_FLUSH_START: data is to be discarded
|
|
|
|
GST_EVENT_FLUSH_STOP: data is allowed again
|
2011-06-06 14:11:31 +00:00
|
|
|
GST_EVENT_CAPS: Format information about the following buffers
|
2012-02-12 21:17:41 +00:00
|
|
|
GST_EVENT_STREAM_CONFIG: Stream config: stream headers and codec setup data
|
2011-06-06 14:11:31 +00:00
|
|
|
GST_EVENT_SEGMENT: Timing information for the following buffers
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GST_EVENT_TAG: Stream metadata.
|
2005-10-08 16:49:15 +00:00
|
|
|
GST_EVENT_BUFFERSIZE: Buffer size requirements
|
2011-06-06 14:11:31 +00:00
|
|
|
GST_EVENT_SINK_MESSAGE: An event turned into a message by sinks
|
|
|
|
GST_EVENT_EOS: no more data is to be expected on a pad.
|
2005-03-22 11:32:59 +00:00
|
|
|
GST_EVENT_QOS: A notification of the quality of service of the stream
|
|
|
|
GST_EVENT_SEEK: A seek should be performed to a new position in the stream
|
|
|
|
GST_EVENT_NAVIGATION: A navigation event.
|
2007-02-15 11:32:02 +00:00
|
|
|
GST_EVENT_LATENCY: Configure the latency in a pipeline
|
2011-06-06 14:11:31 +00:00
|
|
|
GST_EVENT_STEP: Stepping event
|
|
|
|
GST_EVENT_RECONFIGURE: stream reconfigure event
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
* GST_EVENT_DRAIN: Play all data downstream before returning.
|
|
|
|
|
|
|
|
* not yet implemented, under investigation, might be needed to do still frames
|
|
|
|
in DVD.
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
|
2011-05-18 09:08:52 +00:00
|
|
|
|
|
|
|
src pads
|
|
|
|
--------
|
|
|
|
|
2012-01-14 18:16:01 +00:00
|
|
|
A gst_pad_push_event() on a srcpad will first store the sticky event in the
|
|
|
|
sticky array before sending the event to the peer pad. If there is no peer pad
|
|
|
|
and the event was not stored in the sticky array, FALSE is returned.
|
2011-05-18 09:08:52 +00:00
|
|
|
|
2012-01-14 18:16:01 +00:00
|
|
|
Flushing pads will refuse the events and will not store the sticky events.
|
2011-05-18 09:08:52 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
|
2011-05-18 09:08:52 +00:00
|
|
|
sink pads
|
|
|
|
---------
|
|
|
|
|
2012-01-14 18:16:01 +00:00
|
|
|
A gst_pad_send_event() on a sinkpad will call the event function on the pad. If
|
|
|
|
the event function returns success, the sticky event is stored in the sticky
|
|
|
|
event array and the event is marked for update.
|
2011-06-06 14:11:31 +00:00
|
|
|
|
2012-01-14 18:16:01 +00:00
|
|
|
When the pad is flushing, the _send_event() function returns FALSE immediately.
|
2011-05-18 09:08:52 +00:00
|
|
|
|
2012-01-14 18:16:01 +00:00
|
|
|
When the next data item is pushed, the pending events are pushed first.
|
2011-05-18 09:08:52 +00:00
|
|
|
|
|
|
|
This ensures that the event function is never called for flushing pads and that
|
|
|
|
the sticky array only contains events for which the event function returned
|
|
|
|
success.
|
|
|
|
|
2011-05-18 09:21:52 +00:00
|
|
|
|
2011-05-18 09:08:52 +00:00
|
|
|
pad link
|
|
|
|
--------
|
|
|
|
|
2012-01-14 18:16:01 +00:00
|
|
|
When linking pads, the srcpad sticky events are marked for update when they are
|
|
|
|
different from the sinkpad events. The next buffer push will push the events to
|
|
|
|
the sinkpad.
|
2011-05-18 09:08:52 +00:00
|
|
|
|
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
FLUSH_START/STOP
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~~~~~~~~~~~~
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
|
|
|
|
A flush event is sent both downstream and upstream to clear any pending data
|
|
|
|
from the pipeline. This might be needed to make the graph more responsive
|
|
|
|
when the normal dataflow gets interrupted by for example a seek event.
|
|
|
|
|
|
|
|
Flushing happens in two stages.
|
|
|
|
|
2007-09-24 11:22:26 +00:00
|
|
|
1) a source element sends the FLUSH_START event to the downstream peer element.
|
|
|
|
The downstream element starts rejecting buffers from the upstream elements. It
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
sends the flush event further downstream and discards any buffers it is
|
|
|
|
holding as well as return from the chain function as soon as possible.
|
|
|
|
This makes sure that all upstream elements get unblocked.
|
|
|
|
This event is not synchronized with the STREAM_LOCK and can be done in the
|
|
|
|
application thread.
|
|
|
|
|
2007-09-24 11:22:26 +00:00
|
|
|
2) a source element sends the FLUSH_STOP event to indicate
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
that the downstream element can accept buffers again. The downstream
|
|
|
|
element sends the flush event to its peer elements. After this step dataflow
|
|
|
|
continues. The FLUSH_STOP call is synchronized with the STREAM_LOCK so any
|
|
|
|
data used by the chain function can safely freed here if needed. Any
|
|
|
|
pending EOS events should be discarded too.
|
|
|
|
|
|
|
|
After the flush completes the second stage, data is flowing again in the pipeline
|
|
|
|
and all buffers are more recent than those before the flush.
|
|
|
|
|
2005-09-26 17:40:39 +00:00
|
|
|
For elements that use the pullrange function, they send both flush events to
|
|
|
|
the upstream pads in the same way to make sure that the pullrange function
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
unlocks and any pending buffers are cleared in the upstream elements.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
A FLUSH_START may instruct the pipeline to distribute a new base_time to
|
|
|
|
elements so that the running_time is reset to 0.
|
|
|
|
(see part-clocks.txt and part-synchronisation.txt).
|
2007-02-15 11:32:02 +00:00
|
|
|
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
EOS
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
The EOS event can only be sent on a sinkpad. It is typically emited by the
|
|
|
|
source element when it has finished sending data. This event is mainly sent
|
|
|
|
in the streaming thread but can also be sent from the application thread.
|
|
|
|
|
|
|
|
The downstream element should forward the EOS event to its downstream peer
|
2007-02-15 11:32:02 +00:00
|
|
|
elements. This way the event will eventually reach the sinks which should
|
2005-10-08 16:49:15 +00:00
|
|
|
then post an EOS message on the bus when in PLAYING.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2005-09-24 14:14:03 +00:00
|
|
|
An element might want to flush its internally queued data before forwarding
|
|
|
|
the EOS event downstream. This flushing can be done in the same thread as
|
|
|
|
the one handling the EOS event.
|
|
|
|
|
2005-03-22 11:32:59 +00:00
|
|
|
For elements with multiple sink pads it might be possible to wait for EOS on
|
|
|
|
all the pads before forwarding the event.
|
|
|
|
|
|
|
|
The EOS event should always be interleaved with the data flow, therefore the
|
2007-09-24 11:22:26 +00:00
|
|
|
GStreamer core will take the STREAM_LOCK.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
Sometimes the EOS event is generated by another element than the source, for
|
2005-06-30 09:33:45 +00:00
|
|
|
example a demuxer element can generate an EOS event before the source element.
|
2005-03-22 11:32:59 +00:00
|
|
|
This is not a problem, the demuxer does not send an EOS event to the upstream
|
2012-01-14 18:16:01 +00:00
|
|
|
element but returns GST_FLOW_EOS, causing the source element to stop
|
2005-03-22 11:32:59 +00:00
|
|
|
sending data.
|
|
|
|
|
|
|
|
An element that sends EOS on a pad should stop sending data on that pad. Source
|
|
|
|
elements typically pause() their task for that purpose.
|
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
By default, a GstBin collects all EOS messages from all its sinks before
|
2005-10-08 16:49:15 +00:00
|
|
|
posting the EOS message to its parent.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
The EOS is only posted on the bus by the sink elements in the PLAYING state. If
|
|
|
|
the EOS event is received in the PAUSED state, it is queued until the element
|
|
|
|
goes to PLAYING.
|
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
A FLUSH_STOP event on an element flushes the EOS state and all pending EOS messages.
|
2005-10-08 16:49:15 +00:00
|
|
|
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2012-02-12 21:17:41 +00:00
|
|
|
GST_EVENT_STREAM_CONFIG
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
A stream config event is sent downstream by an element to pass stream headers
|
|
|
|
or codec/stream setup data to elements downstream.
|
|
|
|
|
|
|
|
Stream headers are buffers that are to be pre-pended to a stream to create
|
|
|
|
a valid decodable bitstream. This is useful for e.g. network elements who
|
|
|
|
will send such stream headers first when a new client connects in the middle
|
|
|
|
of a streaming session. The stream headers and the current data will then
|
|
|
|
create a valid decodable stream. Stream headers are usually also sent as
|
|
|
|
buffers at the beginning of a stream in addition to the rest of the stream
|
|
|
|
data.
|
|
|
|
|
|
|
|
Setup data is codec config data that must be communicated outside of the
|
|
|
|
data stream and is required by the consumer / downstream element in order
|
|
|
|
to interpret the data stream correctly. Prepending it to the data stream is
|
|
|
|
usually not allowed and will not yield a valid stream.
|
|
|
|
|
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
SEGMENT
|
|
|
|
~~~~~~~
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
A segment event is sent downstream by an element to indicate that the following
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
group of buffers start and end at the specified positions. The newsegment event
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
also contains the playback speed and the applied rate of the stream.
|
2005-06-30 09:33:45 +00:00
|
|
|
|
|
|
|
Since the stream time is always set to 0 at start and after a seek, a 0
|
|
|
|
point for all next buffer's timestamps has to be propagated through the
|
2011-06-06 14:11:31 +00:00
|
|
|
pipeline using the SEGMENT event.
|
2005-06-30 09:33:45 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
Before sending buffers, an element must send a SEGMENT event. An element is
|
|
|
|
free to refuse buffers if they were not preceeded by a SEGMENT event.
|
2005-07-19 09:19:06 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
Elements that sync to the clock should store the SEGMENT start and end values
|
2011-09-07 11:14:38 +00:00
|
|
|
and subtract the start value from the buffer timestamp before comparing
|
2005-07-15 13:44:19 +00:00
|
|
|
it against the stream time (see part-clocks.txt).
|
2005-06-30 09:33:45 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
An element is allowed to send out buffers with the SEGMENT start time already
|
2011-09-07 11:14:38 +00:00
|
|
|
subtracted from the timestamp. If it does so, it needs to send a corrected
|
2011-06-06 14:11:31 +00:00
|
|
|
SEGMENT downstream, ie, one with start time 0.
|
2005-06-30 09:33:45 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
A SEGMENT event should be generated as soon as possible in the pipeline and
|
2005-07-19 09:19:06 +00:00
|
|
|
is usually generated by a demuxer or source. The event is generated before
|
|
|
|
pushing the first buffer and after a seek, right before pushing the new buffer.
|
2005-06-30 09:33:45 +00:00
|
|
|
|
2011-06-06 14:11:31 +00:00
|
|
|
The SEGMENT event should be sent from the streaming thread and should be
|
2006-10-23 15:21:12 +00:00
|
|
|
serialized with the buffers.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
Buffers should be clipped within the range indicated by the newsegment event
|
2006-10-23 15:21:12 +00:00
|
|
|
start and stop values. Sinks must drop buffers with timestamps out of the
|
2011-06-06 14:11:31 +00:00
|
|
|
indicated segment range.
|
check/gst/gstvalue.c: Added subtract checks.
Original commit message from CVS:
* check/gst/gstvalue.c: (GST_START_TEST), (gst_value_suite):
Added subtract checks.
* docs/design/part-events.txt:
Some more docs about newsegment
* gst/gstbin.c: (gst_bin_change_state), (bin_bus_handler):
Fix FIXME
* gst/gstcaps.c: (gst_caps_to_string):
Add comments, cleanups.
* gst/gstelement.c: (gst_element_save_thyself):
cleanups
* gst/gstvalue.c: (gst_value_collect_int_range),
(gst_string_unwrap), (gst_value_union_int_int_range),
(gst_value_union_int_range_int_range),
(gst_value_intersect_int_int_range),
(gst_value_intersect_int_range_int_range),
(gst_value_intersect_double_double_range),
(gst_value_intersect_double_range_double_range),
(gst_value_intersect_list), (gst_value_subtract_int_int_range),
(gst_value_subtract_int_range_int),
(gst_value_subtract_double_range_double),
(gst_value_subtract_double_range_double_range),
(gst_value_subtract_from_list), (gst_value_subtract_list),
(gst_value_can_compare), (gst_value_compare_fraction):
Cleanups, add comments, remove unneeded asserts.
2005-08-16 09:42:50 +00:00
|
|
|
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
|
2005-10-08 16:49:15 +00:00
|
|
|
TAG
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~
|
2005-10-08 16:49:15 +00:00
|
|
|
|
|
|
|
The tag event is sent downstream when an element has discovered metadata
|
|
|
|
tags in a media file. Encoders can use this event to adjust their tagging
|
|
|
|
system. A tag is serialized with buffers.
|
|
|
|
|
|
|
|
|
|
|
|
BUFFERSIZE
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
NOTE: This event is not yet implemented.
|
2005-10-08 16:49:15 +00:00
|
|
|
|
|
|
|
An element can suggest a buffersize for downstream elements. This is
|
|
|
|
typically done by elements that produce data on multiple source pads
|
2010-11-01 13:32:43 +00:00
|
|
|
such as demuxers.
|
2005-10-08 16:49:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
QOS
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~
|
2005-10-08 16:49:15 +00:00
|
|
|
|
|
|
|
A QOS, or quality of service message, is generated in an element to report
|
2007-02-15 11:32:02 +00:00
|
|
|
to the upstream elements about the current quality of real-time performance
|
2007-09-24 11:22:26 +00:00
|
|
|
of the stream. This is typically done by the sinks that measure the amount
|
|
|
|
of framedrops they have. (see part-qos.txt)
|
2005-10-08 16:49:15 +00:00
|
|
|
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
SEEK
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
A seek event is issued by the application to configure the playback range
|
|
|
|
of a stream. It is called form the application thread and travels upstream.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
The seek event contains the new start and stop position of playback
|
|
|
|
after the seek is performed. Optionally the stop position can be left
|
docs/design/part-events.txt: Small update.
Original commit message from CVS:
* docs/design/part-events.txt:
Small update.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_do_sync), (gst_base_sink_activate_push),
(gst_base_sink_activate_pull):
Some more comments.
* gst/elements/gstfakesrc.c: (gst_fake_src_class_init),
(gst_fake_src_create):
Fix handoff marshall.
* gst/elements/gstidentity.c: (gst_identity_class_init),
(gst_identity_transform_ip):
We're a real inplace element.
* gst/gstbus.c: (gst_bus_post):
Added some comments.
* tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main):
* tests/muxing/case1.c: (main):
* tests/sched/dynamic-pipeline.c: (main):
* tests/sched/interrupt1.c: (main):
* tests/sched/interrupt2.c: (main):
* tests/sched/interrupt3.c: (main):
* tests/sched/runxml.c: (main):
* tests/sched/sched-stress.c: (main):
* tests/seeking/seeking1.c: (event_received), (main):
* tests/threadstate/threadstate2.c: (bus_handler), (timeout_func),
(main):
* tests/threadstate/threadstate3.c: (main):
* tests/threadstate/threadstate4.c: (main):
* tests/threadstate/threadstate5.c: (main):
Fix the tests.
2005-07-22 11:47:10 +00:00
|
|
|
at -1 to continue playback to the end of the stream. The seek event
|
|
|
|
also contains the new playback rate of the stream, 1.0 is normal playback,
|
|
|
|
2.0 double speed and negative values mean backwards playback.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2005-11-03 14:22:44 +00:00
|
|
|
A seek usually flushes the graph to minimize latency after the seek. This
|
2007-02-15 11:32:02 +00:00
|
|
|
behaviour is triggered by using the SEEK_FLUSH flag on the seek event.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
The seek event usually starts from the sink elements and travels upstream
|
|
|
|
from element to element until it reaches an element that can perform the
|
|
|
|
seek. No intermediate element is allowed to assume that a seek to this
|
|
|
|
location will happen. It is allowed to modify the start and stop times if it
|
|
|
|
needs to do so. this is typically the case if a seek is requested for a
|
|
|
|
non-time position.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
The actual seek is performed in the application thread so that success
|
|
|
|
or failure can be reported as a return value of the seek event. It is
|
|
|
|
therefore important that before executing the seek, the element acquires
|
2007-02-15 11:32:02 +00:00
|
|
|
the STREAM_LOCK so that the streaming thread and the seek get serialized.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2005-07-15 13:44:19 +00:00
|
|
|
The general flow of executing the seek with FLUSH is as follows:
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
1) unblock the streaming threads, they could be blocked in a chain
|
2007-02-15 11:32:02 +00:00
|
|
|
function. This is done by sending a FLUSH_START on all srcpads or by pausing
|
|
|
|
the streaming task, depending on the seek FLUSH flag.
|
2005-03-22 11:32:59 +00:00
|
|
|
The flush will make sure that all downstream elements unlock and
|
|
|
|
that control will return to this element chain/loop function.
|
|
|
|
We cannot lock the STREAM_LOCK before doing this since it might
|
|
|
|
cause a deadlock.
|
|
|
|
|
2006-03-13 10:32:26 +00:00
|
|
|
2) acquire the STREAM_LOCK. This will work since the chain/loop function
|
2007-02-15 11:32:02 +00:00
|
|
|
was unlocked/paused in step 1).
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2005-04-21 09:37:34 +00:00
|
|
|
3) perform the seek. since the STREAM_LOCK is held, the streaming thread
|
2005-06-30 09:33:45 +00:00
|
|
|
will wait for the seek to complete. Most likely, the stream thread
|
|
|
|
will pause because the peer elements are flushing.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
4) send a FLUSH_STOP event to all peer elements to allow streaming again.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
5) create a NEWSEGMENT event to signal the new buffer timestamp base time.
|
2007-04-28 11:29:54 +00:00
|
|
|
This event must be queued to be sent by the streaming thread.
|
2005-06-30 09:33:45 +00:00
|
|
|
|
|
|
|
6) start stopped tasks and unlock the STREAM_LOCK, dataflow will continue
|
2005-03-22 11:32:59 +00:00
|
|
|
now from the new position.
|
|
|
|
|
docs/design/: Some more docs in the works.
Original commit message from CVS:
* docs/design/part-dynamic.txt:
* docs/design/part-events.txt:
* docs/design/part-seeking.txt:
Some more docs in the works.
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_getcaps), (gst_base_transform_configure_caps),
(gst_base_transform_setcaps), (gst_base_transform_get_size),
(gst_base_transform_buffer_alloc), (gst_base_transform_event),
(gst_base_transform_handle_buffer),
(gst_base_transform_sink_activate_push),
(gst_base_transform_src_activate_pull),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
Refcounting fixes.
* gst/gstbus.c: (gst_bus_source_dispatch), (gst_bus_poll):
Cleanups.
* gst/gstevent.c: (gst_event_finalize):
Set SRC to NULL.
* gst/gstutils.c: (gst_element_unlink),
(gst_pad_get_parent_element), (gst_pad_proxy_getcaps),
(gst_pad_proxy_setcaps):
* gst/gstutils.h:
Add _get_parent_element() to get a pads parent as an element.
2005-07-18 08:28:48 +00:00
|
|
|
More information about the different seek types can be found in
|
|
|
|
part-seeking.txt.
|
|
|
|
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
NAVIGATION
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~~~~~~~
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
A navigation event is generated by a sink element to signal the elements
|
|
|
|
of a navigation event such as a mouse movement or button click.
|
2005-06-30 09:33:45 +00:00
|
|
|
Navigation events travel upstream.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
LATENCY
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~~~
|
2007-02-15 11:32:02 +00:00
|
|
|
|
|
|
|
A latency event is used to configure a certain latency in the pipeline. It
|
|
|
|
contains a single GstClockTime with the required latency. The latency value is
|
|
|
|
calculated by the pipeline and distributed to all sink elements before they are
|
|
|
|
set to PLAYING. The sinks will add the configured latency value to the
|
|
|
|
timestamps of the buffer in order to delay their presentation.
|
2007-03-07 17:13:17 +00:00
|
|
|
(See also part-latency.txt).
|
2007-02-15 11:32:02 +00:00
|
|
|
|
|
|
|
|
2006-01-18 18:05:43 +00:00
|
|
|
DRAIN
|
2010-11-01 13:32:43 +00:00
|
|
|
~~~~~
|
2006-01-18 18:05:43 +00:00
|
|
|
|
2010-11-01 13:32:43 +00:00
|
|
|
NOTE: This event is not yet implemented.
|
2007-02-15 11:32:02 +00:00
|
|
|
|
2006-01-18 18:05:43 +00:00
|
|
|
Drain event indicates that upstream is about to perform a real-time event, such
|
|
|
|
as pausing to present an interactive menu or such, and needs to wait for all
|
|
|
|
data it has sent to be played-out in the sink.
|
|
|
|
|
|
|
|
Drain should only be used by live elements, as it may otherwise occur during
|
|
|
|
prerolling.
|
|
|
|
|
|
|
|
Usually after draining the pipeline, an element either needs to modify timestamps,
|
|
|
|
or FLUSH to prevent subsequent data being discarded at the sinks for arriving
|
|
|
|
late (only applies during playback scenarios).
|
|
|
|
|