FFmpeg
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
videotoolboxenc.c File Reference
#include <VideoToolbox/VideoToolbox.h>
#include <CoreVideo/CoreVideo.h>
#include <CoreMedia/CoreMedia.h>
#include <TargetConditionals.h>
#include <Availability.h>
#include "avcodec.h"
#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/pixdesc.h"
#include "libavutil/hwcontext_videotoolbox.h"
#include "internal.h"
#include <pthread.h>
#include "atsc_a53.h"
#include "encode.h"
#include "h264.h"
#include "h264_sei.h"
#include <dlfcn.h>

Go to the source code of this file.

Data Structures

struct  ExtraSEI
 
struct  BufNode
 
struct  VTEncContext
 

Macros

#define TARGET_CPU_ARM64   0
 
#define GET_SYM(symbol, defaultVal)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 
#define COMMON_OPTIONS
 
#define OFFSET(x)   offsetof(VTEncContext, x)
 

Typedefs

typedef OSStatus(* getParameterSetAtIndex) (CMFormatDescriptionRef videoDesc, size_t parameterSetIndex, const uint8_t **parameterSetPointerOut, size_t *parameterSetSizeOut, size_t *parameterSetCountOut, int *NALUnitHeaderLengthOut)
 

Enumerations

enum  { kCMVideoCodecType_HEVC = 'hvc1' }
 
enum  { kCMVideoCodecType_HEVCWithAlpha = 'muxa' }
 
enum  { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' }
 
enum  { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' }
 
enum  VT_H264Profile {
  H264_PROF_AUTO, H264_PROF_BASELINE, H264_PROF_MAIN, H264_PROF_HIGH,
  H264_PROF_EXTENDED, H264_PROF_COUNT
}
 
enum  VTH264Entropy { VT_ENTROPY_NOT_SET, VT_CAVLC, VT_CABAC }
 
enum  VT_HEVCProfile { HEVC_PROF_AUTO, HEVC_PROF_MAIN, HEVC_PROF_MAIN10, HEVC_PROF_COUNT }
 

Functions

static void loadVTEncSymbols ()
 
static int vtenc_populate_extradata (AVCodecContext *avctx, CMVideoCodecType codec_type, CFStringRef profile_level, CFNumberRef gamma_level, CFDictionaryRef enc_info, CFDictionaryRef pixel_buffer_info)
 
static void vt_release_num (CFNumberRef *refPtr)
 NULL-safe release of *refPtr, and sets value to NULL. More...
 
static void set_async_error (VTEncContext *vtctx, int err)
 
static void clear_frame_queue (VTEncContext *vtctx)
 
static int vtenc_q_pop (VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, ExtraSEI **sei)
 
static void vtenc_q_push (VTEncContext *vtctx, CMSampleBufferRef buffer, ExtraSEI *sei)
 
static int count_nalus (size_t length_code_size, CMSampleBufferRef sample_buffer, int *count)
 
static CMVideoCodecType get_cm_codec_type (AVCodecContext *avctx, int64_t profile, double alpha_quality)
 
static int get_params_size (AVCodecContext *avctx, CMVideoFormatDescriptionRef vid_fmt, size_t *size)
 Get the parameter sets from a CMSampleBufferRef. More...
 
static int copy_param_sets (AVCodecContext *avctx, CMVideoFormatDescriptionRef vid_fmt, uint8_t *dst, size_t dst_size)
 
static int set_extradata (AVCodecContext *avctx, CMSampleBufferRef sample_buffer)
 
static void vtenc_output_callback (void *ctx, void *sourceFrameCtx, OSStatus status, VTEncodeInfoFlags flags, CMSampleBufferRef sample_buffer)
 
static int get_length_code_size (AVCodecContext *avctx, CMSampleBufferRef sample_buffer, size_t *size)
 
static bool get_vt_h264_profile_level (AVCodecContext *avctx, CFStringRef *profile_level_val)
 
static bool get_vt_hevc_profile_level (AVCodecContext *avctx, CFStringRef *profile_level_val)
 
static int get_cv_pixel_format (AVCodecContext *avctx, enum AVPixelFormat fmt, enum AVColorRange range, int *av_pixel_format, int *range_guessed)
 
static void add_color_attr (AVCodecContext *avctx, CFMutableDictionaryRef dict)
 
static int create_cv_pixel_buffer_info (AVCodecContext *avctx, CFMutableDictionaryRef *dict)
 
static int get_cv_color_primaries (AVCodecContext *avctx, CFStringRef *primaries)
 
static int get_cv_transfer_function (AVCodecContext *avctx, CFStringRef *transfer_fnc, CFNumberRef *gamma_level)
 
static int get_cv_ycbcr_matrix (AVCodecContext *avctx, CFStringRef *matrix)
 
static bool vtenc_qscale_enabled (void)
 
static int vtenc_create_encoder (AVCodecContext *avctx, CMVideoCodecType codec_type, CFStringRef profile_level, CFNumberRef gamma_level, CFDictionaryRef enc_info, CFDictionaryRef pixel_buffer_info, VTCompressionSessionRef *session)
 
static int vtenc_configure_encoder (AVCodecContext *avctx)
 
static av_cold int vtenc_init (AVCodecContext *avctx)
 
static void vtenc_get_frame_info (CMSampleBufferRef buffer, bool *is_key_frame)
 
static int is_post_sei_nal_type (int nal_type)
 
static int find_sei_end (AVCodecContext *avctx, uint8_t *nal_data, size_t nal_size, uint8_t **sei_end)
 
static int copy_emulation_prev (const uint8_t *src, size_t src_size, uint8_t *dst, ssize_t dst_offset, size_t dst_size)
 Copies the data inserting emulation prevention bytes as needed. More...
 
static int write_sei (const ExtraSEI *sei, int sei_type, uint8_t *dst, size_t dst_size)
 
static int copy_replace_length_codes (AVCodecContext *avctx, size_t length_code_size, CMSampleBufferRef sample_buffer, ExtraSEI *sei, uint8_t *dst_data, size_t dst_size)
 Copies NAL units and replaces length codes with H.264 Annex B start codes. More...
 
static int get_sei_msg_bytes (const ExtraSEI *sei, int type)
 Returns a sufficient number of bytes to contain the sei data. More...
 
static int vtenc_cm_to_avpacket (AVCodecContext *avctx, CMSampleBufferRef sample_buffer, AVPacket *pkt, ExtraSEI *sei)
 
static int get_cv_pixel_info (AVCodecContext *avctx, const AVFrame *frame, int *color, int *plane_count, size_t *widths, size_t *heights, size_t *strides, size_t *contiguous_buf_size)
 
static int copy_avframe_to_pixel_buffer (AVCodecContext *avctx, const AVFrame *frame, CVPixelBufferRef cv_img, const size_t *plane_strides, const size_t *plane_rows)
 
static int create_cv_pixel_buffer (AVCodecContext *avctx, const AVFrame *frame, CVPixelBufferRef *cv_img)
 
static int create_encoder_dict_h264 (const AVFrame *frame, CFDictionaryRef *dict_out)
 
static int vtenc_send_frame (AVCodecContext *avctx, VTEncContext *vtctx, const AVFrame *frame)
 
static av_cold int vtenc_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int vtenc_close (AVCodecContext *avctx)
 

Variables

struct {
   CFStringRef   kCVImageBufferColorPrimaries_ITU_R_2020
 
