From 652d8c083ca5153298f08fc4bdf5e7c13f548e36 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 15 Mar 2023 08:24:52 +0100 Subject: [PATCH] vpx: allow decoding of the alpha channel bitstream libavcodec is enable to do it without VPX. And when it does, it uses libvpx. So we can just use libvpx directly. --- modules/codec/vpx.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/codec/vpx.c b/modules/codec/vpx.c index acbac212e6..55ed75171d 100644 --- a/modules/codec/vpx.c +++ b/modules/codec/vpx.c @@ -309,14 +309,22 @@ static int OpenDecoder(vlc_object_t *p_this) switch (dec->fmt_in->i_codec) { #ifdef ENABLE_VP8_DECODER - case VLC_CODEC_WEBP: case VLC_CODEC_VP8: + if (dec->fmt_in->i_level) // contains alpha extradata + return VLC_ENOTSUP; + // fallthrough + case VLC_CODEC_WEBP: + case VLC_CODEC_VP8ALPHA_ES: iface = &vpx_codec_vp8_dx_algo; vp_version = 8; break; #endif #ifdef ENABLE_VP9_DECODER case VLC_CODEC_VP9: + if (dec->fmt_in->i_level) // contains alpha extradata + return VLC_ENOTSUP; + // fallthrough + case VLC_CODEC_VP9ALPHA_ES: iface = &vpx_codec_vp9_dx_algo; vp_version = 9; break; @@ -404,14 +412,19 @@ static int OpenEncoder(vlc_object_t *p_this) switch (p_enc->fmt_out.i_codec) { #ifdef ENABLE_VP8_ENCODER - case VLC_CODEC_WEBP: case VLC_CODEC_VP8: + if (p_enc->fmt_out.i_level) // contains alpha extradata + return VLC_ENOTSUP; + // fallthrough + case VLC_CODEC_WEBP: iface = &vpx_codec_vp8_cx_algo; vp_version = 8; break; #endif #ifdef ENABLE_VP9_ENCODER case VLC_CODEC_VP9: + if (p_enc->fmt_out.i_level) // contains alpha extradata + return VLC_ENOTSUP; iface = &vpx_codec_vp9_cx_algo; vp_version = 9; break;