Bug 1765530 Enable AV1 decode via FFmpeg 5.0 r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D144165
This commit is contained in:
stransky 2022-04-24 18:53:44 +00:00
Родитель 13d69189a8
Коммит a967f5124e
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -13,9 +13,6 @@
#include "VideoUtils.h" #include "VideoUtils.h"
#include "VPXDecoder.h" #include "VPXDecoder.h"
#include "mozilla/layers/KnowsCompositor.h" #include "mozilla/layers/KnowsCompositor.h"
#if defined(MOZ_AV1) && defined(FFVPX_VERSION) && defined(MOZ_WAYLAND)
# include "AOMDecoder.h"
#endif
#if LIBAVCODEC_VERSION_MAJOR >= 57 #if LIBAVCODEC_VERSION_MAJOR >= 57
# include "mozilla/layers/TextureClient.h" # include "mozilla/layers/TextureClient.h"
#endif #endif
@ -27,6 +24,12 @@
# include "va/va.h" # include "va/va.h"
#endif #endif
#if defined(MOZ_AV1) && defined(MOZ_WAYLAND) && \
(defined(FFVPX_VERSION) || LIBAVCODEC_VERSION_MAJOR >= 59)
# define FFMPEG_AV1_DECODE 1
# include "AOMDecoder.h"
#endif
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
#if LIBAVCODEC_VERSION_MAJOR < 54 #if LIBAVCODEC_VERSION_MAJOR < 54
# define AVPixelFormat PixelFormat # define AVPixelFormat PixelFormat
@ -989,7 +992,7 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER>::CreateImage(
#if LIBAVCODEC_VERSION_MAJOR >= 57 #if LIBAVCODEC_VERSION_MAJOR >= 57
|| mCodecContext->pix_fmt == AV_PIX_FMT_YUV444P12LE || mCodecContext->pix_fmt == AV_PIX_FMT_YUV444P12LE
#endif #endif
#if defined(MOZ_AV1) && defined(FFVPX_VERSION) && defined(MOZ_WAYLAND) #if defined(FFMPEG_AV1_DECODE)
|| mCodecContext->pix_fmt == AV_PIX_FMT_GBRP || mCodecContext->pix_fmt == AV_PIX_FMT_GBRP
#endif #endif
) { ) {
@ -1151,7 +1154,7 @@ AVCodecID FFmpegVideoDecoder<LIBAV_VER>::GetCodecId(
} }
#endif #endif
#if defined(MOZ_AV1) && defined(FFVPX_VERSION) && defined(MOZ_WAYLAND) #if defined(FFMPEG_AV1_DECODE)
if (AOMDecoder::IsAV1(aMimeType)) { if (AOMDecoder::IsAV1(aMimeType)) {
return AV_CODEC_ID_AV1; return AV_CODEC_ID_AV1;
} }