encoder: h264: fix profile limits.

Fix ensure_profile_limits() to lower profile to the desired limits,
only if the latter are actually known and the profile needed to be
changed to fit.
This commit is contained in:
Gwenole Beauchesne 2014-11-25 11:41:49 +01:00
parent 4be370f9ed
commit 669e33418e

View file

@ -1005,6 +1005,8 @@ ensure_profile_limits (GstVaapiEncoderH264 * encoder)
GST_WARNING ("lowering coding tools to meet target decoder constraints"); GST_WARNING ("lowering coding tools to meet target decoder constraints");
profile = GST_VAAPI_PROFILE_UNKNOWN;
/* Try Main profile coding tools */ /* Try Main profile coding tools */
if (encoder->max_profile_idc < 100) { if (encoder->max_profile_idc < 100) {
encoder->use_dct8x8 = FALSE; encoder->use_dct8x8 = FALSE;
@ -1018,8 +1020,10 @@ ensure_profile_limits (GstVaapiEncoderH264 * encoder)
profile = GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE; profile = GST_VAAPI_PROFILE_H264_CONSTRAINED_BASELINE;
} }
if (profile) {
encoder->profile = profile; encoder->profile = profile;
encoder->profile_idc = encoder->max_profile_idc; encoder->profile_idc = encoder->max_profile_idc;
}
return TRUE; return TRUE;
} }