From 399f560eea490ff1422b7951a91fb0e219966f13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 3 Dec 2008 08:04:38 +0000 Subject: [PATCH] gst/mxf/mxfdemux.c: Use a single "track_%u" src pad template and use the track ID of the playback package for the pad... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_handle_header_metadata_update_streams), (gst_mxf_demux_base_init): Use a single "track_%u" src pad template and use the track ID of the playback package for the pad name instead of the track ID of the source package, as the latter could be the same for more than one track if they're in different packages. --- ChangeLog | 10 ++++++++++ gst/mxf/mxfdemux.c | 54 +++++++++--------------------------------------------- 2 files changed, 19 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28b880a..6988657 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-12-03 Sebastian Dröge + + * gst/mxf/mxfdemux.c: + (gst_mxf_demux_handle_header_metadata_update_streams), + (gst_mxf_demux_base_init): + Use a single "track_%u" src pad template and use the track ID + of the playback package for the pad name instead of the track ID + of the source package, as the latter could be the same for + more than one track if they're in different packages. + 2008-12-01 David Schleef * ext/jp2k/gstjasperenc.c: Some compilers complain about diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 38b5300..cd74f4e 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -45,20 +45,8 @@ static GstStaticPadTemplate mxf_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS ("application/mxf") ); -static GstStaticPadTemplate audio_src_template = -GST_STATIC_PAD_TEMPLATE ("audio_%u", - GST_PAD_SRC, - GST_PAD_SOMETIMES, - GST_STATIC_CAPS_ANY); - -static GstStaticPadTemplate video_src_template = -GST_STATIC_PAD_TEMPLATE ("video_%u", - GST_PAD_SRC, - GST_PAD_SOMETIMES, - GST_STATIC_CAPS_ANY); - -static GstStaticPadTemplate data_src_template = -GST_STATIC_PAD_TEMPLATE ("data_%u", +static GstStaticPadTemplate mxf_src_template = +GST_STATIC_PAD_TEMPLATE ("track_%u", GST_PAD_SRC, GST_PAD_SOMETIMES, GST_STATIC_CAPS_ANY); @@ -1305,9 +1293,8 @@ gst_mxf_demux_handle_header_metadata_resolve_references (GstMXFDemux * demux) MXFMetadataEssenceContainerData, i); for (j = 0; j < demux->content_storage.n_essence_container_data; j++) { - if (mxf_ul_is_equal (&demux-> - content_storage.essence_container_data_uids[j], - &data->instance_uid)) { + if (mxf_ul_is_equal (&demux->content_storage. + essence_container_data_uids[j], &data->instance_uid)) { demux->content_storage.essence_container_data[j] = data; break; } @@ -1816,29 +1803,10 @@ gst_mxf_demux_handle_header_metadata_update_streams (GstMXFDemux * demux) GstPadTemplate *templ; gchar *pad_name; - switch (track_type) { - case MXF_METADATA_TRACK_PICTURE_ESSENCE: - templ = - gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (demux), - "video_%u"); - pad_name = g_strdup_printf ("video_%u", source_track->track_id); - break; - case MXF_METADATA_TRACK_SOUND_ESSENCE: - templ = - gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (demux), - "audio_%u"); - pad_name = g_strdup_printf ("audio_%u", source_track->track_id); - break; - case MXF_METADATA_TRACK_DATA_ESSENCE: - templ = - gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (demux), - "data_%u"); - pad_name = g_strdup_printf ("data_%u", source_track->track_id); - break; - default: - g_assert_not_reached (); - break; - } + templ = + gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (demux), + "track_%u"); + pad_name = g_strdup_printf ("track_%u", track->track_id); g_assert (templ != NULL); @@ -3223,11 +3191,7 @@ gst_mxf_demux_base_init (gpointer g_class) gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&mxf_sink_template)); gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&audio_src_template)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&video_src_template)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&data_src_template)); + gst_static_pad_template_get (&mxf_src_template)); gst_element_class_set_details_simple (element_class, "MXF Demuxer", "Codec/Demuxer", "Demux MXF files", "Sebastian Dröge "); -- 2.7.4