FFmpeg
|
#include "config.h"
#include <stdint.h>
#include <string.h>
#include <VideoToolbox/VideoToolbox.h>
#include "buffer.h"
#include "buffer_internal.h"
#include "common.h"
#include "hwcontext.h"
#include "hwcontext_internal.h"
#include "hwcontext_videotoolbox.h"
#include "mem.h"
#include "pixfmt.h"
#include "pixdesc.h"
Go to the source code of this file.
Data Structures | |
struct | VTFramesContext |
Functions | |
static int | vt_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints) |
enum AVPixelFormat | av_map_videotoolbox_format_to_pixfmt (uint32_t cv_fmt) |
Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat. More... | |
static uint32_t | vt_format_from_pixfmt (enum AVPixelFormat pix_fmt, enum AVColorRange range) |
uint32_t | av_map_videotoolbox_format_from_pixfmt (enum AVPixelFormat pix_fmt) |
Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format. More... | |
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 formats via a flag. More... | |
static int | vt_pool_alloc (AVHWFramesContext *ctx) |
static void | videotoolbox_buffer_release (void *opaque, uint8_t *data) |
static AVBufferRef * | vt_pool_alloc_buffer (void *opaque, size_t size) |
static void | vt_frames_uninit (AVHWFramesContext *ctx) |
static int | vt_frames_init (AVHWFramesContext *ctx) |
static int | vt_get_buffer (AVHWFramesContext *ctx, AVFrame *frame) |
static int | vt_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats) |
static void | vt_unmap (AVHWFramesContext *ctx, HWMapDescriptor *hwmap) |
static int | vt_pixbuf_set_par (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. More... | |
static int | vt_pixbuf_set_chromaloc (void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src) |
CFStringRef | av_map_videotoolbox_color_matrix_from_av (enum AVColorSpace space) |
Convert an AVColorSpace to a VideoToolbox/CoreVideo color matrix string. More... | |
CFStringRef | av_map_videotoolbox_color_primaries_from_av (enum AVColorPrimaries pri) |
Convert an AVColorPrimaries to a VideoToolbox/CoreVideo color primaries string. More... | |
CFStringRef | av_map_videotoolbox_color_trc_from_av (enum AVColorTransferCharacteristic trc) |
Convert an AVColorTransferCharacteristic to a VideoToolbox/CoreVideo color transfer function string. More... | |
static CFDictionaryRef | vt_cv_buffer_copy_attachments (CVBufferRef buffer, CVAttachmentMode attachment_mode) |
Copy all attachments for the specified mode from the given buffer. More... | |
static int | vt_pixbuf_set_colorspace (void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src) |
static int | vt_pixbuf_set_attachments (void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src) |
int | av_vt_pixbuf_set_attachments (void *log_ctx, CVPixelBufferRef pixbuf, const AVFrame *src) |
static int | vt_map_frame (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags) |
static int | vt_transfer_data_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src) |
static int | vt_transfer_data_to (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src) |
static int | vt_map_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags) |
static int | vt_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) |
Variables | |
struct { | |
uint32_t cv_fmt | |
bool full_range | |
enum AVPixelFormat pix_fmt | |
} | cv_pix_fmts [] |
static enum AVPixelFormat | supported_formats [] |
const HWContextType | ff_hwcontext_type_videotoolbox |
|
static |
Definition at line 119 of file hwcontext_videotoolbox.c.
enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt | ( | uint32_t | cv_fmt | ) |
Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat.
Returns AV_PIX_FMT_NONE if no known equivalent was found.
Definition at line 144 of file hwcontext_videotoolbox.c.
Referenced by vt_map_frame().
|
static |
Definition at line 154 of file hwcontext_videotoolbox.c.
Referenced by av_map_videotoolbox_format_from_pixfmt2(), and vt_pool_alloc().
uint32_t av_map_videotoolbox_format_from_pixfmt | ( | enum AVPixelFormat | pix_fmt | ) |
Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format.
Returns 0 if no known equivalent was found.
Definition at line 173 of file hwcontext_videotoolbox.c.
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 formats via a flag.
Definition at line 178 of file hwcontext_videotoolbox.c.
Referenced by av_map_videotoolbox_format_from_pixfmt(), and get_cv_pixel_format().
|
static |
Definition at line 183 of file hwcontext_videotoolbox.c.
Referenced by vt_frames_init().
|
static |
Definition at line 235 of file hwcontext_videotoolbox.c.
Referenced by vt_pool_alloc_buffer().
|
static |
Definition at line 240 of file hwcontext_videotoolbox.c.
Referenced by vt_frames_init().
|
static |
Definition at line 267 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 276 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 304 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 318 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 333 of file hwcontext_videotoolbox.c.
Referenced by vt_map_frame().
|
static |
Definition at line 340 of file hwcontext_videotoolbox.c.
Referenced by vt_pixbuf_set_attachments().
CFStringRef av_map_videotoolbox_chroma_loc_from_av | ( | enum AVChromaLocation | loc | ) |
Convert an AVChromaLocation to a VideoToolbox/CoreVideo chroma location string.
Returns 0 if no known equivalent was found.
Definition at line 399 of file hwcontext_videotoolbox.c.
Referenced by vt_pixbuf_set_chromaloc().
|
static |
Definition at line 419 of file hwcontext_videotoolbox.c.
Referenced by vt_pixbuf_set_attachments().
CFStringRef av_map_videotoolbox_color_matrix_from_av | ( | enum AVColorSpace | space | ) |
Convert an AVColorSpace to a VideoToolbox/CoreVideo color matrix string.
Returns 0 if no known equivalent was found.
Definition at line 438 of file hwcontext_videotoolbox.c.
Referenced by scale_vt_init(), vt_pixbuf_set_colorspace(), and vtenc_configure_encoder().
CFStringRef av_map_videotoolbox_color_primaries_from_av | ( | enum AVColorPrimaries | pri | ) |
Convert an AVColorPrimaries to a VideoToolbox/CoreVideo color primaries string.
Returns 0 if no known equivalent was found.
Definition at line 465 of file hwcontext_videotoolbox.c.
Referenced by scale_vt_init(), vt_pixbuf_set_colorspace(), and vtenc_configure_encoder().
CFStringRef av_map_videotoolbox_color_trc_from_av | ( | enum AVColorTransferCharacteristic | trc | ) |
Convert an AVColorTransferCharacteristic to a VideoToolbox/CoreVideo color transfer function string.
Returns 0 if no known equivalent was found.
Definition at line 490 of file hwcontext_videotoolbox.c.
Referenced by scale_vt_init(), vt_pixbuf_set_colorspace(), and vtenc_configure_encoder().
|
static |
Copy all attachments for the specified mode from the given buffer.
Definition at line 540 of file hwcontext_videotoolbox.c.
Referenced by vt_pixbuf_set_colorspace().
|
static |
Definition at line 568 of file hwcontext_videotoolbox.c.
Referenced by vt_pixbuf_set_attachments().
|
static |
Definition at line 651 of file hwcontext_videotoolbox.c.
Referenced by av_vt_pixbuf_set_attachments(), and vt_transfer_data_to().
int av_vt_pixbuf_set_attachments | ( | void * | log_ctx, |
CVPixelBufferRef | pixbuf, | ||
const AVFrame * | src | ||
) |
Definition at line 667 of file hwcontext_videotoolbox.c.
Referenced by videotoolbox_postproc_frame().
|
static |
Definition at line 673 of file hwcontext_videotoolbox.c.
Referenced by vt_map_from(), vt_transfer_data_from(), and vt_transfer_data_to().
|
static |
Definition at line 729 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 760 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 795 of file hwcontext_videotoolbox.c.
|
static |
Definition at line 819 of file hwcontext_videotoolbox.c.
uint32_t cv_fmt |
Definition at line 45 of file hwcontext_videotoolbox.c.
Referenced by av_map_videotoolbox_format_to_pixfmt().
bool full_range |
Definition at line 46 of file hwcontext_videotoolbox.c.
Referenced by av_map_videotoolbox_format_from_pixfmt2(), dvbsub_parse_clut_segment(), mov_write_colr_tag(), and vt_format_from_pixfmt().
enum AVPixelFormat pix_fmt |
Definition at line 47 of file hwcontext_videotoolbox.c.
Referenced by av_map_videotoolbox_format_from_pixfmt(), av_map_videotoolbox_format_from_pixfmt2(), and vt_format_from_pixfmt().
const { ... } cv_pix_fmts[] |
Referenced by av_map_videotoolbox_format_to_pixfmt(), and vt_format_from_pixfmt().
|
static |
Definition at line 87 of file hwcontext_videotoolbox.c.
Referenced by vt_frames_get_constraints(), and vt_frames_init().
const HWContextType ff_hwcontext_type_videotoolbox |
Definition at line 830 of file hwcontext_videotoolbox.c.