summaryrefslogtreecommitdiff
path: root/gst/videoparsers
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2013-12-16 10:22:24 +0100
committerSebastian Dröge <sebastian@centricular.com>2013-12-16 10:22:24 +0100
commit6fbc101d193e97e78a15beab1eaf1d94a19d3128 (patch)
tree240a77d86081eff1e8c05e36bf45da0576ebecdc /gst/videoparsers
parent188b445fdd6437dd729ce4ef4abffbd6990f795a (diff)
mpegvideoparse: Use pbutils API to create the VIDEO_CODEC tag string
Diffstat (limited to 'gst/videoparsers')
-rw-r--r--gst/videoparsers/gstmpegvideoparse.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c
index 8f5ef8445..5e02a8bab 100644
--- a/gst/videoparsers/gstmpegvideoparse.c
+++ b/gst/videoparsers/gstmpegvideoparse.c
@@ -27,7 +27,8 @@
#endif
#include <string.h>
-#include <gst/base/gstbytereader.h>
+#include <gst/base/base.h>
+#include <gst/pbutils/pbutils.h>
#include <gst/codecparsers/gstmpegvideometa.h>
#include "gstmpegvideoparse.h"
@@ -943,16 +944,16 @@ gst_mpegv_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
* have already been sent */
if (G_UNLIKELY (mpvparse->send_codec_tag)) {
- gchar *codec;
+ GstCaps *caps;
/* codec tag */
- codec =
- g_strdup_printf ("MPEG %d Video",
- (mpvparse->config_flags & FLAG_MPEG2) ? 2 : 1);
- taglist = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec, NULL);
- g_free (codec);
+ taglist = gst_tag_list_new_empty ();
+ caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
+ gst_pb_utils_add_codec_description_to_tag_list (taglist,
+ GST_TAG_VIDEO_CODEC, caps);
+ 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));
mpvparse->send_codec_tag = FALSE;