From 1a37a6245479a1c02e95a751f2246f423aea7a20 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 22 Apr 2010 19:39:47 +0530 Subject: [PATCH] qtdemux: Export MPEG-4 video profile and level in stream caps This uses gstpbutils to extract the profile and level from the video object sequence and adds this to stream caps. This can be used as metadata and for fine-grained decoder selection. https://bugzilla.gnome.org/show_bug.cgi?id=616521 --- gst/qtdemux/qtdemux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index bd2e089556..53571be2e6 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -7484,6 +7484,13 @@ gst_qtdemux_handle_esds (GstQTDemux * qtdemux, QtDemuxStream * stream, * codecs. */ switch (object_type_id) { case 0x20: /* MPEG-4 */ + /* 4 bytes for the visual_object_sequence_start_code and 1 byte for the + * profile_and_level_indication */ + if (data_ptr != NULL && data_len >= 5 && + GST_READ_UINT32_BE (data_ptr) == 0x000001b0) { + gst_codec_utils_mpeg4video_caps_set_level_and_profile (stream->caps, + data_ptr + 4, data_len - 4); + } break; /* Nothing special needed here */ case 0x21: /* H.264 */ codec_name = "H.264 / AVC";