mpegdemux: send codec tag for each stream

This commit is contained in:
Arnaud Vrac 2013-08-02 20:37:30 +02:00 committed by Sebastian Dröge
parent c2092d9272
commit c4140f9c25
2 changed files with 16 additions and 2 deletions

View file

@ -10,6 +10,7 @@ libgstmpegpsdemux_la_CFLAGS = \
$(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstmpegpsdemux_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_API_VERSION) \
-lgstpbutils-$(GST_API_VERSION) \
$(GST_BASE_LIBS) $(GST_LIBS)
libgstmpegpsdemux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstmpegpsdemux_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)

View file

@ -52,6 +52,9 @@
#include <string.h>
#include <gst/tag/tag.h>
#include <gst/pbutils/pbutils.h>
#include "gstmpegdefs.h"
#include "gstmpegdemux.h"
@ -495,6 +498,12 @@ gst_flups_demux_create_stream (GstFluPSDemux * demux, gint id, gint stream_type)
g_free (stream_id);
gst_pad_set_caps (stream->pad, caps);
if (!stream->pending_tags)
stream->pending_tags = gst_tag_list_new_empty ();
gst_pb_utils_add_codec_description_to_tag_list (stream->pending_tags, NULL,
caps);
gst_caps_unref (caps);
GST_DEBUG_OBJECT (demux, "create pad %s, caps %" GST_PTR_FORMAT, name, caps);
g_free (name);
@ -788,8 +797,10 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
g_snprintf (cur_stream_name, 32, "audio-%d-language", i);
lang_code = gst_structure_get_string (structure, cur_stream_name);
if (lang_code) {
GstTagList *list = gst_tag_list_new_empty ();
GstTagList *list = temp->pending_tags;
if (!list)
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_LANGUAGE_CODE, lang_code, NULL);
temp->pending_tags = list;
@ -820,8 +831,10 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
g_snprintf (cur_stream_name, 32, "subpicture-%d-language", i);
lang_code = gst_structure_get_string (structure, cur_stream_name);
if (lang_code) {
GstTagList *list = gst_tag_list_new_empty ();
GstTagList *list = temp->pending_tags;
if (!list)
list = gst_tag_list_new_empty ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_LANGUAGE_CODE, lang_code, NULL);
temp->pending_tags = list;