mpegvideoparse: Use pbutils API to create the VIDEO_CODEC tag string

This commit is contained in:
Sebastian Dröge 2013-12-16 10:22:24 +01:00
parent 188b445fdd
commit 6fbc101d19

View file

@ -27,7 +27,8 @@
#endif #endif
#include <string.h> #include <string.h>
#include <gst/base/gstbytereader.h> #include <gst/base/base.h>
#include <gst/pbutils/pbutils.h>
#include <gst/codecparsers/gstmpegvideometa.h> #include <gst/codecparsers/gstmpegvideometa.h>
#include "gstmpegvideoparse.h" #include "gstmpegvideoparse.h"
@ -943,16 +944,16 @@ gst_mpegv_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
* have already been sent */ * have already been sent */
if (G_UNLIKELY (mpvparse->send_codec_tag)) { if (G_UNLIKELY (mpvparse->send_codec_tag)) {
gchar *codec; GstCaps *caps;
/* codec tag */ /* codec tag */
codec = taglist = gst_tag_list_new_empty ();
g_strdup_printf ("MPEG %d Video", caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
(mpvparse->config_flags & FLAG_MPEG2) ? 2 : 1); gst_pb_utils_add_codec_description_to_tag_list (taglist,
taglist = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec, NULL); GST_TAG_VIDEO_CODEC, caps);
g_free (codec); gst_caps_unref (caps);
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (mpvparse), gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (parse),
gst_event_new_tag (taglist)); gst_event_new_tag (taglist));
mpvparse->send_codec_tag = FALSE; mpvparse->send_codec_tag = FALSE;