73 int set_frame(AVFrame *new_frame, AVBufferRef *hw_frames_ctx)
override;
macOS zero-copy encode device that forwards NV12 frames from AVFoundation to FFmpeg.
Definition nv12_zero_device.h:32
int convert(img_t &img) override
Forward a captured AVFoundation frame to FFmpeg without copying.
Definition nv12_zero_device.cpp:38
int set_frame(AVFrame *new_frame, AVBufferRef *hw_frames_ctx) override
Attach frame resources used by the next conversion or encode operation.
Definition nv12_zero_device.cpp:57
int init(AVVideo *capture_display, pix_fmt_e pix_fmt, resolution_fn_t set_resolution, const pixel_format_fn_t &pixel_format_fn)
Initialize zero-copy NV12 encoding for an AVFoundation display.
Definition nv12_zero_device.cpp:67
std::function< void(AVVideo *display, int width, int height)> resolution_fn_t
Callback signature used to update the opaque AVFoundation display resolution.
Definition nv12_zero_device.h:41
resolution_fn_t resolution_fn
Callback stored for later AVFoundation resolution updates.
Definition nv12_zero_device.h:42
std::function< void(AVVideo *display, int pixelFormat)> pixel_format_fn_t
Callback signature used to update the opaque AVFoundation pixel format.
Definition nv12_zero_device.h:46
Declarations for common platform specific utilities.
pix_fmt_e
Enumerates supported pix fmt options.
Definition common.h:342
AVFoundation video capture controller used by the macOS backend.
Definition av_video.h:23
void free_frame(AVFrame *frame)
Release an FFmpeg frame allocated by the capture or conversion backend.
Definition nv12_zero_device.cpp:22
AVCodec-backed encode device and frame state.
Definition common.h:594
Captured frame buffer shared between capture and encode stages.
Definition common.h:530
uniq_ptr< T, Destroy< T *, void, function > > safe_ptr
Unique pointer using a compile-time C-style destroy function.
Definition utility.h:1590