   CFStringRef   kCVImageBufferTransferFunction_ITU_R_2020
 
   CFStringRef   kCVImageBufferYCbCrMatrix_ITU_R_2020
 
   CFStringRef   kVTCompressionPropertyKey_H264EntropyMode
 
   CFStringRef   kVTH264EntropyMode_CAVLC
 
   CFStringRef   kVTH264EntropyMode_CABAC
 
   CFStringRef   kVTProfileLevel_H264_Baseline_4_0
 
   CFStringRef   kVTProfileLevel_H264_Baseline_4_2
 
   CFStringRef   kVTProfileLevel_H264_Baseline_5_0
 
   CFStringRef   kVTProfileLevel_H264_Baseline_5_1
 
   CFStringRef   kVTProfileLevel_H264_Baseline_5_2
 
   CFStringRef   kVTProfileLevel_H264_Baseline_AutoLevel
 
   CFStringRef   kVTProfileLevel_H264_Main_4_2
 
   CFStringRef   kVTProfileLevel_H264_Main_5_1
 
   CFStringRef   kVTProfileLevel_H264_Main_5_2
 
   CFStringRef   kVTProfileLevel_H264_Main_AutoLevel
 
   CFStringRef   kVTProfileLevel_H264_High_3_0
 
   CFStringRef   kVTProfileLevel_H264_High_3_1
 
   CFStringRef   kVTProfileLevel_H264_High_3_2
 
   CFStringRef   kVTProfileLevel_H264_High_4_0
 
   CFStringRef   kVTProfileLevel_H264_High_4_1
 
   CFStringRef   kVTProfileLevel_H264_High_4_2
 
   CFStringRef   kVTProfileLevel_H264_High_5_1
 
   CFStringRef   kVTProfileLevel_H264_High_5_2
 
   CFStringRef   kVTProfileLevel_H264_High_AutoLevel
 
   CFStringRef   kVTProfileLevel_H264_Extended_5_0
 
   CFStringRef   kVTProfileLevel_H264_Extended_AutoLevel
 
   CFStringRef   kVTProfileLevel_HEVC_Main_AutoLevel
 
   CFStringRef   kVTProfileLevel_HEVC_Main10_AutoLevel
 
   CFStringRef   kVTCompressionPropertyKey_RealTime
 
   CFStringRef   kVTCompressionPropertyKey_TargetQualityForAlpha
 
   CFStringRef   kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder
 
   CFStringRef   kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder
 
