[FFmpeg-devel] [PATCH] avcodec/mediacodec_wrapper: blacklist more software decoders

Matthieu Bouron matthieu.bouron at gmail.com
Tue Mar 6 23:39:03 EET 2018


On Tue, Mar 06, 2018 at 06:00:27PM +0000, Stefan _ wrote:
> Hi,
> 
> for hwdec on Android the wrapper attempts to blacklist known software decoders also provided through the mediacodec API. The list isn't complete however and ffmpeg might e.g. prefer slower "external" HEVC software decoding over its own software decoder.
> 
> This patch completes the list of known software decoders, which are:
> 
> OMX.ffmpeg.*
> 
>  see https://github.com/AOSB/android_device_lge_hammerhead/blob/master/media_codecs.xml#L89
> 
> OMX.SEC.*
> 
>  see https://chromium.googlesource.com/chromium/src/+/refs/heads/lkgr/media/base/android/media_codec_util.cc#288
> 
> OMX.qcom.video.decoder.hevcswvdec
> 
>  see https://github.com/moonlight-stream/moonlight-android/blob/master/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java#L83

> From fbc876a8763db254d4e26d00c8b4fcf9ea7e7183 Mon Sep 17 00:00:00 2001
> From: sfan5 <sfan5 at live.de>
> Date: Tue, 6 Mar 2018 18:47:35 +0100
> Subject: [PATCH] avcodec/mediacodec_wrapper: blacklist more software decoders
> 
> Additionally blacklist ffmpeg, Samsung and Qualcomm
> software implementations offered through MediaCodec.
> ---
>  libavcodec/mediacodec_wrapper.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
> index dbc37bf463..b12528500d 100644
> --- a/libavcodec/mediacodec_wrapper.c
> +++ b/libavcodec/mediacodec_wrapper.c
> @@ -465,7 +465,12 @@ char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int e
>                      goto done;
>                  }
>  
> -                if (strstr(name, "OMX.google")) {
> +                /* Skip software decoders */
> +                if (
> +                    strstr(name, "OMX.google") ||
> +                    strstr(name, "OMX.ffmpeg") ||
> +                    strstr(name, "OMX.SEC") ||
> +                    !strcmp(name, "OMX.qcom.video.decoder.hevcswvdec")) {
>                      av_freep(&name);
>                      goto done_with_type;
>                  }
> -- 
> 2.16.2
> 

LGTM.

-- 
Matthieu B.


More information about the ffmpeg-devel mailing list