vafilter: Increase the caps for HDR.
authorVictor Manuel Jaquez Leal <vjaquez@igalia.com>
Sat, 26 Nov 2022 20:02:00 +0000 (21:02 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 1 Dec 2022 15:17:49 +0000 (15:17 +0000)
As they might be other medatadata types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>

subprojects/gst-plugins-bad/sys/va/gstvafilter.c

index 7ddd693..13393b6 100644 (file)
@@ -442,7 +442,7 @@ static const struct VaFilterCapMap {
   F(SkinToneEnhancement, 1),
   F(TotalColorCorrection, VAProcTotalColorCorrectionCount),
   F(HVSNoiseReduction, 0),
-  F(HighDynamicRangeToneMapping, 1),
+  F(HighDynamicRangeToneMapping, VAProcHighDynamicRangeMetadataTypeCount),
 #if VA_CHECK_VERSION (1, 12, 0)
   F(3DLUT, 16),
 #endif
@@ -480,7 +480,8 @@ struct VaFilter
     VAProcFilterCapDeinterlacing deint[VAProcDeinterlacingCount];
     VAProcFilterCapColorBalance cb[VAProcColorBalanceCount];
     VAProcFilterCapTotalColorCorrection cc[VAProcTotalColorCorrectionCount];
-    VAProcFilterCapHighDynamicRange hdr;
+      VAProcFilterCapHighDynamicRange
+        hdr[VAProcHighDynamicRangeMetadataTypeCount];
 #if VA_CHECK_VERSION (1, 12, 0)
     VAProcFilterCap3DLUT lut[16];
 #endif
@@ -665,12 +666,16 @@ gst_va_filter_install_properties (GstVaFilter * self, GObjectClass * klass)
         break;
       }
       case VAProcFilterHighDynamicRangeToneMapping:{
-        const VAProcFilterCapHighDynamicRange *caps = &filter->caps.hdr;
-        if (caps->metadata_type == VAProcHighDynamicRangeMetadataHDR10
-            && (caps->caps_flag & VA_TONE_MAPPING_HDR_TO_SDR)) {
-          g_object_class_install_property (klass, GST_VA_FILTER_PROP_HDR,
-              g_param_spec_boolean ("hdr-tone-mapping", "HDR tone mapping",
-                  "Enable HDR to SDR tone mapping", FALSE, common_flags));
+        guint j;
+        for (j = 0; j < filter->num_caps; j++) {
+          const VAProcFilterCapHighDynamicRange *caps = &filter->caps.hdr[j];
+          if (caps->metadata_type == VAProcHighDynamicRangeMetadataHDR10
+              && (caps->caps_flag & VA_TONE_MAPPING_HDR_TO_SDR)) {
+            g_object_class_install_property (klass, GST_VA_FILTER_PROP_HDR,
+                g_param_spec_boolean ("hdr-tone-mapping", "HDR tone mapping",
+                    "Enable HDR to SDR tone mapping", FALSE, common_flags));
+            break;
+          }
         }
       }
       default: