|
|
@ -28,16 +28,19 @@ 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_VULKAN, |
|
|
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(__unix__)
|
|
|
|
|
|
|
|
|
#elif defined(__linux__)
|
|
|
AV_HWDEVICE_TYPE_CUDA, |
|
|
AV_HWDEVICE_TYPE_CUDA, |
|
|
|
|
|
AV_HWDEVICE_TYPE_VULKAN, |
|
|
AV_HWDEVICE_TYPE_VAAPI, |
|
|
AV_HWDEVICE_TYPE_VAAPI, |
|
|
AV_HWDEVICE_TYPE_VDPAU, |
|
|
AV_HWDEVICE_TYPE_VDPAU, |
|
|
#endif
|
|
|
|
|
|
|
|
|
#else
|
|
|
AV_HWDEVICE_TYPE_VULKAN, |
|
|
AV_HWDEVICE_TYPE_VULKAN, |
|
|
|
|
|
#endif
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
AVPixelFormat GetGpuFormat(AVCodecContext* codec_context, const AVPixelFormat* pix_fmts) { |
|
|
AVPixelFormat GetGpuFormat(AVCodecContext* codec_context, const AVPixelFormat* pix_fmts) { |
|
|
|