From b1a286cd7c6b1a4bc6a8e81cac79aa3ccd5ff523 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Thu, 9 Oct 2014 01:18:16 +0300 Subject: [PATCH] h264parse: expose parsed profile and level to downstream Set parsed profile and level in src caps. https://bugzilla.gnome.org/show_bug.cgi?id=732239 --- gst/videoparsers/gsth264parse.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 89b33d5695..6c4a146e8b 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1364,6 +1364,19 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) gst_buffer_replace (&h264parse->codec_data, NULL); } + /* set profile and level in caps */ + if (sps) { + GstMapInfo map; + GstBuffer *sps_buf = h264parse->sps_nals[sps->id]; + + if (sps_buf) { + gst_buffer_map (sps_buf, &map, GST_MAP_READ); + gst_codec_utils_h264_caps_set_level_and_profile (caps, + map.data + 1, map.size - 1); + gst_buffer_unmap (sps_buf, &map); + } + } + gst_pad_set_caps (GST_BASE_PARSE_SRC_PAD (h264parse), caps); }