mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
libs: encoder: guard quality level configuration
The quality level appeared in VA-API 0.36. So let's guard its usage.
This commit is contained in:
parent
4f343f82e3
commit
4269adf791
1 changed files with 4 additions and 1 deletions
|
@ -188,6 +188,7 @@ gboolean
|
||||||
gst_vaapi_encoder_ensure_param_quality_level (GstVaapiEncoder * encoder,
|
gst_vaapi_encoder_ensure_param_quality_level (GstVaapiEncoder * encoder,
|
||||||
GstVaapiEncPicture * picture)
|
GstVaapiEncPicture * picture)
|
||||||
{
|
{
|
||||||
|
#if VA_CHECK_VERSION(0,36,0)
|
||||||
GstVaapiEncMiscParam *misc;
|
GstVaapiEncMiscParam *misc;
|
||||||
VAEncMiscParameterBufferQualityLevel *quality_level;
|
VAEncMiscParameterBufferQualityLevel *quality_level;
|
||||||
|
|
||||||
|
@ -203,7 +204,7 @@ gst_vaapi_encoder_ensure_param_quality_level (GstVaapiEncoder * encoder,
|
||||||
quality_level->quality_level = encoder->quality_level;
|
quality_level->quality_level = encoder->quality_level;
|
||||||
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
||||||
gst_vaapi_codec_object_replace (&misc, NULL);
|
gst_vaapi_codec_object_replace (&misc, NULL);
|
||||||
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -734,6 +735,7 @@ gst_vaapi_encoder_reconfigure_internal (GstVaapiEncoder * encoder)
|
||||||
if (!gst_vaapi_encoder_ensure_context (encoder))
|
if (!gst_vaapi_encoder_ensure_context (encoder))
|
||||||
goto error_reset_context;
|
goto error_reset_context;
|
||||||
|
|
||||||
|
#if VA_CHECK_VERSION(0,36,0)
|
||||||
if (get_config_attribute (encoder, VAConfigAttribEncQualityRange,
|
if (get_config_attribute (encoder, VAConfigAttribEncQualityRange,
|
||||||
&quality_level_max) && quality_level_max > 0) {
|
&quality_level_max) && quality_level_max > 0) {
|
||||||
encoder->quality_level =
|
encoder->quality_level =
|
||||||
|
@ -743,6 +745,7 @@ gst_vaapi_encoder_reconfigure_internal (GstVaapiEncoder * encoder)
|
||||||
encoder->quality_level = 0;
|
encoder->quality_level = 0;
|
||||||
}
|
}
|
||||||
GST_INFO ("Quality level is fixed to %d", encoder->quality_level);
|
GST_INFO ("Quality level is fixed to %d", encoder->quality_level);
|
||||||
|
#endif
|
||||||
|
|
||||||
codedbuf_size = encoder->codedbuf_pool ?
|
codedbuf_size = encoder->codedbuf_pool ?
|
||||||
gst_vaapi_coded_buffer_pool_get_buffer_size (GST_VAAPI_CODED_BUFFER_POOL
|
gst_vaapi_coded_buffer_pool_get_buffer_size (GST_VAAPI_CODED_BUFFER_POOL
|
||||||
|
|
Loading…
Reference in a new issue