[vlc-commits] mediacodec: disable HW acceleration for profiles Hi10P and higher
Felix Abecassis
git at videolan.org
Sun Feb 9 20:22:27 CET 2014
vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Sun Feb 9 18:22:29 2014 +0100| [d05bec79626d2ff10ea578ba1de9597c98f603f8] | committer: Jean-Baptiste Kempf
mediacodec: disable HW acceleration for profiles Hi10P and higher
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d05bec79626d2ff10ea578ba1de9597c98f603f8
---
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 5fc5013..bf53e76 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;
+ }
+ }
+
/* Allocate the memory needed to store the decoder's structure */
if ((p_dec->p_sys = p_sys = calloc(1, sizeof(*p_sys))) == NULL)
return VLC_ENOMEM;
More information about the vlc-commits
mailing list