   getParameterSetAtIndex   CMVideoFormatDescriptionGetHEVCParameterSetAtIndex
 
compat_keys
 
static pthread_once_t once_ctrl = PTHREAD_ONCE_INIT
 
static const uint8_t start_code [] = { 0, 0, 0, 1 }
 
static enum AVPixelFormat avc_pix_fmts []
 
static enum AVPixelFormat hevc_pix_fmts []
 
static enum AVPixelFormat prores_pix_fmts []
 
static const AVOption h264_options []
 
static const AVClass h264_videotoolbox_class
 
const AVCodec ff_h264_videotoolbox_encoder
 
static const AVOption hevc_options []
 
static const AVClass hevc_videotoolbox_class
 
const AVCodec ff_hevc_videotoolbox_encoder
 
static const AVOption prores_options []
 
static const AVClass prores_videotoolbox_class
 
const AVCodec ff_prores_videotoolbox_encoder
 

Macro Definition Documentation

◆ TARGET_CPU_ARM64

#define TARGET_CPU_ARM64   0

Definition at line 55 of file videotoolboxenc.c.

◆ GET_SYM

#define GET_SYM (   symbol,
  defaultVal 
)
Value:
do{ \
CFStringRef* handle = (CFStringRef*)dlsym(RTLD_DEFAULT, #symbol); \
if(!handle) \
compat_keys.symbol = CFSTR(defaultVal); \
else \
compat_keys.symbol = *handle; \
}while(0)

Definition at line 109 of file videotoolboxenc.c.

◆ VE

Definition at line 2673 of file videotoolboxenc.c.

◆ COMMON_OPTIONS

#define COMMON_OPTIONS
Value:
{ "allow_sw", "Allow software encoding", OFFSET(allow_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "require_sw", "Require software encoding", OFFSET(require_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "realtime", "Hint that encoding should happen in real-time if not faster (e.g. capturing from camera).", \
OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, -1, 1, VE }, \
{ "frames_before", "Other frames will come before the frames in this session. This helps smooth concatenation issues.", \
OFFSET(frames_before), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
{ "frames_after", "Other frames will come after the frames in this session. This helps smooth concatenation issues.", \
OFFSET(frames_after), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },

Definition at line 2674 of file videotoolboxenc.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(VTEncContext, x)

Definition at line 2686 of file videotoolboxenc.c.

Typedef Documentation

◆ getParameterSetAtIndex

typedef OSStatus(* getParameterSetAtIndex) (CMFormatDescriptionRef videoDesc, size_t parameterSetIndex, const uint8_t **parameterSetPointerOut, size_t *parameterSetSizeOut, size_t *parameterSetCountOut, int *NALUnitHeaderLengthOut)

Definition at line 58 of file videotoolboxenc.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kCMVideoCodecType_HEVC 

Definition at line 42 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kCMVideoCodecType_HEVCWithAlpha 

Definition at line 46 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kCVPixelFormatType_420YpCbCr10BiPlanarFullRange 

Definition at line 50 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange 

Definition at line 51 of file videotoolboxenc.c.

◆ VT_H264Profile

Enumerator
H264_PROF_AUTO 
H264_PROF_BASELINE 
H264_PROF_MAIN 
H264_PROF_HIGH 
H264_PROF_EXTENDED 
H264_PROF_COUNT 

Definition at line 170 of file videotoolboxenc.c.

◆ VTH264Entropy

Enumerator
VT_ENTROPY_NOT_SET 
VT_CAVLC 
VT_CABAC 

Definition at line 179 of file videotoolboxenc.c.

◆ VT_HEVCProfile

Enumerator
HEVC_PROF_AUTO 
HEVC_PROF_MAIN 
HEVC_PROF_MAIN10 
HEVC_PROF_COUNT 

Definition at line 185 of file videotoolboxenc.c.

Function Documentation

◆ loadVTEncSymbols()

static void loadVTEncSymbols ( )
static

Definition at line 120 of file videotoolboxenc.c.

Referenced by vtenc_init().

◆ vtenc_populate_extradata()

static int vtenc_populate_extradata ( AVCodecContext avctx,
CMVideoCodecType  codec_type,
CFStringRef  profile_level,
CFNumberRef  gamma_level,
CFDictionaryRef  enc_info,
CFDictionaryRef  pixel_buffer_info 
)
static

Definition at line 2501 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ vt_release_num()

static void vt_release_num ( CFNumberRef *  refPtr)
static

NULL-safe release of *refPtr, and sets value to NULL.

Definition at line 258 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer_info().

◆ set_async_error()

static void set_async_error ( VTEncContext vtctx,
int  err 
)
static

Definition at line 267 of file videotoolboxenc.c.

Referenced by clear_frame_queue(), vtenc_output_callback(), and vtenc_q_push().

◆ clear_frame_queue()

static void clear_frame_queue ( VTEncContext vtctx)
static

Definition at line 288 of file videotoolboxenc.c.

Referenced by vtenc_close().

◆ vtenc_q_pop()

static int vtenc_q_pop ( VTEncContext vtctx,
bool  wait,
CMSampleBufferRef *  buf,
ExtraSEI **  sei 
)
static

Definition at line 293 of file videotoolboxenc.c.

Referenced by vtenc_frame(), and vtenc_populate_extradata().

◆ vtenc_q_push()

static void vtenc_q_push ( VTEncContext vtctx,
CMSampleBufferRef  buffer,
ExtraSEI sei 
)
static

Definition at line 343 of file videotoolboxenc.c.

Referenced by vtenc_output_callback().

◆ count_nalus()

static int count_nalus ( size_t  length_code_size,
CMSampleBufferRef  sample_buffer,
int count 
)
static

Definition at line 370 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ get_cm_codec_type()

static CMVideoCodecType get_cm_codec_type ( AVCodecContext avctx,
int64_t  profile,
double  alpha_quality 
)
static

Definition at line 409 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_params_size()

static int get_params_size ( AVCodecContext avctx,
CMVideoFormatDescriptionRef  vid_fmt,
size_t *  size 
)
static

Get the parameter sets from a CMSampleBufferRef.

Parameters
dstIf *dst isn't NULL, the parameters are copied into existing memory. *dst_size must be set accordingly when *dst != NULL. If *dst is NULL, it will be allocated. In all cases, *dst_size is set to the number of bytes used starting at *dst.

Definition at line 458 of file videotoolboxenc.c.

Referenced by set_extradata(), and vtenc_cm_to_avpacket().

◆ copy_param_sets()

static int copy_param_sets ( AVCodecContext avctx,
CMVideoFormatDescriptionRef  vid_fmt,
uint8_t *  dst,
size_t  dst_size 
)
static

Definition at line 512 of file videotoolboxenc.c.

Referenced by set_extradata(), and vtenc_cm_to_avpacket().

◆ set_extradata()

static int set_extradata ( AVCodecContext avctx,
CMSampleBufferRef  sample_buffer 
)
static

Definition at line 576 of file videotoolboxenc.c.

Referenced by vtenc_output_callback().

◆ vtenc_output_callback()

static void vtenc_output_callback ( void *  ctx,
void *  sourceFrameCtx,
OSStatus  status,
VTEncodeInfoFlags  flags,
CMSampleBufferRef  sample_buffer 
)
static

Definition at line 625 of file videotoolboxenc.c.

Referenced by vtenc_create_encoder().

◆ get_length_code_size()

static int get_length_code_size ( AVCodecContext avctx,
CMSampleBufferRef  sample_buffer,
size_t *  size 
)
static

Definition at line 661 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ get_vt_h264_profile_level()

static bool get_vt_h264_profile_level ( AVCodecContext avctx,
CFStringRef *  profile_level_val 
)
static

Definition at line 698 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_vt_hevc_profile_level()

static bool get_vt_hevc_profile_level ( AVCodecContext avctx,
CFStringRef *  profile_level_val 
)
static

Definition at line 803 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_cv_pixel_format()

static int get_cv_pixel_format ( AVCodecContext avctx,
enum AVPixelFormat  fmt,
enum AVColorRange  range,
int av_pixel_format,
int range_guessed 
)
static

Definition at line 832 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer_info(), and get_cv_pixel_info().

◆ add_color_attr()

static void add_color_attr ( AVCodecContext avctx,
CFMutableDictionaryRef  dict 
)
static

Definition at line 847 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer_info().

◆ create_cv_pixel_buffer_info()

static int create_cv_pixel_buffer_info ( AVCodecContext avctx,
CFMutableDictionaryRef *  dict 
)
static

Definition at line 869 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_cv_color_primaries()

static int get_cv_color_primaries ( AVCodecContext avctx,
CFStringRef *  primaries 
)
static

Definition at line 936 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_cv_transfer_function()

static int get_cv_transfer_function ( AVCodecContext avctx,
CFStringRef *  transfer_fnc,
CFNumberRef *  gamma_level 
)
static

Definition at line 970 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_cv_ycbcr_matrix()

static int get_cv_ycbcr_matrix ( AVCodecContext avctx,
CFStringRef *  matrix 
)
static

Definition at line 1033 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ vtenc_qscale_enabled()

static bool vtenc_qscale_enabled ( void  )
static

Definition at line 1066 of file videotoolboxenc.c.

Referenced by vtenc_create_encoder().

◆ vtenc_create_encoder()

static int vtenc_create_encoder ( AVCodecContext avctx,
CMVideoCodecType  codec_type,
CFStringRef  profile_level,
CFNumberRef  gamma_level,
CFDictionaryRef  enc_info,
CFDictionaryRef  pixel_buffer_info,
VTCompressionSessionRef *  session 
)
static

Definition at line 1071 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder(), and vtenc_populate_extradata().

◆ vtenc_configure_encoder()

static int vtenc_configure_encoder ( AVCodecContext avctx)
static

Definition at line 1411 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer(), and vtenc_init().

◆ vtenc_init()

static av_cold int vtenc_init ( AVCodecContext avctx)
static

Definition at line 1533 of file videotoolboxenc.c.

◆ vtenc_get_frame_info()

static void vtenc_get_frame_info ( CMSampleBufferRef  buffer,
bool *  is_key_frame 
)
static

Definition at line 1567 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ is_post_sei_nal_type()

static int is_post_sei_nal_type ( int  nal_type)
static

Definition at line 1594 of file videotoolboxenc.c.

Referenced by copy_replace_length_codes().

◆ find_sei_end()

static int find_sei_end ( AVCodecContext avctx,
uint8_t *  nal_data,
size_t  nal_size,
uint8_t **  sei_end 
)
static

Definition at line 1605 of file videotoolboxenc.c.

Referenced by copy_replace_length_codes().

◆ copy_emulation_prev()

static int copy_emulation_prev ( const uint8_t *  src,
size_t  src_size,
uint8_t *  dst,
ssize_t  dst_offset,
size_t  dst_size 
)
static

Copies the data inserting emulation prevention bytes as needed.

Existing data in the destination can be taken into account by providing dst with a dst_offset > 0.

Returns
The number of bytes copied on success. On failure, the negative of the number of bytes needed to copy src is returned.

Definition at line 1669 of file videotoolboxenc.c.

Referenced by get_sei_msg_bytes(), and write_sei().

◆ write_sei()

static int write_sei ( const ExtraSEI sei,
int  sei_type,
uint8_t *  dst,
size_t  dst_size 
)
static

Definition at line 1720 of file videotoolboxenc.c.

Referenced by copy_replace_length_codes().

◆ copy_replace_length_codes()

static int copy_replace_length_codes ( AVCodecContext avctx,
size_t  length_code_size,
CMSampleBufferRef  sample_buffer,
ExtraSEI sei,
uint8_t *  dst_data,
size_t  dst_size 
)
static

Copies NAL units and replaces length codes with H.264 Annex B start codes.

On failure, the contents of dst_data may have been modified.

Parameters
length_code_sizeByte length of each length code
sample_bufferNAL units prefixed with length codes.
seiOptional A53 closed captions SEI data.
dst_dataMust be zeroed before calling this function. Contains the copied NAL units prefixed with start codes when the function returns successfully.
dst_sizeLength of dst_data
Returns
0 on success AVERROR_INVALIDDATA if length_code_size is invalid AVERROR_BUFFER_TOO_SMALL if dst_data is too small or if a length_code in src_data specifies data beyond the end of its buffer.

Definition at line 1793 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ get_sei_msg_bytes()

static int get_sei_msg_bytes ( const ExtraSEI sei,
int  type 
)
static

Returns a sufficient number of bytes to contain the sei data.

It may be greater than the minimum required.

Definition at line 1950 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ vtenc_cm_to_avpacket()

static int vtenc_cm_to_avpacket ( AVCodecContext avctx,
CMSampleBufferRef  sample_buffer,
AVPacket pkt,
ExtraSEI sei 
)
static

Definition at line 1967 of file videotoolboxenc.c.

Referenced by vtenc_frame().

◆ get_cv_pixel_info()

static int get_cv_pixel_info ( AVCodecContext avctx,
const AVFrame frame,
int color,
int plane_count,
size_t *  widths,
size_t *  heights,
size_t *  strides,
size_t *  contiguous_buf_size 
)
static

Definition at line 2097 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer().

◆ copy_avframe_to_pixel_buffer()

static int copy_avframe_to_pixel_buffer ( AVCodecContext avctx,
const AVFrame frame,
CVPixelBufferRef  cv_img,
const size_t *  plane_strides,
const size_t *  plane_rows 
)
static

Definition at line 2171 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer().

◆ create_cv_pixel_buffer()

static int create_cv_pixel_buffer ( AVCodecContext avctx,
const AVFrame frame,
CVPixelBufferRef *  cv_img 
)
static

Definition at line 2263 of file videotoolboxenc.c.

Referenced by vtenc_send_frame().

◆ create_encoder_dict_h264()

static int create_encoder_dict_h264 ( const AVFrame frame,
CFDictionaryRef *  dict_out 
)
static

Definition at line 2360 of file videotoolboxenc.c.

Referenced by vtenc_send_frame().

◆ vtenc_send_frame()

static int vtenc_send_frame ( AVCodecContext avctx,
VTEncContext vtctx,
const AVFrame frame 
)
static

Definition at line 2376 of file videotoolboxenc.c.

Referenced by vtenc_frame().

◆ vtenc_frame()

static av_cold int vtenc_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int got_packet 
)
static

Definition at line 2434 of file videotoolboxenc.c.

◆ vtenc_close()

static av_cold int vtenc_close ( AVCodecContext avctx)
static

Definition at line 2588 of file videotoolboxenc.c.

Variable Documentation

◆ kCVImageBufferColorPrimaries_ITU_R_2020

CFStringRef kCVImageBufferColorPrimaries_ITU_R_2020

◆ kCVImageBufferTransferFunction_ITU_R_2020

CFStringRef kCVImageBufferTransferFunction_ITU_R_2020

Definition at line 68 of file videotoolboxenc.c.

Referenced by av_map_videotoolbox_color_trc_from_av(), and loadVTEncSymbols().

◆ kCVImageBufferYCbCrMatrix_ITU_R_2020

CFStringRef kCVImageBufferYCbCrMatrix_ITU_R_2020

Definition at line 69 of file videotoolboxenc.c.

Referenced by av_map_videotoolbox_color_matrix_from_av(), and loadVTEncSymbols().

◆ kVTCompressionPropertyKey_H264EntropyMode

CFStringRef kVTCompressionPropertyKey_H264EntropyMode

Definition at line 71 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTH264EntropyMode_CAVLC

CFStringRef kVTH264EntropyMode_CAVLC

Definition at line 72 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTH264EntropyMode_CABAC

CFStringRef kVTH264EntropyMode_CABAC

Definition at line 73 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_4_0

CFStringRef kVTProfileLevel_H264_Baseline_4_0

Definition at line 75 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_4_2

CFStringRef kVTProfileLevel_H264_Baseline_4_2

Definition at line 76 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_5_0

CFStringRef kVTProfileLevel_H264_Baseline_5_0

Definition at line 77 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_5_1

CFStringRef kVTProfileLevel_H264_Baseline_5_1

Definition at line 78 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_5_2

CFStringRef kVTProfileLevel_H264_Baseline_5_2

Definition at line 79 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_AutoLevel

CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel

Definition at line 80 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_4_2

CFStringRef kVTProfileLevel_H264_Main_4_2

Definition at line 81 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_5_1

CFStringRef kVTProfileLevel_H264_Main_5_1

Definition at line 82 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_5_2

CFStringRef kVTProfileLevel_H264_Main_5_2

Definition at line 83 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_AutoLevel

CFStringRef kVTProfileLevel_H264_Main_AutoLevel

Definition at line 84 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_3_0

CFStringRef kVTProfileLevel_H264_High_3_0

Definition at line 85 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_3_1

CFStringRef kVTProfileLevel_H264_High_3_1

Definition at line 86 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_3_2

CFStringRef kVTProfileLevel_H264_High_3_2

Definition at line 87 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_4_0

CFStringRef kVTProfileLevel_H264_High_4_0

Definition at line 88 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_4_1

CFStringRef kVTProfileLevel_H264_High_4_1

Definition at line 89 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_4_2

CFStringRef kVTProfileLevel_H264_High_4_2

Definition at line 90 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_5_1

CFStringRef kVTProfileLevel_H264_High_5_1

Definition at line 91 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_5_2

CFStringRef kVTProfileLevel_H264_High_5_2

Definition at line 92 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_AutoLevel

CFStringRef kVTProfileLevel_H264_High_AutoLevel

Definition at line 93 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Extended_5_0

CFStringRef kVTProfileLevel_H264_Extended_5_0

Definition at line 94 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Extended_AutoLevel

CFStringRef kVTProfileLevel_H264_Extended_AutoLevel

Definition at line 95 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_HEVC_Main_AutoLevel

CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel

Definition at line 97 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_HEVC_Main10_AutoLevel

CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel

Definition at line 98 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_RealTime

CFStringRef kVTCompressionPropertyKey_RealTime

Definition at line 100 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_TargetQualityForAlpha

CFStringRef kVTCompressionPropertyKey_TargetQualityForAlpha

Definition at line 101 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder

CFStringRef kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder

Definition at line 103 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder

CFStringRef kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder

Definition at line 104 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ CMVideoFormatDescriptionGetHEVCParameterSetAtIndex

getParameterSetAtIndex CMVideoFormatDescriptionGetHEVCParameterSetAtIndex

Definition at line 106 of file videotoolboxenc.c.

◆ compat_keys

struct { ... } compat_keys

◆ once_ctrl

pthread_once_t once_ctrl = PTHREAD_ONCE_INIT
static

Definition at line 118 of file videotoolboxenc.c.

Referenced by vtenc_init().

◆ start_code

const uint8_t start_code[] = { 0, 0, 0, 1 }
static

◆ avc_pix_fmts

enum AVPixelFormat avc_pix_fmts[]
static

◆ hevc_pix_fmts

enum AVPixelFormat hevc_pix_fmts[]
static

◆ prores_pix_fmts

enum AVPixelFormat prores_pix_fmts[]
static

Definition at line 2640 of file videotoolboxenc.c.

◆ h264_options

const AVOption h264_options[]
static
Initial value:
= {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT64, { .i64 = H264_PROF_AUTO }, H264_PROF_AUTO, H264_PROF_COUNT, VE, "profile" },
{ "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
{ "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
{ "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
{ "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" },
{ "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" },
{ "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" },
{ "3.0", "Level 3.0", 0, AV_OPT_TYPE_CONST, { .i64 = 30 }, INT_MIN, INT_MAX, VE, "level" },
{ "3.1", "Level 3.1", 0, AV_OPT_TYPE_CONST, { .i64 = 31 }, INT_MIN, INT_MAX, VE, "level" },
{ "3.2", "Level 3.2", 0, AV_OPT_TYPE_CONST, { .i64 = 32 }, INT_MIN, INT_MAX, VE, "level" },
{ "4.0", "Level 4.0", 0, AV_OPT_TYPE_CONST, { .i64 = 40 }, INT_MIN, INT_MAX, VE, "level" },
{ "4.1", "Level 4.1", 0, AV_OPT_TYPE_CONST, { .i64 = 41 }, INT_MIN, INT_MAX, VE, "level" },
{ "4.2", "Level 4.2", 0, AV_OPT_TYPE_CONST, { .i64 = 42 }, INT_MIN, INT_MAX, VE, "level" },
{ "5.0", "Level 5.0", 0, AV_OPT_TYPE_CONST, { .i64 = 50 }, INT_MIN, INT_MAX, VE, "level" },
{ "5.1", "Level 5.1", 0, AV_OPT_TYPE_CONST, { .i64 = 51 }, INT_MIN, INT_MAX, VE, "level" },
{ "5.2", "Level 5.2", 0, AV_OPT_TYPE_CONST, { .i64 = 52 }, INT_MIN, INT_MAX, VE, "level" },
{ "coder", "Entropy coding", OFFSET(entropy), AV_OPT_TYPE_INT, { .i64 = VT_ENTROPY_NOT_SET }, VT_ENTROPY_NOT_SET, VT_CABAC, VE, "coder" },
{ "cavlc", "CAVLC entropy coding", 0, AV_OPT_TYPE_CONST, { .i64 = VT_CAVLC }, INT_MIN, INT_MAX, VE, "coder" },
{ "vlc", "CAVLC entropy coding", 0, AV_OPT_TYPE_CONST, { .i64 = VT_CAVLC }, INT_MIN, INT_MAX, VE, "coder" },
{ "cabac", "CABAC entropy coding", 0, AV_OPT_TYPE_CONST, { .i64 = VT_CABAC }, INT_MIN, INT_MAX, VE, "coder" },
{ "ac", "CABAC entropy coding", 0, AV_OPT_TYPE_CONST, { .i64 = VT_CABAC }, INT_MIN, INT_MAX, VE, "coder" },
{ "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, VE },
{ NULL },
}

Definition at line 2687 of file videotoolboxenc.c.

◆ h264_videotoolbox_class

const AVClass h264_videotoolbox_class
static
Initial value:
= {
.class_name = "h264_videotoolbox",
.item_name = av_default_item_name,
.option = h264_options,
}

Definition at line 2718 of file videotoolboxenc.c.

◆ ff_h264_videotoolbox_encoder

const AVCodec ff_h264_videotoolbox_encoder
Initial value:
= {
.name = "h264_videotoolbox",
.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.264 Encoder"),
.priv_data_size = sizeof(VTEncContext),
.encode2 = vtenc_frame,
.close = vtenc_close,
.priv_class = &h264_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}

Definition at line 2725 of file videotoolboxenc.c.

◆ hevc_options

const AVOption hevc_options[]
static
Initial value:
= {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT64, { .i64 = HEVC_PROF_AUTO }, HEVC_PROF_AUTO, HEVC_PROF_COUNT, VE, "profile" },
{ "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = HEVC_PROF_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
{ "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = HEVC_PROF_MAIN10 }, INT_MIN, INT_MAX, VE, "profile" },
{ "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE },
{ NULL },
}

Definition at line 2741 of file videotoolboxenc.c.

◆ hevc_videotoolbox_class

const AVClass hevc_videotoolbox_class
static
Initial value:
= {
.class_name = "hevc_videotoolbox",
.item_name = av_default_item_name,
.option = hevc_options,
}

Definition at line 2752 of file videotoolboxenc.c.

◆ ff_hevc_videotoolbox_encoder

const AVCodec ff_hevc_videotoolbox_encoder
Initial value:
= {
.name = "hevc_videotoolbox",
.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.265 Encoder"),
.priv_data_size = sizeof(VTEncContext),
.encode2 = vtenc_frame,
.close = vtenc_close,
.priv_class = &hevc_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
.wrapper_name = "videotoolbox",
}

Definition at line 2759 of file videotoolboxenc.c.

◆ prores_options

const AVOption prores_options[]
static
Initial value:
= {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT64, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" },
{ "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
{ "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" },
{ "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" },
{ "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" },
{ "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" },
{ "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" },
{ "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" },
{ NULL },
}

Definition at line 2777 of file videotoolboxenc.c.

◆ prores_videotoolbox_class

const AVClass prores_videotoolbox_class
static
Initial value:
= {
.class_name = "prores_videotoolbox",
.item_name = av_default_item_name,
.option = prores_options,
}

Definition at line 2791 of file videotoolboxenc.c.

◆ ff_prores_videotoolbox_encoder

const AVCodec ff_prores_videotoolbox_encoder
Initial value:
= {
.name = "prores_videotoolbox",
.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox ProRes Encoder"),
.priv_data_size = sizeof(VTEncContext),
.encode2 = vtenc_frame,
.close = vtenc_close,
.priv_class = &prores_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
.wrapper_name = "videotoolbox",
}

Definition at line 2798 of file videotoolboxenc.c.

H264_PROF_EXTENDED
@ H264_PROF_EXTENDED
Definition: videotoolboxenc.c:175
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
FF_PROFILE_PRORES_XQ
#define FF_PROFILE_PRORES_XQ
Definition: avcodec.h:1638
level
uint8_t level
Definition: svq3.c:204
hevc_pix_fmts
static enum AVPixelFormat hevc_pix_fmts[]
Definition: videotoolboxenc.c:2631
AV_CODEC_CAP_HARDWARE
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:162
H264_PROF_AUTO
@ H264_PROF_AUTO
Definition: videotoolboxenc.c:171
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
HEVC_PROF_MAIN10
@ HEVC_PROF_MAIN10
Definition: videotoolboxenc.c:188
init
static int init
Definition: av_tx.c:47
vtenc_close
static av_cold int vtenc_close(AVCodecContext *avctx)
Definition: videotoolboxenc.c:2588
HEVC_PROF_COUNT
@ HEVC_PROF_COUNT
Definition: videotoolboxenc.c:189
FF_PROFILE_PRORES_LT
#define FF_PROFILE_PRORES_LT
Definition: avcodec.h:1634
h264_options
static const AVOption h264_options[]
Definition: videotoolboxenc.c:2687
avc_pix_fmts
static enum AVPixelFormat avc_pix_fmts[]
Definition: videotoolboxenc.c:2624
hevc_options
static const AVOption hevc_options[]
Definition: videotoolboxenc.c:2741
prores_pix_fmts
static enum AVPixelFormat prores_pix_fmts[]
Definition: videotoolboxenc.c:2640
VT_CABAC
@ VT_CABAC
Definition: videotoolboxenc.c:182
prores_options
static const AVOption prores_options[]
Definition: videotoolboxenc.c:2777
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:226
H264_PROF_MAIN
@ H264_PROF_MAIN
Definition: videotoolboxenc.c:173
FF_PROFILE_UNKNOWN
#define FF_PROFILE_UNKNOWN
Definition: avcodec.h:1526
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:225
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
HEVC_PROF_AUTO
@ HEVC_PROF_AUTO
Definition: videotoolboxenc.c:186
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:77
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
prores_videotoolbox_class
static const AVClass prores_videotoolbox_class
Definition: videotoolboxenc.c:2791
h264_videotoolbox_class
static const AVClass h264_videotoolbox_class
Definition: videotoolboxenc.c:2718
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
H264_PROF_BASELINE
@ H264_PROF_BASELINE
Definition: videotoolboxenc.c:172
VT_ENTROPY_NOT_SET
@ VT_ENTROPY_NOT_SET
Definition: videotoolboxenc.c:180
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
FF_PROFILE_PRORES_HQ
#define FF_PROFILE_PRORES_HQ
Definition: avcodec.h:1636
FF_PROFILE_PRORES_STANDARD
#define FF_PROFILE_PRORES_STANDARD
Definition: avcodec.h:1635
H264_PROF_COUNT
@ H264_PROF_COUNT
Definition: videotoolboxenc.c:176
hevc_videotoolbox_class
static const AVClass hevc_videotoolbox_class
Definition: videotoolboxenc.c:2752
AV_PIX_FMT_VIDEOTOOLBOX
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition: pixfmt.h:272
COMMON_OPTIONS
#define COMMON_OPTIONS
Definition: videotoolboxenc.c:2674
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:50
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:224
profile
int profile
Definition: mxfenc.c:2003
VTEncContext
Definition: videotoolboxenc.c:206
AV_PIX_FMT_NV12
@ 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...
Definition: pixfmt.h:89
FF_PROFILE_PRORES_4444
#define FF_PROFILE_PRORES_4444
Definition: avcodec.h:1637
FF_PROFILE_PRORES_PROXY
#define FF_PROFILE_PRORES_PROXY
Definition: avcodec.h:1633
HEVC_PROF_MAIN
@ HEVC_PROF_MAIN
Definition: videotoolboxenc.c:187
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:82
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
OFFSET
#define OFFSET(x)
Definition: videotoolboxenc.c:2686
VE
#define VE
Definition: videotoolboxenc.c:2673
AV_PIX_FMT_P010LE
@ AV_PIX_FMT_P010LE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
Definition: pixfmt.h:274
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
vtenc_frame
static av_cold int vtenc_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: videotoolboxenc.c:2434
H264_PROF_HIGH
@ H264_PROF_HIGH
Definition: videotoolboxenc.c:174
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
VT_CAVLC
@ VT_CAVLC
Definition: videotoolboxenc.c:181
vtenc_init
static av_cold int vtenc_init(AVCodecContext *avctx)
Definition: videotoolboxenc.c:1533
AV_CODEC_ID_PRORES
@ AV_CODEC_ID_PRORES
Definition: codec_id.h:198