event: Add constructor and docs for the new STREAM_START event
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 27 Jan 2012 09:30:43 +0000 (10:30 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 27 Jan 2012 09:30:43 +0000 (10:30 +0100)
docs/gst/gstreamer-sections.txt
gst/gstevent.c
gst/gstevent.h
win32/common/libgstreamer.def

index 8fffedf..18f01b9 100644 (file)
@@ -941,6 +941,8 @@ gst_event_parse_flush_stop
 
 gst_event_new_eos
 
+gst_event_new_stream_start
+
 gst_event_new_segment
 gst_event_parse_segment
 gst_event_copy_segment
index 13cebc1..f06d515 100644 (file)
@@ -1317,3 +1317,23 @@ gst_event_parse_sink_message (GstEvent * event, GstMessage ** msg)
         GST_MESSAGE (g_value_dup_boxed (gst_structure_id_get_value
             (structure, GST_QUARK (MESSAGE))));
 }
+
+/**
+ * gst_event_new_stream_start
+ *
+ * Create a new STREAM_START event. The stream start event can only
+ * travel downstream synchronized with the buffer flow. It is expected
+ * to be the first event that is sent for a new stream.
+ *
+ * Source elements, demuxers and other elements that create new streams
+ * are supposed to send this event as the first event of a new stream. It
+ * should not be send after a flushing seek or in similar situations
+ * and is used to mark the beginning of a new logical stream.
+ *
+ * Returns: (transfer full): the new STREAM_START event.
+ */
+GstEvent *
+gst_event_new_stream_start (void)
+{
+  return gst_event_new (GST_EVENT_STREAM_START);
+}
index d6de8a5..6746ec8 100644 (file)
@@ -80,8 +80,9 @@ typedef enum {
  *                 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_STREAM_START: (unimplemented) event to mark the start of a new
- *                          stream.
+ * @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: (unimplemented) contains configuration information
  *                 for the stream, for example stream-headers and codec-data.
@@ -466,6 +467,9 @@ gboolean        gst_event_has_name              (GstEvent *event, const gchar *n
 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) G_GNUC_MALLOC;
 
index 76e8000..47fe59b 100644 (file)
@@ -417,6 +417,7 @@ EXPORTS
        gst_event_new_segment
        gst_event_new_sink_message
        gst_event_new_step
+       gst_event_new_stream_start
        gst_event_new_tag
        gst_event_parse_buffer_size
        gst_event_parse_caps