[vlc-devel] [PATCH 4/4] mediacodec: disable HW acceleration for profiles Hi10P and higher

Martin Storsjö martin at martin.st
Sun Feb 9 22:04:06 CET 2014


On Sun, 9 Feb 2014, Felix Abecassis wrote:

> ---
> modules/codec/omxil/android_mediacodec.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
> index 4857f49..8c4953f 100644
> --- a/modules/codec/omxil/android_mediacodec.c
> +++ b/modules/codec/omxil/android_mediacodec.c
> @@ -223,6 +223,16 @@ static int OpenDecoder(vlc_object_t *p_this)
>         msg_Dbg(p_dec, "codec %d not supported", p_dec->fmt_in.i_codec);
>         return VLC_EGENERIC;
>     }
> +
> +    if (p_dec->fmt_in.i_codec == VLC_CODEC_H264) {
> +	size_t i_profile = 0xFFFF;
> +	h264_get_profile_level(&p_dec->fmt_in, &i_profile, NULL, NULL);
> +	if (i_profile >= 110) {
> +	    msg_Err(p_dec, "H.264 profile is too high or unknown. Disabling Hardware Acceleration.");
> +	    return VLC_EGENERIC;
> +	}
> +    }

Hmm, I'm not sure if it's good to error out for the unknown cases. Do we 
have the extradata available here e.g. if playing back a TS stream? If 
not, we would always abort even though things would actually play back 
just fine.

// Martin



More information about the vlc-devel mailing list