Post an UMID tag with the current package's UMID

This commit is contained in:
Sebastian Dröge 2009-02-04 11:09:26 +01:00
parent c0557df34d
commit 3e2a880c6b
3 changed files with 15 additions and 0 deletions

View file

@ -36,9 +36,17 @@
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 ();

View 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;

View file

@ -154,4 +154,6 @@ typedef struct {
GHashTable *other_tags;
} MXFIndexTableSegment;
#define GST_TAG_MXF_UMID "mxf-umid"
#endif /* __MXF_TYPES_H__ */