34 using resolution_fn_t = std::function<void(
void *display,
int width,
int height)>;
66 int set_frame(AVFrame *
frame, AVBufferRef *hw_frames_ctx)
override;
macOS zero-copy encode device that forwards NV12 frames from AVFoundation to FFmpeg.
Definition nv12_zero_device.h:23
int init(void *display, pix_fmt_e pix_fmt, resolution_fn_t resolution_fn, 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(void *display, int pixelFormat)> pixel_format_fn_t
Callback signature used to update the opaque AVFoundation pixel format.
Definition nv12_zero_device.h:39
std::function< void(void *display, int width, int height)> resolution_fn_t
Callback signature used to update the opaque AVFoundation display resolution.
Definition nv12_zero_device.h:34
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 *frame, AVBufferRef *hw_frames_ctx) override
Attach frame resources used by the next conversion or encode operation.
Definition nv12_zero_device.cpp:57
resolution_fn_t resolution_fn
Callback stored for later AVFoundation resolution updates.
Definition nv12_zero_device.h:35
Unique pointer wrapper with customizable pointer and deleter types.
Definition utility.h:820
Declarations for common platform specific utilities.
pix_fmt_e
Enumerates supported pix fmt options.
Definition common.h:316
void free_frame(AVFrame *frame)
Release an FFmpeg frame allocated by the capture or conversion backend.
Definition graphics.cpp:1403
AVCodec-backed encode device and frame state.
Definition common.h:566
AVFrame * frame
FFmpeg frame currently owned by the encode device.
Definition common.h:568
Captured frame buffer shared between capture and encode stages.
Definition common.h:502