From 7cb83593c2a032e91f82a90d0a9de8cf4d0fb158 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 Apr 2020 22:56:45 +0200 Subject: img_format: add format description table for mpv-only formats Make this slightly less ad-hoc. Also correct the missing alpha flag for yap8/yap16. Despite reduced redundancy, the LOC is going up anyway... whatever. --- video/img_format.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'video/img_format.h') diff --git a/video/img_format.h b/video/img_format.h index b5f42148ad..4080e2f2fb 100644 --- a/video/img_format.h +++ b/video/img_format.h @@ -155,10 +155,6 @@ enum mp_imgfmt { IMGFMT_Y8, IMGFMT_Y16, - // Planar gray/alpha. - IMGFMT_YAP8, - IMGFMT_YAP16, - // Packed YUV formats (components are byte-accessed) IMGFMT_UYVY, // U Y0 V Y1 @@ -190,27 +186,37 @@ enum mp_imgfmt { // Accessed with bit-shifts after endian-swapping the uint16_t pixel IMGFMT_RGB565, // 5r 6g 5b (MSB to LSB) - // Accessed with bit-shifts, uint32_t units. - IMGFMT_RGB30, // 2pad 10r 10g 10b (MSG to LSB) - // AV_PIX_FMT_PAL8 IMGFMT_PAL8, // Hardware accelerated formats. Plane data points to special data // structures, instead of pixel data. IMGFMT_VDPAU, // VdpVideoSurface - IMGFMT_VDPAU_OUTPUT, // VdpOutputSurface - IMGFMT_VAAPI, // plane 0: ID3D11Texture2D // plane 1: slice index casted to pointer IMGFMT_D3D11, IMGFMT_DXVA2, // IDirect3DSurface9 (NV12/P010/P016) IMGFMT_MMAL, // MMAL_BUFFER_HEADER_T - IMGFMT_VIDEOTOOLBOX, // CVPixelBufferRef IMGFMT_MEDIACODEC, // AVMediaCodecBuffer IMGFMT_DRMPRIME, // AVDRMFrameDescriptor IMGFMT_CUDA, // CUDA Buffer + // Not an actual format; base for mpv-specific descriptor table. + // Some may still map to AV_PIX_FMT_*. + IMGFMT_CUST_BASE, + + // Planar gray/alpha. + IMGFMT_YAP8, + IMGFMT_YAP16, + + // Accessed with bit-shifts, uint32_t units. + IMGFMT_RGB30, // 2pad 10r 10g 10b (MSG to LSB) + + // Hardware accelerated formats (again). + IMGFMT_VDPAU_OUTPUT, // VdpOutputSurface + IMGFMT_VAAPI, + IMGFMT_VIDEOTOOLBOX, // CVPixelBufferRef + // Generic pass-through of AV_PIX_FMT_*. Used for formats which don't have // a corresponding IMGFMT_ value. IMGFMT_AVPIXFMT_START, -- cgit v1.2.3