Add mmal device/pix fmt type

This commit is contained in:
Isaac Connor 2021-09-23 16:39:28 -04:00
parent b8022cdda2
commit 655daf4fbe
1 changed files with 9 additions and 16 deletions

View File

@ -55,31 +55,24 @@ static enum AVPixelFormat get_hw_format(
} }
#if !LIBAVUTIL_VERSION_CHECK(56, 22, 0, 14, 0) #if !LIBAVUTIL_VERSION_CHECK(56, 22, 0, 14, 0)
static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) { static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) {
enum AVPixelFormat fmt;
switch (type) { switch (type) {
case AV_HWDEVICE_TYPE_VAAPI: case AV_HWDEVICE_TYPE_VAAPI:
fmt = AV_PIX_FMT_VAAPI; return AV_PIX_FMT_VAAPI;
break;
case AV_HWDEVICE_TYPE_DXVA2: case AV_HWDEVICE_TYPE_DXVA2:
fmt = AV_PIX_FMT_DXVA2_VLD; return AV_PIX_FMT_DXVA2_VLD;
break;
case AV_HWDEVICE_TYPE_D3D11VA: case AV_HWDEVICE_TYPE_D3D11VA:
fmt = AV_PIX_FMT_D3D11; return = AV_PIX_FMT_D3D11;
break;
case AV_HWDEVICE_TYPE_VDPAU: case AV_HWDEVICE_TYPE_VDPAU:
fmt = AV_PIX_FMT_VDPAU; return AV_PIX_FMT_VDPAU;
break;
case AV_HWDEVICE_TYPE_CUDA: case AV_HWDEVICE_TYPE_CUDA:
fmt = AV_PIX_FMT_CUDA; return AV_PIX_FMT_CUDA;
break; case AV_HWDEVICE_TYPE_MMAL:
return AV_PIX_FMT_MMAL;
case AV_HWDEVICE_TYPE_VIDEOTOOLBOX: case AV_HWDEVICE_TYPE_VIDEOTOOLBOX:
fmt = AV_PIX_FMT_VIDEOTOOLBOX; return AV_PIX_FMT_VIDEOTOOLBOX;
break;
default: default:
fmt = AV_PIX_FMT_NONE; return AV_PIX_FMT_NONE;
break;
} }
return fmt;
} }
#endif #endif
#endif #endif