pbutils: Add SP levels 4a, 5 and 6
authorJens Georg <jensg@openismus.com>
Thu, 28 Jul 2011 12:43:53 +0000 (14:43 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 3 Aug 2011 08:05:51 +0000 (10:05 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=655503

gst-libs/gst/pbutils/codec-utils.c

index 0dac153..282e03e 100644 (file)
@@ -712,13 +712,16 @@ gst_codec_utils_mpeg4video_get_profile (const guint8 * vis_obj_seq, guint len)
 const gchar *
 gst_codec_utils_mpeg4video_get_level (const guint8 * vis_obj_seq, guint len)
 {
-  /* The profile/level codes are from 14496-2, table G-1, and the Wireshark
-   * sources: epan/dissectors/packet-mp4ves.c
+  /* The profile/level codes are from 14496-2, table G-1, the Wireshark
+   * sources: epan/dissectors/packet-mp4ves.c and the Xvid Sources:
+   * src/xvid.h.
+   * Levels 4a and 5 for SP were added in Amendment 2, level 6 in Amendment 4
+   * (see Xvid sources vfw/config.c)
    *
    * Each profile has a different maximum level it defines. Some of them still
    * need special case handling, because not all levels start from 1, and the
    * Simple profile defines an intermediate level as well. */
-  static const int level_max[] = { 3, 2, 2, 4, 2, 1, 2, 2, 2, 4, 3, 4, 2, 3, 4,
+  static const int level_max[] = { 6, 2, 2, 4, 2, 1, 2, 2, 2, 4, 3, 4, 2, 3, 4,
     5
   };
   int profile_id, level_id;
@@ -772,6 +775,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 == 0 && level_id == 4)
+    /* Simple Profile / Level 4a */
+    return "4a";
   else if (profile_id == 0xf && level_id > 7)
     /* Fine Granularity Scalable Profile */
     return digit_to_string (level_id - 8);