Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
video::avcodec_software_encode_device_t Class Reference

FFmpeg software encode device used when no hardware frames are required. More...

#include <src/video.h>

Inheritance diagram for video::avcodec_software_encode_device_t:
Collaboration diagram for video::avcodec_software_encode_device_t:

Public Member Functions

void apply_colorspace () override
 Apply the configured colorspace metadata to the active frame.
int convert (platf::img_t &img) override
 Convert a captured image into the encoder input representation.
int init (int in_width, int in_height, AVFrame *in_frame, AVPixelFormat format, bool hardware)
 Initialize FFmpeg software encoding for the requested codec.
int set_frame (AVFrame *in_frame, AVBufferRef *hw_frames_ctx) override
 Attach frame resources used by the next conversion or encode operation.
Public Member Functions inherited from platf::avcodec_encode_device_t
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.

Additional Inherited Members

Public Types inherited from platf::avcodec_encode_device_t
using init_hw_device_fn_t = int (*)(avcodec_encode_device_t *encode_device, AVBufferRef **hw_device_buf)
 Callback signature for backend-specific FFmpeg hardware device initialization.
Public Attributes inherited from platf::avcodec_encode_device_t
ID3D11Device * d3d11_device = nullptr
 Native D3D11 device borrowed while the encode device is alive.
AVFrame * frame {}
 FFmpeg frame currently owned by the encode device.
bool hardware = false
 Whether this device supplies hardware frames instead of software conversion.
init_hw_device_fn_t init_hw_device = nullptr
 Optional backend-specific hardware device initializer.
Public Attributes inherited from platf::encode_device_t
video::sunshine_colorspace_t colorspace
 Colorspace metadata expected by the encoder.

Detailed Description

FFmpeg software encode device used when no hardware frames are required.

Member Function Documentation

◆ apply_colorspace()

void video::avcodec_software_encode_device_t::apply_colorspace ( )
overridevirtual

Apply the configured colorspace metadata to the active frame.

Reimplemented from platf::avcodec_encode_device_t.

◆ convert()

int video::avcodec_software_encode_device_t::convert ( platf::img_t & img)
overridevirtual

Convert a captured image into the encoder input representation.

Parameters
imgImage or frame object to read from or populate.
Returns
Conversion status.

Reimplemented from platf::avcodec_encode_device_t.

◆ init()

int video::avcodec_software_encode_device_t::init ( int in_width,
int in_height,
AVFrame * in_frame,
AVPixelFormat format,
bool hardware )

Initialize FFmpeg software encoding for the requested codec.

Parameters
in_widthIn width.
in_heightIn height.
in_frameVideo or graphics frame being processed.
formatPixel, audio, or protocol format being converted.
hardwareWhether the frame is backed by hardware resources.
Returns
0 on success; nonzero or negative platform status on failure.

◆ set_frame()

int video::avcodec_software_encode_device_t::set_frame ( AVFrame * in_frame,
AVBufferRef * hw_frames_ctx )
overridevirtual

Attach frame resources used by the next conversion or encode operation.

Note
Takes ownership of 'in_frame'.
Parameters
in_frameVideo or graphics frame being processed.
hw_frames_ctxFFmpeg 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: