From d35d7561a3e0e7950ddea26a4317cbbd405e6b0d Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 25 May 2011 14:38:21 +0300 Subject: [PATCH 1/2] codec-utils: fix mpeg4 level verification The current condition would never be true. As levels<6 are asp and levels>7 and <14 are fgs, we should return NULL for cases 6,7,14,15. --- gst-libs/gst/pbutils/codec-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/pbutils/codec-utils.c b/gst-libs/gst/pbutils/codec-utils.c index f885fe1ff1..2fe49b2f3f 100644 --- a/gst-libs/gst/pbutils/codec-utils.c +++ b/gst-libs/gst/pbutils/codec-utils.c @@ -707,7 +707,7 @@ gst_codec_utils_mpeg4video_get_level (const guint8 * vis_obj_seq, guint len) break; case 0xf: - if (level_id == 7 && level_id > 0xd) + if (level_id == 6 || level_id == 7 || level_id > 0xd) return NULL; break; } From 2b32faad913c37781cb5647a39b02c8d72857826 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 27 May 2011 11:39:21 +0300 Subject: [PATCH 2/2] code-utile: fix level descriptions for fgs fgs levels range from 8-13 and are mapped to 0-5. --- gst-libs/gst/pbutils/codec-utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/pbutils/codec-utils.c b/gst-libs/gst/pbutils/codec-utils.c index 2fe49b2f3f..65483a3aa6 100644 --- a/gst-libs/gst/pbutils/codec-utils.c +++ b/gst-libs/gst/pbutils/codec-utils.c @@ -718,6 +718,9 @@ gst_codec_utils_mpeg4video_get_level (const guint8 * vis_obj_seq, guint len) else if (profile_id == 0 && level_id == 9) /* Simple Profile / Level 0b */ return "0b"; + else if (profile_id == 0xf && level_id > 7) + /* Fine Granularity Scalable Profile */ + return digit_to_string (level_id - 8); else if (level_id <= level_max[profile_id]) /* Levels for all other cases */ return digit_to_string (level_id);