encoder: h264: fix level when bitrate is automatically computed.

Fix level characterisation when the bitrate is automatically computed
from the active coding tools. i.e. ensure the bitrate once the profile
is completely characterized but before the level calculation process.
This commit is contained in:
Gwenole Beauchesne 2014-01-21 17:04:40 +01:00
parent 54d1900e1d
commit 586f872085

View file

@ -1511,14 +1511,16 @@ ensure_profile_and_level (GstVaapiEncoderH264 * encoder)
if (!ensure_profile (encoder) || !ensure_profile_limits (encoder))
return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
if (!ensure_level (encoder))
return GST_VAAPI_ENCODER_STATUS_ERROR_OPERATION_FAILED;
/* Check HW constraints */
if (!ensure_hw_profile_limits (encoder))
return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
if (encoder->profile_idc > encoder->hw_max_profile_idc)
return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
/* Ensure bitrate if not set already and derive the right level to use */
ensure_bitrate (encoder);
if (!ensure_level (encoder))
return GST_VAAPI_ENCODER_STATUS_ERROR_OPERATION_FAILED;
return GST_VAAPI_ENCODER_STATUS_SUCCESS;
}
@ -1874,8 +1876,6 @@ gst_vaapi_encoder_h264_reconfigure (GstVaapiEncoder * base_encoder)
if (status != GST_VAAPI_ENCODER_STATUS_SUCCESS)
return status;
ensure_bitrate (encoder);
reset_properties (encoder);
return set_context_info (base_encoder);
}