event: make TOC event multi-sticky

We need to send two kinds of TOCs downstream as events,
and need both to stick to the pads.

https://bugzilla.gnome.org/show_bug.cgi?id=678742
This commit is contained in:
Tim-Philipp Müller 2012-07-28 09:41:30 +01:00
parent ee6ab7c936
commit 85456357dd
4 changed files with 16 additions and 6 deletions

View file

@ -1627,12 +1627,20 @@ GstEvent *
gst_event_new_toc (GstToc * toc, gboolean updated) gst_event_new_toc (GstToc * toc, gboolean updated)
{ {
GstStructure *toc_struct; GstStructure *toc_struct;
GQuark id;
g_return_val_if_fail (toc != NULL, NULL); g_return_val_if_fail (toc != NULL, NULL);
GST_CAT_INFO (GST_CAT_EVENT, "creating toc event"); GST_CAT_INFO (GST_CAT_EVENT, "creating toc event");
toc_struct = gst_structure_new_id (GST_QUARK (EVENT_TOC), /* need different structure names so sticky_multi event stuff on pads
* works, i.e. both TOC events are kept around */
if (gst_toc_get_scope (toc) == GST_TOC_SCOPE_GLOBAL)
id = GST_QUARK (EVENT_TOC_GLOBAL);
else
id = GST_QUARK (EVENT_TOC_CURRENT);
toc_struct = gst_structure_new_id (id,
GST_QUARK (TOC), GST_TYPE_TOC, toc, GST_QUARK (TOC), GST_TYPE_TOC, toc,
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL); GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);

View file

@ -149,7 +149,7 @@ typedef enum {
GST_EVENT_BUFFERSIZE = GST_EVENT_MAKE_TYPE (90, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)), 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_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_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)), GST_EVENT_TOC = GST_EVENT_MAKE_TYPE (120, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
/* non-sticky downstream serialized */ /* non-sticky downstream serialized */
GST_EVENT_SEGMENT_DONE = GST_EVENT_MAKE_TYPE (150, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)), GST_EVENT_SEGMENT_DONE = GST_EVENT_MAKE_TYPE (150, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),

View file

@ -63,7 +63,8 @@ static const gchar *_quark_strings[] = {
GST_ELEMENT_METADATA_AUTHOR, "toc", "toc-entry", "updated", "extend-uid", GST_ELEMENT_METADATA_AUTHOR, "toc", "toc-entry", "updated", "extend-uid",
"uid", "tags", "sub-entries", "info", "GstMessageTag", "GstEventTag", "uid", "tags", "sub-entries", "info", "GstMessageTag", "GstEventTag",
"GstMessageResetTime", "GstMessageResetTime",
"GstMessageToc", "GstEventToc", "GstEventSegmentDone" "GstMessageToc", "GstEventTocGlobal", "GstEventTocCurrent",
"GstEventSegmentDone"
}; };
GQuark _priv_gst_quark_table[GST_QUARK_MAX]; GQuark _priv_gst_quark_table[GST_QUARK_MAX];

View file

@ -183,9 +183,10 @@ typedef enum _GstQuarkId
GST_QUARK_EVENT_TAG = 154, GST_QUARK_EVENT_TAG = 154,
GST_QUARK_MESSAGE_RESET_TIME = 155, GST_QUARK_MESSAGE_RESET_TIME = 155,
GST_QUARK_MESSAGE_TOC = 156, GST_QUARK_MESSAGE_TOC = 156,
GST_QUARK_EVENT_TOC = 157, GST_QUARK_EVENT_TOC_GLOBAL = 157,
GST_QUARK_EVENT_SEGMENT_DONE = 158, GST_QUARK_EVENT_TOC_CURRENT = 158,
GST_QUARK_MAX = 159 GST_QUARK_EVENT_SEGMENT_DONE = 159,
GST_QUARK_MAX = 160
} GstQuarkId; } GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX]; extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];