24#include <VideoToolbox/VideoToolbox.h>
54#ifdef kCFCoreFoundationVersionNumber10_7
55 { kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange,
false,
AV_PIX_FMT_NV12 },
56 { kCVPixelFormatType_420YpCbCr8BiPlanarFullRange,
true,
AV_PIX_FMT_NV12 },
60#if HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE
64#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE
65 { kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange,
false,
AV_PIX_FMT_NV16 },
66 { kCVPixelFormatType_422YpCbCr8BiPlanarFullRange,
true,
AV_PIX_FMT_NV16 },
68#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE
69 { kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange,
false,
AV_PIX_FMT_P210 },
70 { kCVPixelFormatType_422YpCbCr10BiPlanarFullRange,
true,
AV_PIX_FMT_P210 },
72#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE
73 { kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange,
false,
AV_PIX_FMT_P216 },
75#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE
76 { kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange,
false,
AV_PIX_FMT_NV24 },
77 { kCVPixelFormatType_444YpCbCr8BiPlanarFullRange,
true,
AV_PIX_FMT_NV24 },
79#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE
80 { kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange,
false,
AV_PIX_FMT_P410 },
81 { kCVPixelFormatType_444YpCbCr10BiPlanarFullRange,
true,
AV_PIX_FMT_P410 },
83#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
84 { kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange,
false,
AV_PIX_FMT_P416 },
86#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8_YUVS
93#ifdef kCFCoreFoundationVersionNumber10_7
100#if HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE
103#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE
106#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE
109#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE
112#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE
115#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE
118#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
121#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8_YUVS
129 const void *hwconfig,
199 CFMutableDictionaryRef attributes, iosurface_properties;
201 attributes = CFDictionaryCreateMutable(
204 &kCFTypeDictionaryKeyCallBacks,
205 &kCFTypeDictionaryValueCallBacks);
208 pixfmt = CFNumberCreate(
NULL, kCFNumberSInt32Type, &cv_pixfmt);
209 CFDictionarySetValue(
211 kCVPixelBufferPixelFormatTypeKey,
215 iosurface_properties = CFDictionaryCreateMutable(
218 &kCFTypeDictionaryKeyCallBacks,
219 &kCFTypeDictionaryValueCallBacks);
220 CFDictionarySetValue(attributes, kCVPixelBufferIOSurfacePropertiesKey, iosurface_properties);
221 CFRelease(iosurface_properties);
223 w = CFNumberCreate(
NULL, kCFNumberSInt32Type, &
ctx->width);
224 h = CFNumberCreate(
NULL, kCFNumberSInt32Type, &
ctx->height);
225 CFDictionarySetValue(attributes, kCVPixelBufferWidthKey,
w);
226 CFDictionarySetValue(attributes, kCVPixelBufferHeightKey,
h);
230 err = CVPixelBufferPoolCreate(
235 CFRelease(attributes);
237 if (err == kCVReturnSuccess)
246 CVPixelBufferRelease((CVPixelBufferRef)
data);
251 CVPixelBufferRef pixbuf;
257 err = CVPixelBufferPoolCreatePixelBuffer(
262 if (err != kCVReturnSuccess) {
270 CVPixelBufferRelease(pixbuf);
280 CVPixelBufferPoolRelease(fctx->
pool);
335 fmts[0] =
ctx->sw_format;
344 CVPixelBufferRef pixbuf = (CVPixelBufferRef)hwmap->
source->
data[3];
346 CVPixelBufferUnlockBaseAddress(pixbuf, (uintptr_t)hwmap->
priv);
352 CFMutableDictionaryRef par =
NULL;
356 if (avpar.
num == 0) {
357 CVBufferRemoveAttachment(pixbuf, kCVImageBufferPixelAspectRatioKey);
365 num = CFNumberCreate(kCFAllocatorDefault,
369 den = CFNumberCreate(kCFAllocatorDefault,
373 par = CFDictionaryCreateMutable(kCFAllocatorDefault,
375 &kCFCopyStringDictionaryKeyCallBacks,
376 &kCFTypeDictionaryValueCallBacks);
378 if (!par || !num || !den) {
379 if (par) CFRelease(par);
380 if (num) CFRelease(num);
381 if (den) CFRelease(den);
385 CFDictionarySetValue(
387 kCVImageBufferPixelAspectRatioHorizontalSpacingKey,
389 CFDictionarySetValue(
391 kCVImageBufferPixelAspectRatioVerticalSpacingKey,
394 CVBufferSetAttachment(
396 kCVImageBufferPixelAspectRatioKey,
398 kCVAttachmentMode_ShouldPropagate
412 return kCVImageBufferChromaLocation_Left;
414 return kCVImageBufferChromaLocation_Center;
416 return kCVImageBufferChromaLocation_Top;
418 return kCVImageBufferChromaLocation_Bottom;
420 return kCVImageBufferChromaLocation_TopLeft;
422 return kCVImageBufferChromaLocation_BottomLeft;
434 CVBufferSetAttachment(
436 kCVImageBufferChromaLocationTopFieldKey,
438 kCVAttachmentMode_ShouldPropagate);
440 CVBufferRemoveAttachment(
442 kCVImageBufferChromaLocationTopFieldKey);
452#if HAVE_KCVIMAGEBUFFERYCBCRMATRIX_ITU_R_2020
453 if (__builtin_available(macOS 10.11, iOS 9, *))
456 return CFSTR(
"ITU_R_2020");
459 return kCVImageBufferYCbCrMatrix_ITU_R_601_4;
461 return kCVImageBufferYCbCrMatrix_ITU_R_709_2;
463 return kCVImageBufferYCbCrMatrix_SMPTE_240M_1995;
465#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG
466 if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, watchOS 4, *))
467 return CVYCbCrMatrixGetStringForIntegerCodePoint(
space);
479#if HAVE_KCVIMAGEBUFFERCOLORPRIMARIES_ITU_R_2020
480 if (__builtin_available(macOS 10.11, iOS 9, *))
483 return CFSTR(
"ITU_R_2020");
485 return kCVImageBufferColorPrimaries_ITU_R_709_2;
487 return kCVImageBufferColorPrimaries_SMPTE_C;
489 return kCVImageBufferColorPrimaries_EBU_3213;
491#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG
492 if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, watchOS 4, *))
493 return CVColorPrimariesGetStringForIntegerCodePoint(pri);
506#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ
507 if (__builtin_available(macOS 10.13, iOS 11, *))
508 return kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ;
510 return CFSTR(
"SMPTE_ST_2084_PQ");
513#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2020
514 if (__builtin_available(macOS 10.11, iOS 9, *))
517 return CFSTR(
"ITU_R_2020");
519 return kCVImageBufferTransferFunction_ITU_R_709_2;
521 return kCVImageBufferTransferFunction_SMPTE_240M_1995;
523#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_428_1
524 if (__builtin_available(macOS 10.12, iOS 10, *))
525 return kCVImageBufferTransferFunction_SMPTE_ST_428_1;
527 return CFSTR(
"SMPTE_ST_428_1");
529#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG
530 if (__builtin_available(macOS 10.13, iOS 11, *))
531 return kCVImageBufferTransferFunction_ITU_R_2100_HLG;
533 return CFSTR(
"ITU_R_2100_HLG");
535 return kCVImageBufferTransferFunction_UseGamma;
537 return kCVImageBufferTransferFunction_UseGamma;
539#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG
540 if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, watchOS 4, *))
541 return CVTransferFunctionGetStringForIntegerCodePoint(trc);
553 CVAttachmentMode attachment_mode)
556 #if (TARGET_OS_OSX && defined(__MAC_12_0) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_12_0) || \
557 (TARGET_OS_IOS && defined(__IPHONE_15_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0) || \
558 (TARGET_OS_TV && defined(__TVOS_15_0) && __TV_OS_VERSION_MAX_ALLOWED >= __TVOS_15_0)
560 if (__builtin_available(macOS 12.0, iOS 15.0, tvOS 15.0, *))
561 return CVBufferCopyAttachments(
buffer, attachment_mode);
567 #if (TARGET_OS_OSX && (!defined(__MAC_12_0) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_12_0)) || \
568 (TARGET_OS_IOS && (!defined(__IPHONE_15_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0)) || \
569 (TARGET_OS_TV && (!defined(__TVOS_15_0) || __TV_OS_VERSION_MIN_REQUIRED < __TVOS_15_0))
571 CFDictionaryRef dict = CVBufferGetAttachments(
buffer, attachment_mode);
572 return (dict) ? CFDictionaryCreateCopy(
NULL, dict) :
NULL;
581 CGColorSpaceRef colorspace =
NULL;
582 CFStringRef colormatrix =
NULL, colorpri =
NULL, colortrc =
NULL;
587 CVBufferSetAttachment(pixbuf, kCVImageBufferYCbCrMatrixKey,
588 colormatrix, kCVAttachmentMode_ShouldPropagate);
590 CVBufferRemoveAttachment(pixbuf, kCVImageBufferYCbCrMatrixKey);
593 "Color space %s is not supported.\n",
599 CVBufferSetAttachment(pixbuf, kCVImageBufferColorPrimariesKey,
600 colorpri, kCVAttachmentMode_ShouldPropagate);
602 CVBufferRemoveAttachment(pixbuf, kCVImageBufferColorPrimariesKey);
605 "Color primaries %s is not supported.\n",
611 CVBufferSetAttachment(pixbuf, kCVImageBufferTransferFunctionKey,
612 colortrc, kCVAttachmentMode_ShouldPropagate);
614 CVBufferRemoveAttachment(pixbuf, kCVImageBufferTransferFunctionKey);
617 "Color transfer function %s is not supported.\n",
627 CFNumberRef gamma_level = CFNumberCreate(
NULL, kCFNumberFloat32Type, &gamma);
628 CVBufferSetAttachment(pixbuf, kCVImageBufferGammaLevelKey,
629 gamma_level, kCVAttachmentMode_ShouldPropagate);
630 CFRelease(gamma_level);
632 CVBufferRemoveAttachment(pixbuf, kCVImageBufferGammaLevelKey);
634#if (TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 100800) || \
635 (TARGET_OS_IOS && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)
636 if (__builtin_available(macOS 10.8, iOS 10, *)) {
637 CFDictionaryRef attachments =
642 CVImageBufferCreateColorSpaceFromAttachments(attachments);
643 CFRelease(attachments);
652 CVBufferSetAttachment(pixbuf, kCVImageBufferCGColorSpaceKey,
653 colorspace, kCVAttachmentMode_ShouldPropagate);
654 CFRelease(colorspace);
656 CVBufferRemoveAttachment(pixbuf, kCVImageBufferCGColorSpaceKey);
686 CVPixelBufferRef pixbuf = (CVPixelBufferRef)
src->data[3];
687 OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
689 uint32_t map_flags = 0;
701 if (CVPixelBufferGetWidth(pixbuf) !=
ctx->width ||
702 CVPixelBufferGetHeight(pixbuf) !=
ctx->height) {
708 map_flags = kCVPixelBufferLock_ReadOnly;
710 err = CVPixelBufferLockBaseAddress(pixbuf, map_flags);
711 if (err != kCVReturnSuccess) {
716 if (CVPixelBufferIsPlanar(pixbuf)) {
717 int planes = CVPixelBufferGetPlaneCount(pixbuf);
719 dst->data[
i] = CVPixelBufferGetBaseAddressOfPlane(pixbuf,
i);
720 dst->linesize[
i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf,
i);
723 dst->data[0] = CVPixelBufferGetBaseAddress(pixbuf);
724 dst->linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
728 (
void *)(uintptr_t)map_flags);
735 CVPixelBufferUnlockBaseAddress(pixbuf, map_flags);
751 map->format =
dst->format;
758 map->height =
dst->height;
782 map->format =
src->format;
789 map->height =
src->height;
820 dst->height =
src->height;
832 if (device && device[0]) {
842 .name =
"videotoolbox",
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static const char *const format[]
refcounted data buffer API
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
common internal and external API header
static enum AVPixelFormat pix_fmt
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
AVBufferPool * av_buffer_pool_init2(size_t size, void *opaque, AVBufferRef *(*alloc)(void *opaque, size_t size), void(*pool_free)(void *opaque))
Allocate and initialize a buffer pool with a more complex allocator.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_EXTERNAL
Generic error in an external library.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define av_fourcc2str(fourcc)
int ff_hwframe_map_create(AVBufferRef *hwframe_ref, AVFrame *dst, const AVFrame *src, void(*unmap)(AVHWFramesContext *ctx, HWMapDescriptor *hwmap), void *priv)
@ AV_HWFRAME_MAP_READ
The mapping must be readable.
@ AV_HWFRAME_MAP_WRITE
The mapping must be writeable.
@ AV_HWFRAME_MAP_OVERWRITE
The mapped frame will be overwritten completely in subsequent operations, so the current frame data n...
AVHWFrameTransferDirection
@ AV_HWDEVICE_TYPE_VIDEOTOOLBOX
static FFHWFramesContext * ffhwframesctx(AVHWFramesContext *ctx)
const HWContextType ff_hwcontext_type_videotoolbox
const VDPAUPixFmtMap * map
static int vt_pixbuf_set_chromaloc(void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src)
CFStringRef av_map_videotoolbox_chroma_loc_from_av(enum AVChromaLocation loc)
Convert an AVChromaLocation to a VideoToolbox/CoreVideo chroma location string.
static void videotoolbox_buffer_release(void *opaque, uint8_t *data)
static int vt_transfer_data_to(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
int av_vt_pixbuf_set_attachments(void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src)
static void vt_unmap(AVHWFramesContext *ctx, HWMapDescriptor *hwmap)
static const struct @344211167133375235025150301172257371040060013302 cv_pix_fmts[]
static int vt_pixbuf_set_attachments(void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src)
static int vt_transfer_data_from(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
static int vt_pixbuf_set_par(void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src)
static uint32_t vt_format_from_pixfmt(enum AVPixelFormat pix_fmt, enum AVColorRange range)
enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt(uint32_t cv_fmt)
Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat.
CFStringRef av_map_videotoolbox_color_matrix_from_av(enum AVColorSpace space)
Convert an AVColorSpace to a VideoToolbox/CoreVideo color matrix string.
static int vt_map_from(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
static int vt_pixbuf_set_colorspace(void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src)
static int vt_frames_init(AVHWFramesContext *ctx)
static int vt_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries pri)
Convert an AVColorPrimaries to a VideoToolbox/CoreVideo color primaries string.
uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt)
Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format.
static AVBufferRef * vt_pool_alloc_buffer(void *opaque, size_t size)
static int vt_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
static int vt_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
static CFDictionaryRef vt_cv_buffer_copy_attachments(CVBufferRef buffer, CVAttachmentMode attachment_mode)
Copy all attachments for the specified mode from the given buffer.
static void vt_frames_uninit(AVHWFramesContext *ctx)
uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, bool full_range)
Same as av_map_videotoolbox_format_from_pixfmt function, but can map and return full range pixel form...
static int vt_pool_alloc(AVHWFramesContext *ctx)
static int vt_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags)
CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteristic trc)
Convert an AVColorTransferCharacteristic to a VideoToolbox/CoreVideo color transfer function string.
static int vt_frames_get_constraints(AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
enum AVPixelFormat pixfmt
Macro definitions for various function/variable attributes.
static enum AVPixelFormat pix_fmts[]
static const struct @257111027162314367033347246032313251342043035002 planes[]
Memory handling functions.
const char * av_color_space_name(enum AVColorSpace space)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
AVChromaLocation
Location of chroma samples.
@ AVCHROMA_LOC_TOPLEFT
ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2.
@ AVCHROMA_LOC_LEFT
MPEG-2/4 4:2:0, H.264 default for 4:2:0.
@ AVCHROMA_LOC_BOTTOMLEFT
@ AVCHROMA_LOC_CENTER
MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0.
AVColorRange
Visual content value range.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_BAYER_RGGB16
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_AYUV
packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
AVColorPrimaries
Chromaticity coordinates of the source primaries.
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
@ AVCOL_PRI_BT2020
ITU-R BT2020.
AVColorTransferCharacteristic
Color Transfer Characteristic.
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
@ AVCOL_TRC_SMPTE428
SMPTE ST 428-1.
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
@ AVCOL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
@ AVCOL_TRC_BT709
also ITU-R BT1361
#define AV_PIX_FMT_AYUV64
AVColorSpace
YUV colorspace type.
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
@ AVCOL_SPC_SMPTE240M
derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
This struct describes the constraints on hardware frames attached to a given device with a hardware-s...
enum AVPixelFormat * valid_hw_formats
A list of possible values for format in the hw_frames_ctx, terminated by AV_PIX_FMT_NONE.
enum AVPixelFormat * valid_sw_formats
A list of possible values for sw_format in the hw_frames_ctx, terminated by AV_PIX_FMT_NONE.
This struct describes a set or pool of "hardware" frames (i.e.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int width
The allocated dimensions of the frames in this pool.
Rational number (pair of numerator and denominator).
enum AVColorRange color_range
AVBufferPool * pool_internal
void * priv
Hardware-specific private data associated with the mapping.
AVFrame * source
A reference to the original source of the mapping.
AVVTFramesContext p
The public AVVTFramesContext.
CVPixelBufferPoolRef pool
#define av_malloc_array(a, b)
static AVFormatContext * ctx
static AVDictionary * opts
static enum AVPixelFormat supported_formats[]
static const Range full_range