mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
8377afc0ba
Original commit message from CVS: * check/Makefile.am: * check/gst/gstevents.c: (GST_START_TEST), (event_probe), (test_event), (timediff), (gstevents_suite), (main): I wrote a test! * docs/design/part-seeking.txt: Spelling correction * docs/gst/tmpl/gstevent.sgml: Docs updates. * gst/base/gstbasesink.c: (gst_base_sink_handle_object): Treat a buffer-without-newsegment the same as a receiving a newsegment not in time format, and disable syncing to the clock with a warning. * gst/gstbus.c: (gst_bus_set_sync_handler): Assert if anyone tries to replace the existing sync_handler for bus, as only the owner should be setting it. * gst/gstevent.h: Have a fixed set of custom event enums with events identified by their structure name (as in 0.8), rather than a free-for-all allowing collisions between enum values from different plugins. * gst/gstpad.c: (gst_pad_class_init): Docs change. * gst/gstqueue.c: (gst_queue_handle_sink_event): Handle out-of-band downstream events from the sending thread.
312 lines
5 KiB
Text
312 lines
5 KiB
Text
<!-- ##### SECTION Title ##### -->
|
|
GstEvent
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
Structure describing events that are passed up and down a pipeline
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
<para>
|
|
The event classes are used to construct and query events.
|
|
</para>
|
|
|
|
<para>
|
|
Events are usually created with gst_event_new() which takes the event type as an argument.
|
|
properties specific to the event can be set afterwards with the provided macros.
|
|
The event should be unreferenced with gst_event_unref().
|
|
</para>
|
|
<para>
|
|
gst_event_new_seek() is a usually used to create a seek event and it takes the
|
|
needed parameters for a seek event.
|
|
</para>
|
|
<para>
|
|
gst_event_new_flush() creates a new flush event.
|
|
</para>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
#GstPad, #GstElement
|
|
</para>
|
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
<!-- ##### STRUCT GstEvent ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@mini_object:
|
|
@type:
|
|
@timestamp:
|
|
@src:
|
|
@structure:
|
|
|
|
<!-- ##### ENUM GstEventType ##### -->
|
|
<para>
|
|
The different major types of events.
|
|
</para>
|
|
|
|
@GST_EVENT_UNKNOWN: unknown event.
|
|
@GST_EVENT_FLUSH_START:
|
|
@GST_EVENT_FLUSH_STOP:
|
|
@GST_EVENT_EOS: an end-of-stream event.
|
|
@GST_EVENT_NEWSEGMENT:
|
|
@GST_EVENT_TAG:
|
|
@GST_EVENT_FILLER:
|
|
@GST_EVENT_QOS: a quality of service event
|
|
@GST_EVENT_SEEK: a seek event.
|
|
@GST_EVENT_NAVIGATION:
|
|
@GST_EVENT_CUSTOM_UP:
|
|
@GST_EVENT_CUSTOM_DS:
|
|
@GST_EVENT_CUSTOM_DS_OOB:
|
|
@GST_EVENT_CUSTOM_BOTH:
|
|
@GST_EVENT_CUSTOM_BOTH_OOB:
|
|
|
|
<!-- ##### MACRO GST_EVENT_TRACE_NAME ##### -->
|
|
<para>
|
|
The name used for memory allocation tracing
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_EVENT_TYPE ##### -->
|
|
<para>
|
|
Get the event type.
|
|
</para>
|
|
|
|
@event: The event to query.
|
|
|
|
|
|
<!-- ##### MACRO GST_EVENT_TIMESTAMP ##### -->
|
|
<para>
|
|
Get the timestamp of the event.
|
|
</para>
|
|
|
|
@event: The event to query.
|
|
|
|
|
|
<!-- ##### MACRO GST_EVENT_SRC ##### -->
|
|
<para>
|
|
The source object that generated this event
|
|
</para>
|
|
|
|
@event: The event to query
|
|
|
|
|
|
<!-- ##### ENUM GstSeekType ##### -->
|
|
<para>
|
|
The different types of seek events. When constructing a seek event a format,
|
|
a seek method and optional flags are OR-ed together. The seek event is then
|
|
inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().
|
|
|
|
Following example illustrates how to insert a seek event (1 second in the stream)
|
|
in a pipeline.
|
|
<example>
|
|
<title>Insertion of a seek event into a pipeline</title>
|
|
<programlisting>
|
|
gboolean res;
|
|
GstEvent *event;
|
|
|
|
event = gst_event_new_seek (
|
|
GST_FORMAT_TIME | /* seek on time */
|
|
GST_SEEK_METHOD_SET | /* set the absolute position */
|
|
GST_SEEK_FLAG_FLUSH, /* flush any pending data */
|
|
1 * GST_SECOND); /* the seek offset (1 second) */
|
|
|
|
res = gst_element_send_event (GST_ELEMENT (osssink), event);
|
|
if (!res) {
|
|
g_warning ("seek failed");
|
|
}
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
|
|
@GST_SEEK_TYPE_NONE:
|
|
@GST_SEEK_TYPE_CUR:
|
|
@GST_SEEK_TYPE_SET:
|
|
@GST_SEEK_TYPE_END:
|
|
|
|
<!-- ##### MACRO gst_event_ref ##### -->
|
|
<para>
|
|
Increase the refcount of this event
|
|
</para>
|
|
|
|
@ev: The event to refcount
|
|
|
|
|
|
<!-- ##### MACRO gst_event_unref ##### -->
|
|
<para>
|
|
Decrease the refcount of an event, freeing it if the refcount reaches 0
|
|
</para>
|
|
|
|
@ev: The event to unref
|
|
|
|
|
|
<!-- ##### MACRO gst_event_copy ##### -->
|
|
<para>
|
|
Copy the event using the event specific copy function
|
|
</para>
|
|
|
|
@ev: The event to copy
|
|
@Returns: A new event that is a copy of the given input event
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_custom ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@type:
|
|
@structure:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_get_structure ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@event:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_flush_start ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_flush_stop ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_eos ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_newsegment ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@rate:
|
|
@format:
|
|
@start_value:
|
|
@stop_value:
|
|
@base:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_parse_newsegment ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@event:
|
|
@rate:
|
|
@format:
|
|
@start_value:
|
|
@end_value:
|
|
@base:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_tag ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@taglist:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_parse_tag ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@event:
|
|
@taglist:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_filler ##### -->
|
|
<para>
|
|
Create a new dummy event that should be ignored
|
|
</para>
|
|
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_qos ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@proportion:
|
|
@diff:
|
|
@timestamp:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_parse_qos ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@event:
|
|
@proportion:
|
|
@diff:
|
|
@timestamp:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_seek ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@rate:
|
|
@format:
|
|
@flags:
|
|
@cur_type:
|
|
@cur:
|
|
@stop_type:
|
|
@stop:
|
|
@Returns:
|
|
<!-- # Unused Parameters # -->
|
|
@type:
|
|
@offset:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_parse_seek ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@event:
|
|
@rate:
|
|
@format:
|
|
@flags:
|
|
@cur_type:
|
|
@cur:
|
|
@stop_type:
|
|
@stop:
|
|
|
|
|
|
<!-- ##### FUNCTION gst_event_new_navigation ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@structure:
|
|
@Returns:
|
|
|
|
|