From bfc7f667081c62598a885d7419d500fcf4f38ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 27 Nov 2017 12:18:56 +0100 Subject: [PATCH] libs: encoder: h264,h265: guard rate control's macroblock macroblock parameter appear on VA-API 1.0.0. It should be guarded. --- gst-libs/gst/vaapi/gstvaapiencoder_h264.c | 3 +++ gst-libs/gst/vaapi/gstvaapiencoder_h265.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index a8eef8e9d1..0c4b8712f0 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -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)); diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c index 5e4c84081b..557901fe03 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c @@ -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));