Post an UMID tag with the current package's UMID
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 4 Feb 2009 10:09:26 +0000 (11:09 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 4 Feb 2009 10:12:14 +0000 (11:12 +0100)
gst/mxf/mxf.c
gst/mxf/mxfdemux.c
gst/mxf/mxftypes.h

index 236e835..58fa030 100644 (file)
 GST_DEBUG_CATEGORY (mxf_debug);
 #define GST_CAT_DEFAULT mxf_debug
 
+static void
+mxf_init (void)
+{
+  gst_tag_register (GST_TAG_MXF_UMID, GST_TAG_FLAG_META,
+      G_TYPE_STRING, "UMID", "Unique Material Identifier", NULL);
+}
+
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
+  mxf_init ();
   mxf_metadata_init_types ();
   mxf_aes_bwf_init ();
   mxf_mpeg_init ();
index dcef0e0..b6719be 100644 (file)
@@ -648,6 +648,7 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux)
 done:
   if (memcmp (&ret->package_uid, &demux->current_package_uid, 32) != 0) {
     gchar current_package_string[96];
+    GstTagList *tags = gst_tag_list_new ();
 
     gst_mxf_demux_remove_pads (demux);
     memcpy (&demux->current_package_uid, &ret->package_uid, 32);
@@ -655,6 +656,10 @@ done:
     mxf_umid_to_string (&ret->package_uid, current_package_string);
     demux->current_package_string = g_strdup (current_package_string);
     g_object_notify (G_OBJECT (demux), "package");
+
+    gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_MXF_UMID,
+        demux->current_package_string, NULL);
+    gst_element_found_tags (GST_ELEMENT_CAST (demux), tags);
   }
   demux->current_package = ret;
 
index 73f4a83..a59ac74 100644 (file)
@@ -154,4 +154,6 @@ typedef struct {
   GHashTable *other_tags;
 } MXFIndexTableSegment;
 
+#define GST_TAG_MXF_UMID "mxf-umid"
+
 #endif /* __MXF_TYPES_H__ */