Browse Source
[ffmpeg] update to 8.0.1, enable VTBox/mediacodec/AMF/d3d12 hwaccels
MediaCodec needs some jvm shenanigans to work, but the others should
Just Work(TM). Need tests on Windows (AMD/Intel), macOS
Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3156/head
crueter
2 weeks ago
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
2 changed files with
205 additions and
195 deletions
externals/ffmpeg/cpmfile.json
src/video_core/host1x/ffmpeg/ffmpeg.cpp
@ -1,8 +1,8 @@
{
{
"ffmpeg" : {
"ffmpeg" : {
"repo" : "FFmpeg/FFmpeg" ,
"repo" : "FFmpeg/FFmpeg" ,
"sha" : "ddf443f1e9 " ,
"hash" : "ded1c313843f23805102565bd3ca92602fb9c2951e059ca5e1a486ab3ef7d589acccf3cde05c5ff0cfc5199c3a261dccb4d2a93254e585824850696fb41a292e " ,
"sha" : "5e56937b74 " ,
"hash" : "9ab0457dcd6ce6359b5053c1662f57910d332f68ca0cca9d4134d858464840917027374de3d97e0863c3a7daaea2fe4f4cd17d1c6d8e7f740f4ad91e71c2932b " ,
"bundled" : true
"bundled" : true
} ,
} ,
"ffmpeg-ci" : {
"ffmpeg-ci" : {
@ -10,7 +10,7 @@
"package" : "FFmpeg" ,
"package" : "FFmpeg" ,
"name" : "ffmpeg" ,
"name" : "ffmpeg" ,
"repo" : "crueter-ci/FFmpeg" ,
"repo" : "crueter-ci/FFmpeg" ,
"version" : "8.0-ddf443f1e9 " ,
"version" : "8.0.1-5e56937b74 " ,
"min_version" : "4.1"
"min_version" : "4.1"
}
}
}
}
@ -17,6 +17,8 @@ extern "C" {
// for querying VAAPI driver information
// for querying VAAPI driver information
# include <libavutil/hwcontext_vaapi.h>
# include <libavutil/hwcontext_vaapi.h>
# endif
# endif
# include <libavutil/hwcontext.h>
}
}
namespace FFmpeg {
namespace FFmpeg {
@ -28,16 +30,24 @@ constexpr AVPixelFormat PreferredCpuFormat = AV_PIX_FMT_YUV420P;
constexpr std : : array PreferredGpuDecoders = {
constexpr std : : array PreferredGpuDecoders = {
# if defined (_WIN32)
# if defined (_WIN32)
AV_HWDEVICE_TYPE_CUDA ,
AV_HWDEVICE_TYPE_CUDA ,
AV_HWDEVICE_TYPE_D3D12VA ,
AV_HWDEVICE_TYPE_D3D11VA ,
AV_HWDEVICE_TYPE_D3D11VA ,
AV_HWDEVICE_TYPE_DXVA2 ,
AV_HWDEVICE_TYPE_DXVA2 ,
# elif defined(__FreeBSD__)
# elif defined(__FreeBSD__)
AV_HWDEVICE_TYPE_VDPAU ,
AV_HWDEVICE_TYPE_VDPAU ,
# elif defined(__APPLE__)
AV_HWDEVICE_TYPE_VIDEOTOOLBOX ,
# elif defined(ANDROID)
AV_HWDEVICE_TYPE_MEDIACODEC ,
# elif defined(__unix__)
# elif defined(__unix__)
AV_HWDEVICE_TYPE_CUDA ,
AV_HWDEVICE_TYPE_CUDA ,
AV_HWDEVICE_TYPE_VAAPI ,
AV_HWDEVICE_TYPE_VAAPI ,
AV_HWDEVICE_TYPE_VDPAU ,
AV_HWDEVICE_TYPE_VDPAU ,
# endif
# endif
AV_HWDEVICE_TYPE_VULKAN ,
AV_HWDEVICE_TYPE_VULKAN ,
# if defined(__linux__) || defined(__MINGW64__)
AV_HWDEVICE_TYPE_AMF ,
# endif
} ;
} ;
AVPixelFormat GetGpuFormat ( AVCodecContext * codec_context , const AVPixelFormat * pix_fmts ) {
AVPixelFormat GetGpuFormat ( AVCodecContext * codec_context , const AVPixelFormat * pix_fmts ) {