libs: encoder: h264,h265: guard rate control's macroblock
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Mon, 27 Nov 2017 11:18:56 +0000 (12:18 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Mon, 27 Nov 2017 11:18:56 +0000 (12:18 +0100)
macroblock parameter appear on VA-API 1.0.0. It should be guarded.

gst-libs/gst/vaapi/gstvaapiencoder_h264.c
gst-libs/gst/vaapi/gstvaapiencoder_h265.c

index a8eef8e..0c4b871 100644 (file)
@@ -2497,8 +2497,11 @@ ensure_control_rate_params (GstVaapiEncoderH264 * encoder)
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).window_size = encoder->cpb_length;
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
+
+#if VA_CHECK_VERSION(1,0,0)
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
       (guint) encoder->mbbrc;
+#endif
 
   /* HRD params */
   fill_hrd_params (encoder, &GST_VAAPI_ENCODER_VA_HRD (encoder));
index 5e4c840..557901f 100644 (file)
@@ -1833,8 +1833,11 @@ ensure_control_rate_params (GstVaapiEncoderH265 * encoder)
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).window_size = encoder->cpb_length;
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
+
+#if VA_CHECK_VERSION(1,0,0)
   GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
       (guint) encoder->mbbrc;
+#endif
 
   /* HRD params */
   fill_hrd_params (encoder, &GST_VAAPI_ENCODER_VA_HRD (encoder));