From 4269adf791526a68a6e885750b8e6a4c5e3fefb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 11 May 2017 12:23:28 +0200 Subject: [PATCH] libs: encoder: guard quality level configuration The quality level appeared in VA-API 0.36. So let's guard its usage. --- gst-libs/gst/vaapi/gstvaapiencoder.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c index 6727cbb959..90978d19bf 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder.c @@ -188,6 +188,7 @@ gboolean gst_vaapi_encoder_ensure_param_quality_level (GstVaapiEncoder * encoder, GstVaapiEncPicture * picture) { +#if VA_CHECK_VERSION(0,36,0) GstVaapiEncMiscParam *misc; VAEncMiscParameterBufferQualityLevel *quality_level; @@ -203,7 +204,7 @@ gst_vaapi_encoder_ensure_param_quality_level (GstVaapiEncoder * encoder, quality_level->quality_level = encoder->quality_level; gst_vaapi_enc_picture_add_misc_param (picture, misc); gst_vaapi_codec_object_replace (&misc, NULL); - +#endif return TRUE; } @@ -734,6 +735,7 @@ gst_vaapi_encoder_reconfigure_internal (GstVaapiEncoder * encoder) if (!gst_vaapi_encoder_ensure_context (encoder)) goto error_reset_context; +#if VA_CHECK_VERSION(0,36,0) if (get_config_attribute (encoder, VAConfigAttribEncQualityRange, &quality_level_max) && quality_level_max > 0) { encoder->quality_level = @@ -743,6 +745,7 @@ gst_vaapi_encoder_reconfigure_internal (GstVaapiEncoder * encoder) encoder->quality_level = 0; } GST_INFO ("Quality level is fixed to %d", encoder->quality_level); +#endif codedbuf_size = encoder->codedbuf_pool ? gst_vaapi_coded_buffer_pool_get_buffer_size (GST_VAAPI_CODED_BUFFER_POOL