/**
* GstEventTypeFlags:
- * @GST_EVENT_TYPE_UPSTREAM: Set if the event can travel upstream.
- * @GST_EVENT_TYPE_DOWNSTREAM: Set if the event can travel downstream.
- * @GST_EVENT_TYPE_SERIALIZED: Set if the event should be serialized with data
- * flow.
- * @GST_EVENT_TYPE_STICKY: Set if the event is sticky on the pads.
+ * @GST_EVENT_TYPE_UPSTREAM: Set if the event can travel upstream.
+ * @GST_EVENT_TYPE_DOWNSTREAM: Set if the event can travel downstream.
+ * @GST_EVENT_TYPE_SERIALIZED: Set if the event should be serialized with data
+ * flow.
+ * @GST_EVENT_TYPE_STICKY: Set if the event is sticky on the pads.
+ * @GST_EVENT_TYPE_STICKY_MULTI: Multiple sticky events can be on a pad, each
+ * identified by the event name.
*
* #GstEventTypeFlags indicate the aspects of the different #GstEventType
* values. You can get the type flags of a #GstEventType with the
GST_EVENT_TYPE_UPSTREAM = 1 << 0,
GST_EVENT_TYPE_DOWNSTREAM = 1 << 1,
GST_EVENT_TYPE_SERIALIZED = 1 << 2,
- GST_EVENT_TYPE_STICKY = 1 << 3
+ GST_EVENT_TYPE_STICKY = 1 << 3,
+ GST_EVENT_TYPE_STICKY_MULTI = 1 << 4
} GstEventTypeFlags;
/**
#define GST_EVENT_TYPE_BOTH \
(GST_EVENT_TYPE_UPSTREAM | GST_EVENT_TYPE_DOWNSTREAM)
-#define GST_EVENT_MAX_STICKY 16
-#define GST_EVENT_STICKY_SHIFT 8
-#define GST_EVENT_NUM_SHIFT (GST_EVENT_STICKY_SHIFT + 4)
+#define GST_EVENT_NUM_SHIFT (8)
/**
* GST_EVENT_MAKE_TYPE:
* @num: the event number to create
- * @idx: the index in the sticky array
* @flags: the event flags
*
* when making custom event types, use this macro with the num and
* the given flags
*/
-#define GST_EVENT_MAKE_TYPE(num,idx,flags) \
- (((num) << GST_EVENT_NUM_SHIFT) | ((idx) << GST_EVENT_STICKY_SHIFT) | (flags))
+#define GST_EVENT_MAKE_TYPE(num,flags) \
+ (((num) << GST_EVENT_NUM_SHIFT) | (flags))
#define FLAG(name) GST_EVENT_TYPE_##name
-#define GST_EVENT_STICKY_IDX_TYPE(type) (((type) >> GST_EVENT_STICKY_SHIFT) & 0xf)
-#define GST_EVENT_STICKY_IDX(ev) GST_EVENT_STICKY_IDX_TYPE(GST_EVENT_TYPE(ev))
-
/**
* GstEventType:
* @GST_EVENT_UNKNOWN: unknown event.
* from the pipeline and unblock all streaming threads.
* @GST_EVENT_FLUSH_STOP: Stop a flush operation. This event resets the
* running-time of the pipeline.
- * @GST_EVENT_EOS: End-Of-Stream. No more data is to be expected to follow
- * without a SEGMENT event.
+ * @GST_EVENT_STREAM_START: Event to mark the start of a new stream. Sent before any
+ * other serialized event and only sent at the start of a new stream,
+ * not after flushing seeks.
+ * @GST_EVENT_CAPS: #GstCaps event. Notify the pad of a new media type.
+ * @GST_EVENT_STREAM_CONFIG: contains configuration information for the stream,
+ * for example stream-headers and codec-data.
* @GST_EVENT_SEGMENT: A new media segment follows in the dataflow. The
* segment events contains information for clipping buffers and
* converting buffer timestamps to running-time and
* send messages that should be emitted in sync with
* rendering.
* Since: 0.10.26
+ * @GST_EVENT_EOS: End-Of-Stream. No more data is to be expected to follow
+ * without a SEGMENT event.
+ * @GST_EVENT_SEGMENT_DONE: (unimplemented) Marks the end of a segment playback.
+ * @GST_EVENT_GAP: (unimplemented) Marks a gap in the datastream.
+ * @GST_EVENT_TOC: An event which indicates that a new table of contents (TOC)
+ * was found or updated. Since: 0.10.37
* @GST_EVENT_QOS: A quality message. Used to indicate to upstream elements
* that the downstream elements should adjust their processing
* rate.
* execute the step operation. Since: 0.10.24
* @GST_EVENT_RECONFIGURE: A request for upstream renegotiating caps and reconfiguring.
* Since: 0.11.0
+ * @GST_EVENT_TOC_SELECT: A request for a new playback position based on TOC
+ * entry's UID. Since 0.10.37
* @GST_EVENT_CUSTOM_UPSTREAM: Upstream custom event
* @GST_EVENT_CUSTOM_DOWNSTREAM: Downstream custom event that travels in the
* data flow.
* @GST_EVENT_CUSTOM_DOWNSTREAM_OOB: Custom out-of-band downstream event.
+ * @GST_EVENT_CUSTOM_DOWNSTREAM_STICKY: Custom sticky downstream event.
* @GST_EVENT_CUSTOM_BOTH: Custom upstream or downstream event.
* In-band when travelling downstream.
* @GST_EVENT_CUSTOM_BOTH_OOB: Custom upstream or downstream out-of-band event.
*/
/* NOTE: keep in sync with quark registration in gstevent.c */
typedef enum {
- GST_EVENT_UNKNOWN = GST_EVENT_MAKE_TYPE (0, 0, 0),
+ GST_EVENT_UNKNOWN = GST_EVENT_MAKE_TYPE (0, 0),
+
/* bidirectional events */
- GST_EVENT_FLUSH_START = GST_EVENT_MAKE_TYPE (1, 0, FLAG(BOTH)),
- GST_EVENT_FLUSH_STOP = GST_EVENT_MAKE_TYPE (2, 0, FLAG(BOTH) | FLAG(SERIALIZED)),
+ GST_EVENT_FLUSH_START = GST_EVENT_MAKE_TYPE (10, FLAG(BOTH)),
+ GST_EVENT_FLUSH_STOP = GST_EVENT_MAKE_TYPE (20, FLAG(BOTH) | FLAG(SERIALIZED)),
+
/* downstream serialized events */
- GST_EVENT_CAPS = GST_EVENT_MAKE_TYPE (5, 1, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
- GST_EVENT_SEGMENT = GST_EVENT_MAKE_TYPE (6, 2, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
- GST_EVENT_TAG = GST_EVENT_MAKE_TYPE (7, 3, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
- GST_EVENT_BUFFERSIZE = GST_EVENT_MAKE_TYPE (8, 4, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
- GST_EVENT_SINK_MESSAGE = GST_EVENT_MAKE_TYPE (9, 5, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
- GST_EVENT_EOS = GST_EVENT_MAKE_TYPE (10, 6, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_STREAM_START = GST_EVENT_MAKE_TYPE (40, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_CAPS = GST_EVENT_MAKE_TYPE (50, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_STREAM_CONFIG = GST_EVENT_MAKE_TYPE (60, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_SEGMENT = GST_EVENT_MAKE_TYPE (70, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_TAG = GST_EVENT_MAKE_TYPE (80, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
+ GST_EVENT_BUFFERSIZE = GST_EVENT_MAKE_TYPE (90, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_SINK_MESSAGE = GST_EVENT_MAKE_TYPE (100, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
+ GST_EVENT_EOS = GST_EVENT_MAKE_TYPE (110, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+ GST_EVENT_TOC = GST_EVENT_MAKE_TYPE (120, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
+
+ /* non-sticky downstream serialized */
+ GST_EVENT_SEGMENT_DONE = GST_EVENT_MAKE_TYPE (150, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
+ GST_EVENT_GAP = GST_EVENT_MAKE_TYPE (160, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
/* upstream events */
- GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (15, 0, FLAG(UPSTREAM)),
- GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (16, 0, FLAG(UPSTREAM)),
- GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (17, 0, FLAG(UPSTREAM)),
- GST_EVENT_LATENCY = GST_EVENT_MAKE_TYPE (18, 0, FLAG(UPSTREAM)),
- GST_EVENT_STEP = GST_EVENT_MAKE_TYPE (19, 0, FLAG(UPSTREAM)),
- GST_EVENT_RECONFIGURE = GST_EVENT_MAKE_TYPE (20, 0, FLAG(UPSTREAM)),
+ GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (190, FLAG(UPSTREAM)),
+ GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (200, FLAG(UPSTREAM)),
+ GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (210, FLAG(UPSTREAM)),
+ GST_EVENT_LATENCY = GST_EVENT_MAKE_TYPE (220, FLAG(UPSTREAM)),
+ GST_EVENT_STEP = GST_EVENT_MAKE_TYPE (230, FLAG(UPSTREAM)),
+ GST_EVENT_RECONFIGURE = GST_EVENT_MAKE_TYPE (240, FLAG(UPSTREAM)),
+ GST_EVENT_TOC_SELECT = GST_EVENT_MAKE_TYPE (250, FLAG(UPSTREAM)),
/* custom events start here */
- GST_EVENT_CUSTOM_UPSTREAM = GST_EVENT_MAKE_TYPE (32, 0, FLAG(UPSTREAM)),
- GST_EVENT_CUSTOM_DOWNSTREAM = GST_EVENT_MAKE_TYPE (32, 0, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
- GST_EVENT_CUSTOM_DOWNSTREAM_OOB = GST_EVENT_MAKE_TYPE (32, 0, FLAG(DOWNSTREAM)),
- GST_EVENT_CUSTOM_BOTH = GST_EVENT_MAKE_TYPE (32, 0, FLAG(BOTH) | FLAG(SERIALIZED)),
- GST_EVENT_CUSTOM_BOTH_OOB = GST_EVENT_MAKE_TYPE (32, 0, FLAG(BOTH))
+ GST_EVENT_CUSTOM_UPSTREAM = GST_EVENT_MAKE_TYPE (270, FLAG(UPSTREAM)),
+ GST_EVENT_CUSTOM_DOWNSTREAM = GST_EVENT_MAKE_TYPE (280, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
+ GST_EVENT_CUSTOM_DOWNSTREAM_OOB = GST_EVENT_MAKE_TYPE (290, FLAG(DOWNSTREAM)),
+ GST_EVENT_CUSTOM_DOWNSTREAM_STICKY = GST_EVENT_MAKE_TYPE (300, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
+ GST_EVENT_CUSTOM_BOTH = GST_EVENT_MAKE_TYPE (310, FLAG(BOTH) | FLAG(SERIALIZED)),
+ GST_EVENT_CUSTOM_BOTH_OOB = GST_EVENT_MAKE_TYPE (320, FLAG(BOTH))
} GstEventType;
#undef FLAG
G_BEGIN_DECLS
-extern GType _gst_event_type;
+GST_EXPORT GType _gst_event_type;
#define GST_TYPE_EVENT (_gst_event_type)
#define GST_IS_EVENT(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_EVENT))
#define GST_EVENT(obj) (GST_EVENT_CAST(obj))
/**
- * GST_EVENT_TRACE_NAME:
- *
- * The name used for memory allocation tracing
- */
-#define GST_EVENT_TRACE_NAME "GstEvent"
-
-/**
* GST_EVENT_TYPE:
* @event: the event to query
*
*
* Returns: TRUE if @new_event was different from @old_event
*/
-#define gst_event_replace(old_event,new_event) \
- gst_mini_object_replace ((GstMiniObject **)(old_event), GST_MINI_OBJECT_CAST (new_event))
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC gboolean gst_event_replace (GstEvent **old_event, GstEvent *new_event);
+#endif
+
+static inline gboolean
+gst_event_replace (GstEvent **old_event, GstEvent *new_event)
+{
+ return gst_mini_object_replace ((GstMiniObject **) old_event, (GstMiniObject *) new_event);
+}
+
/**
* gst_event_steal:
* @old_event: (inout) (transfer full): pointer to a pointer to a #GstEvent
*
* Returns: the #GstEvent that was in @old_event
*/
-#define gst_event_steal(old_event) \
- GST_EVENT_CAST (gst_mini_object_steal ((GstMiniObject **)(old_event)))
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC GstEvent * gst_event_steal (GstEvent **old_event);
+#endif
+
+static inline GstEvent *
+gst_event_steal (GstEvent **old_event)
+{
+ return GST_EVENT_CAST (gst_mini_object_steal ((GstMiniObject **) old_event));
+}
+
/**
* gst_event_take:
* @old_event: (inout) (transfer full): pointer to a pointer to a #GstEvent
*
* Returns: TRUE if @new_event was different from @old_event
*/
-#define gst_event_take(old_event,new_event) \
- gst_mini_object_take ((GstMiniObject **)(old_event), GST_MINI_OBJECT_CAST (new_event))
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC gboolean gst_event_take (GstEvent **old_event, GstEvent *new_event);
+#endif
+
+static inline gboolean
+gst_event_take (GstEvent **old_event, GstEvent *new_event)
+{
+ return gst_mini_object_take ((GstMiniObject **) old_event, (GstMiniObject *) new_event);
+}
/**
* GstQOSType:
} GstQOSType;
/**
+ * GstStreamConfigFlags:
+ * @GST_STREAM_CONFIG_FLAG_NONE: no flags set
+ *
+ * GstStreamConfigFlags are flags passed with the stream config event, see
+ * gst_event_new_stream_config().
+ */
+typedef enum {
+ GST_STREAM_CONFIG_FLAG_NONE = 0
+} GstStreamConfigFlags;
+
+/**
* GstEvent:
* @mini_object: the parent structure
* @type: the #GstEventType of the event
* @timestamp: the timestamp of the event
+ * @seqnum: the sequence number of the event
*
* A #GstEvent.
*/
GType gst_event_get_type (void);
/* custom event */
-GstEvent* gst_event_new_custom (GstEventType type, GstStructure *structure);
+GstEvent* gst_event_new_custom (GstEventType type, GstStructure *structure) G_GNUC_MALLOC;
const GstStructure *
gst_event_get_structure (GstEvent *event);
guint32 gst_event_get_seqnum (GstEvent *event);
void gst_event_set_seqnum (GstEvent *event, guint32 seqnum);
+/* Stream start event */
+GstEvent * gst_event_new_stream_start (void) G_GNUC_MALLOC;
+
/* flush events */
-GstEvent * gst_event_new_flush_start (void);
+GstEvent * gst_event_new_flush_start (void) G_GNUC_MALLOC;
-GstEvent * gst_event_new_flush_stop (gboolean reset_time);
+GstEvent * gst_event_new_flush_stop (gboolean reset_time) G_GNUC_MALLOC;
void gst_event_parse_flush_stop (GstEvent *event, gboolean *reset_time);
/* EOS event */
-GstEvent * gst_event_new_eos (void);
+GstEvent * gst_event_new_eos (void) G_GNUC_MALLOC;
+
+/* GAP event */
+GstEvent * gst_event_new_gap (GstClockTime timestamp,
+ GstClockTime duration) G_GNUC_MALLOC;
+
+void gst_event_parse_gap (GstEvent * event,
+ GstClockTime * timestamp,
+ GstClockTime * duration);
/* Caps events */
-GstEvent * gst_event_new_caps (GstCaps *caps);
+GstEvent * gst_event_new_caps (GstCaps *caps) G_GNUC_MALLOC;
void gst_event_parse_caps (GstEvent *event, GstCaps **caps);
+/* Stream config */
+GstEvent * gst_event_new_stream_config (GstStreamConfigFlags flags) G_GNUC_MALLOC;
+
+void gst_event_parse_stream_config (GstEvent * event, GstStreamConfigFlags * flags);
+
+
+void gst_event_set_stream_config_setup_data (GstEvent * event, GstBuffer * buf);
+
+gboolean gst_event_parse_stream_config_setup_data (GstEvent * event, GstBuffer ** buf);
+
+
+void gst_event_add_stream_config_header (GstEvent * event, GstBuffer * buf);
+
+guint gst_event_get_n_stream_config_headers (GstEvent * event);
+
+gboolean gst_event_parse_nth_stream_config_header (GstEvent * event, guint index, GstBuffer ** buf);
+
/* segment event */
-GstEvent* gst_event_new_segment (GstSegment *segment);
+GstEvent* gst_event_new_segment (const GstSegment *segment) G_GNUC_MALLOC;
void gst_event_parse_segment (GstEvent *event, const GstSegment **segment);
void gst_event_copy_segment (GstEvent *event, GstSegment *segment);
/* tag event */
-GstEvent* gst_event_new_tag (GstTagList *taglist);
+GstEvent* gst_event_new_tag (const gchar *name, GstTagList *taglist) G_GNUC_MALLOC;
void gst_event_parse_tag (GstEvent *event, GstTagList **taglist);
+/* TOC event */
+GstEvent* gst_event_new_toc (GstToc *toc, gboolean updated);
+void gst_event_parse_toc (GstEvent *event, GstToc **toc, gboolean *updated);
+
+
/* buffer */
GstEvent * gst_event_new_buffer_size (GstFormat format, gint64 minsize, gint64 maxsize,
- gboolean async);
+ gboolean async) G_GNUC_MALLOC;
void gst_event_parse_buffer_size (GstEvent *event, GstFormat *format, gint64 *minsize,
gint64 *maxsize, gboolean *async);
/* sink message */
-GstEvent* gst_event_new_sink_message (GstMessage *msg);
+GstEvent* gst_event_new_sink_message (const gchar *name, GstMessage *msg) G_GNUC_MALLOC;
void gst_event_parse_sink_message (GstEvent *event, GstMessage **msg);
/* QOS events */
GstEvent* gst_event_new_qos (GstQOSType type, gdouble proportion,
- GstClockTimeDiff diff, GstClockTime timestamp);
+ GstClockTimeDiff diff, GstClockTime timestamp) G_GNUC_MALLOC;
void gst_event_parse_qos (GstEvent *event, GstQOSType *type,
gdouble *proportion, GstClockTimeDiff *diff,
GstClockTime *timestamp);
/* seek event */
GstEvent* gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags,
GstSeekType start_type, gint64 start,
- GstSeekType stop_type, gint64 stop);
+ GstSeekType stop_type, gint64 stop) G_GNUC_MALLOC;
void gst_event_parse_seek (GstEvent *event, gdouble *rate, GstFormat *format,
GstSeekFlags *flags,
GstSeekType *start_type, gint64 *start,
GstSeekType *stop_type, gint64 *stop);
/* navigation event */
-GstEvent* gst_event_new_navigation (GstStructure *structure);
+GstEvent* gst_event_new_navigation (GstStructure *structure) G_GNUC_MALLOC;
/* latency event */
-GstEvent* gst_event_new_latency (GstClockTime latency);
+GstEvent* gst_event_new_latency (GstClockTime latency) G_GNUC_MALLOC;
void gst_event_parse_latency (GstEvent *event, GstClockTime *latency);
/* step event */
GstEvent* gst_event_new_step (GstFormat format, guint64 amount, gdouble rate,
- gboolean flush, gboolean intermediate);
+ gboolean flush, gboolean intermediate) G_GNUC_MALLOC;
void gst_event_parse_step (GstEvent *event, GstFormat *format, guint64 *amount,
gdouble *rate, gboolean *flush, gboolean *intermediate);
/* renegotiate event */
-GstEvent* gst_event_new_reconfigure (void);
+GstEvent* gst_event_new_reconfigure (void) G_GNUC_MALLOC;
+
+/* TOC select event */
+GstEvent* gst_event_new_toc_select (const gchar *uid) G_GNUC_MALLOC;
+void gst_event_parse_toc_select (GstEvent *event, gchar **uid);
G_END_DECLS