h264parse: add constrained and progressive profiles
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 6 Mar 2018 14:18:46 +0000 (15:18 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 25 Apr 2018 07:12:45 +0000 (09:12 +0200)
Those profiles have been added in the version 2012-01
and 2011-06 of the AVC spec.

https://bugzilla.gnome.org/show_bug.cgi?id=794127

gst-libs/gst/codecparsers/gsth264parser.h
gst/videoparsers/gsth264parse.c

index ffd609f..1914470 100644 (file)
@@ -78,9 +78,12 @@ G_BEGIN_DECLS
  * @GST_H264_PROFILE_BASELINE: Baseline profile (A.2.1)
  * @GST_H264_PROFILE_MAIN: Main profile (A.2.2)
  * @GST_H264_PROFILE_EXTENDED: Extended profile (A.2.3)
- * @GST_H264_PROFILE_HIGH: High profile (A.2.4)
+ * @GST_H264_PROFILE_HIGH: High profile (A.2.4),
+ * or Progressive High profile (A.2.4.1), or Constrained High profile (A.2.4.2)
+ * depending on constraint_set4_flag and constraint_set5_flag
  * @GST_H264_PROFILE_HIGH10: High 10 profile (A.2.5) or High 10 Intra
- *   profile (A.2.8), depending on constraint_set3_flag
+ *   profile (A.2.8), or Progressive High 10 profile (A.2.5.1) depending on
+ *   constraint_set3_flag and constraint_set4_flag
  * @GST_H264_PROFILE_HIGH_422: High 4:2:2 profile (A.2.6) or High
  *   4:2:2 Intra profile (A.2.9), depending on constraint_set3_flag
  * @GST_H264_PROFILE_HIGH_444: High 4:4:4 Predictive profile (A.2.7)
index 7751ea2..903d204 100644 (file)
@@ -1629,11 +1629,19 @@ get_profile_string (GstH264SPS * sps)
       profile = "extended";
       break;
     case 100:
-      profile = "high";
+      if (sps->constraint_set4_flag) {
+        if (sps->constraint_set5_flag)
+          profile = "constrained-high";
+        else
+          profile = "progressive-high";
+      } else
+        profile = "high";
       break;
     case 110:
       if (sps->constraint_set3_flag)
         profile = "high-10-intra";
+      else if (sps->constraint_set4_flag)
+        profile = "progressive-high-10";
       else
         profile = "high-10";
       break;