nvdec: Accept progressive-high and contrained-high profiles
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 22 Sep 2020 19:42:37 +0000 (15:42 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Wed, 18 Nov 2020 20:46:52 +0000 (15:46 -0500)
They're subsets of the high profiles with no interlacing and
no B-frames for constrained

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634>

docs/plugins/gst_plugins_cache.json
sys/nvcodec/gstnvdecoder.c
sys/nvcodec/gstnvh264dec.c

index 24790d1..3eb0e08 100644 (file)
                 "long-name": "NVDEC h264 Video Decoder",
                 "pad-templates": {
                     "sink": {
-                        "caps": "video/x-h264:\n  stream-format: byte-stream\n      alignment: au\n        profile: { (string)constrained-baseline, (string)baseline, (string)main, (string)high }\n          width: [ 48, 4096 ]\n         height: [ 16, 4096 ]\n",
+                        "caps": "video/x-h264:\n  stream-format: byte-stream\n      alignment: au\n        profile: { (string)constrained-baseline, (string)baseline, (string)main, (string)high, (string)constrained-high, (string)progressive-high }\n          width: [ 48, 4096 ]\n         height: [ 16, 4096 ]\n",
                         "direction": "sink",
                         "presence": "always"
                     },
                 "long-name": "NVDEC H.264 Stateless Decoder",
                 "pad-templates": {
                     "sink": {
-                        "caps": "video/x-h264:\n  stream-format: { (string)avc, (string)avc3, (string)byte-stream }\n      alignment: au\n        profile: { (string)high, (string)main, (string)constrained-baseline, (string)baseline }\n      framerate: [ 0/1, 2147483647/1 ]\n          width: [ 48, 4096 ]\n         height: [ 16, 4096 ]\n",
+                        "caps": "video/x-h264:\n  stream-format: { (string)avc, (string)avc3, (string)byte-stream }\n      alignment: au\n        profile: { (string)high, (string)main, (string)constrained-high, (string)constrained-baseline, (string)baseline }\n      framerate: [ 0/1, 2147483647/1 ]\n          width: [ 48, 4096 ]\n         height: [ 16, 4096 ]\n",
                         "direction": "sink",
                         "presence": "always"
                     },
index e8ad2b0..38bf7a7 100644 (file)
@@ -842,6 +842,12 @@ gst_nv_decoder_get_supported_codec_profiles (GValue * profiles,
 
         g_value_set_static_string (&val, "high");
         gst_value_list_append_value (profiles, &val);
+
+        g_value_set_static_string (&val, "constrained-high");
+        gst_value_list_append_value (profiles, &val);
+
+        g_value_set_static_string (&val, "progressive-high");
+        gst_value_list_append_value (profiles, &val);
       }
 
       /* NVDEC supports only 4:2:0 8bits h264 decoding.
@@ -850,6 +856,9 @@ gst_nv_decoder_get_supported_codec_profiles (GValue * profiles,
           GST_NV_DECODER_FORMAT_FLAG_420_10BITS) {
         g_value_set_static_string (&val, "high-10");
         gst_value_list_append_value (profiles, &val);
+
+        g_value_set_static_string (&val, "progressive-high-10");
+        gst_value_list_append_value (profiles, &val);
       }
 
       if ((flags & GST_NV_DECODER_FORMAT_FLAG_420_12BITS) ==
@@ -953,7 +962,7 @@ const GstNvdecoderCodecMap codec_map_list[] = {
   {cudaVideoCodec_H264, "h264",
       "video/x-h264, stream-format = (string) byte-stream"
         ", alignment = (string) au"
-        ", profile = (string) { constrained-baseline, baseline, main, high }"},
+        ", profile = (string) { constrained-baseline, baseline, main, high, constrained-high, progressive-high }"},
   {cudaVideoCodec_JPEG, "jpeg", "image/jpeg"},
 #if 0
   /* FIXME: need verification */
index 95501f8..8c33cd7 100644 (file)
@@ -845,7 +845,7 @@ gst_nv_h264_dec_register (GstPlugin * plugin, guint device_id, guint rank,
   cdata->sink_caps = gst_caps_from_string ("video/x-h264, "
       "stream-format= (string) { avc, avc3, byte-stream }, "
       "alignment= (string) au, "
-      "profile = (string) { high, main, constrained-baseline, baseline }, "
+      "profile = (string) { high, main, constrained-high, constrained-baseline, baseline }, "
       "framerate = " GST_VIDEO_FPS_RANGE);
 
   s = gst_caps_get_structure (sink_caps, 0);