From 0331fb6203ecbe60230296ddf20e70d61e00eb7f Mon Sep 17 00:00:00 2001 From: Arnaud Vrac Date: Sun, 2 Sep 2012 20:19:17 +0200 Subject: [PATCH] mpeg4parser: parse complexity estimation header in video object layer https://bugzilla.gnome.org/show_bug.cgi?id=683254 --- gst-libs/gst/codecparsers/gstmpeg4parser.c | 34 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/codecparsers/gstmpeg4parser.c b/gst-libs/gst/codecparsers/gstmpeg4parser.c index 824927ff40..d9622c9c2b 100644 --- a/gst-libs/gst/codecparsers/gstmpeg4parser.c +++ b/gst-libs/gst/codecparsers/gstmpeg4parser.c @@ -1161,9 +1161,35 @@ gst_mpeg4_parse_video_object_layer (GstMpeg4VideoObjectLayer * vol, READ_UINT8 (&br, vol->quarter_sample, 1); READ_UINT8 (&br, vol->complexity_estimation_disable, 1); - if (!vol->complexity_estimation_disable) - goto complexity_estimation_error; + if (!vol->complexity_estimation_disable) { + guint8 estimation_method; + guint8 estimation_disable; + /* skip unneeded properties */ + READ_UINT8 (&br, estimation_method, 2); + if (estimation_method < 2) { + READ_UINT8 (&br, estimation_disable, 1); + if (!estimation_disable) + SKIP (&br, 6); + READ_UINT8 (&br, estimation_disable, 1); + if (!estimation_disable) + SKIP (&br, 4); + CHECK_MARKER (&br); + READ_UINT8 (&br, estimation_disable, 1); + if (!estimation_disable) + SKIP (&br, 4); + READ_UINT8 (&br, estimation_disable, 1); + if (!estimation_disable) + SKIP (&br, 6); + CHECK_MARKER (&br); + + if (estimation_method == 1) { + READ_UINT8 (&br, estimation_disable, 1); + if (!estimation_disable) + SKIP (&br, 2); + } + } + } READ_UINT8 (&br, vol->resync_marker_disable, 1); READ_UINT8 (&br, vol->data_partitioned, 1); @@ -1202,10 +1228,6 @@ failed: wrong_start_code: GST_WARNING ("got buffer with wrong start code"); goto failed; - -complexity_estimation_error: - GST_WARNING ("don't support complexity estimation"); - goto failed; } /**