libs: context: roi_rc_qp_delta_support should not be checked when CQP.
authorWangfei <fei.w.wang@intel.com>
Sat, 13 Oct 2018 07:00:32 +0000 (15:00 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 16 Oct 2018 11:23:41 +0000 (13:23 +0200)
VA_ROI_RC_QP_DELTA_SUPPORT return value will be ignored when the
rate control mode is set as CQP. In CQP mode, it shouldn't check
roi_rc_qp_delta_support return value from driver backend.

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

gst-libs/gst/vaapi/gstvaapicontext.c

index 35d2212..de9a7e8 100644 (file)
@@ -320,10 +320,14 @@ config_create (GstVaapiContext * context)
         if (!context_get_attribute (context, attrib->type, &value))
           goto cleanup;
         roi_config = (VAConfigAttribValEncROI *) & value;
-        if (roi_config->bits.num_roi_regions != config->roi_num_supported ||
-            VA_ROI_RC_QP_DELTA_SUPPORT (roi_config) == 0) {
-          GST_ERROR ("Mismatched ROI support: number of regions supported: %d"
-              " ROI delta QP: %d", roi_config->bits.num_roi_regions,
+        if (roi_config->bits.num_roi_regions != config->roi_num_supported) {
+          GST_ERROR ("Mismatched ROI support: number of regions supported: %d",
+              roi_config->bits.num_roi_regions);
+          goto cleanup;
+        }
+        if (config->rc_mode != GST_VAAPI_RATECONTROL_CQP
+            && VA_ROI_RC_QP_DELTA_SUPPORT (roi_config) == 0) {
+          GST_ERROR ("Mismatched ROI support:  ROI delta QP: %d",
               VA_ROI_RC_QP_DELTA_SUPPORT (roi_config));
           goto cleanup;
         }