summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2013-01-06 20:27:54 +0000
committerTim-Philipp Müller <tim@centricular.net>2013-03-31 11:47:40 +0100
commit0e5c1dcf6468d388543c310c12fcf95fdd16d08d (patch)
treed0d35b52001ae4afea24fff634c68ac341071d65 /gst
parentdd831b811421b3d7b6769a78ef0a29351e64ca66 (diff)
downloadgstreamer-0e5c1dcf6468d388543c310c12fcf95fdd16d08d.tar.gz
event: add stream flags to stream-start event
API: gst_event_set_stream_flags() API: gst_event_parse_stream_flags() API: GST_STREAM_FLAG_NONE API: GST_STREAM_FLAG_SPARSE https://bugzilla.gnome.org/show_bug.cgi?id=600648
Diffstat (limited to 'gst')
-rw-r--r--gst/gstevent.c40
-rw-r--r--gst/gstevent.h17
2 files changed, 56 insertions, 1 deletions
diff --git a/gst/gstevent.c b/gst/gstevent.c
index 1993eceecc..5517ecfb48 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -1404,7 +1404,8 @@ gst_event_new_stream_start (const gchar * stream_id)
g_return_val_if_fail (stream_id != NULL, NULL);
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_START),
- GST_QUARK (STREAM_ID), G_TYPE_STRING, stream_id, NULL);
+ GST_QUARK (STREAM_ID), G_TYPE_STRING, stream_id,
+ GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, GST_STREAM_FLAG_NONE, NULL);
return gst_event_new_custom (GST_EVENT_STREAM_START, s);
}
@@ -1436,6 +1437,43 @@ gst_event_parse_stream_start (GstEvent * event, const gchar ** stream_id)
}
/**
+ * gst_event_set_stream_flags:
+ * @event: a stream-start event
+ * @flags: the stream flags to set
+ *
+ * Since: 1.2
+ */
+void
+gst_event_set_stream_flags (GstEvent * event, GstStreamFlags flags)
+{
+ g_return_if_fail (event != NULL);
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
+ g_return_if_fail (gst_event_is_writable (event));
+
+ gst_structure_id_set (GST_EVENT_STRUCTURE (event),
+ GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, flags, NULL);
+}
+
+/**
+ * gst_event_parse_stream_flags:
+ * @event: a stream-start event
+ * @flags: (out): address of variable where to store the stream flags
+ *
+ * Since: 1.2
+ */
+void
+gst_event_parse_stream_flags (GstEvent * event, GstStreamFlags * flags)
+{
+ g_return_if_fail (event != NULL);
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
+
+ if (flags) {
+ gst_structure_id_get (GST_EVENT_STRUCTURE (event),
+ GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, flags, NULL);
+ }
+}
+
+/**
* gst_event_new_toc:
* @toc: (transfer none): #GstToc structure.
* @updated: whether @toc was updated or not.
diff --git a/gst/gstevent.h b/gst/gstevent.h
index f0de0adb23..cecbae04d3 100644
--- a/gst/gstevent.h
+++ b/gst/gstevent.h
@@ -367,6 +367,20 @@ typedef enum {
} GstQOSType;
/**
+ * GstStreamFlags:
+ * @GST_STREAM_FLAG_NONE: This stream has no special attributes
+ * @GST_STREAM_FLAG_SPARSE: This stream is a sparse stream (e.g. a subtitle
+ * stream), data may flow only in irregular intervals with large gaps in
+ * between.
+ *
+ * Since: 1.2
+ */
+typedef enum {
+ GST_STREAM_FLAG_NONE,
+ GST_STREAM_FLAG_SPARSE = (1 << 0)
+} GstStreamFlags;
+
+/**
* GstEvent:
* @mini_object: the parent structure
* @type: the #GstEventType of the event
@@ -463,6 +477,9 @@ void gst_event_set_seqnum (GstEvent *event, guint32 seqnum
GstEvent * gst_event_new_stream_start (const gchar *stream_id) G_GNUC_MALLOC;
void gst_event_parse_stream_start (GstEvent *event, const gchar **stream_id);
+void gst_event_set_stream_flags (GstEvent *event, GstStreamFlags flags);
+void gst_event_parse_stream_flags (GstEvent *event, GstStreamFlags *flags);
+
/* flush events */
GstEvent * gst_event_new_flush_start (void) G_GNUC_MALLOC;