macOS zero-copy encode device that forwards NV12 frames from AVFoundation to FFmpeg.
More...
#include <src/platform/macos/nv12_zero_device.h>
|
|
using | pixel_format_fn_t = std::function<void(void *display, int pixelFormat)> |
| | Callback signature used to update the opaque AVFoundation pixel format.
|
| |
|
using | resolution_fn_t = std::function<void(void *display, int width, int height)> |
| | Callback signature used to update the opaque AVFoundation display resolution.
|
| |
|
| int | convert (img_t &img) override |
| | Forward a captured AVFoundation frame to FFmpeg without copying.
|
| |
| 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.
|
| |
| int | set_frame (AVFrame *frame, AVBufferRef *hw_frames_ctx) override |
| | Attach frame resources used by the next conversion or encode operation.
|
| |
| virtual void | apply_colorspace () |
| | Apply the configured colorspace metadata to the active frame.
|
| |
| virtual void | init_codec_options (AVCodecContext *ctx, AVDictionary **options) |
| | Provides a hook for allow platform-specific code to adjust codec options.
|
| |
| virtual void | init_hwframes (AVHWFramesContext *frames) |
| | Initialize the hwframes context.
|
| |
| virtual int | prepare_to_derive_context (int hw_device_type) |
| | Prepare to derive a context.
|
| |
|
|
resolution_fn_t | resolution_fn |
| | Callback stored for later AVFoundation resolution updates.
|
| |
|
void * | data {} |
| | Backend-specific conversion state.
|
| |
|
AVFrame * | frame {} |
| | FFmpeg frame currently owned by the encode device.
|
| |
|
video::sunshine_colorspace_t | colorspace |
| | Colorspace metadata expected by the encoder.
|
| |
macOS zero-copy encode device that forwards NV12 frames from AVFoundation to FFmpeg.
◆ convert()
Forward a captured AVFoundation frame to FFmpeg without copying.
- Parameters
-
| img | Image or frame object to read from or populate. |
- Returns
- Conversion status.
Reimplemented from platf::avcodec_encode_device_t.
◆ init()
Initialize zero-copy NV12 encoding for an AVFoundation display.
- Parameters
-
| display | Display object or identifier associated with the operation. |
| pix_fmt | Sunshine pixel format to convert or allocate for. |
| resolution_fn | Callback used to resize the AVFoundation capture output. |
| pixel_format_fn | Pixel format. |
- Returns
- 0 on success; nonzero or negative platform status on failure.
◆ set_frame()
| int platf::nv12_zero_device::set_frame |
( |
AVFrame * | frame, |
|
|
AVBufferRef * | hw_frames_ctx ) |
|
overridevirtual |
Attach frame resources used by the next conversion or encode operation.
- Parameters
-
| frame | Video or graphics frame being processed. |
| hw_frames_ctx | FFmpeg hardware frames context associated with the frame. |
- Returns
- Status from updating frame.
Reimplemented from platf::avcodec_encode_device_t.
The documentation for this class was generated from the following files: