|
Sunshine master
Self-hosted game stream host for Moonlight.
|
AVCodec-backed encode device and frame state. More...
#include <src/platform/common.h>
Public Member Functions | |
| virtual void | apply_colorspace () |
| 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. | |
| 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. | |
| virtual int | set_frame (AVFrame *frame, AVBufferRef *hw_frames_ctx) |
| Set the frame to be encoded. | |
Public Member Functions inherited from platf::encode_device_t | |
Public Attributes | |
| void * | data {} |
| Backend-specific conversion state. | |
| AVFrame * | frame {} |
| FFmpeg frame currently owned by the encode device. | |
Public Attributes inherited from platf::encode_device_t | |
| video::sunshine_colorspace_t | colorspace |
| Colorspace metadata expected by the encoder. | |
AVCodec-backed encode device and frame state.
|
inlinevirtual |
Apply the configured colorspace metadata to the active frame.
Reimplemented in cuda::cuda_t, cuda::gl_cuda_vram_t, platf::dxgi::d3d_avcodec_encode_device_t, va::va_t, video::avcodec_software_encode_device_t, and vk::vk_vram_t.
|
inlineoverridevirtual |
Convert a captured image into the encoder input representation.
| img | Image or frame object to read from or populate. |
Implements platf::encode_device_t.
Reimplemented in cuda::cuda_ram_t, cuda::cuda_vram_t, cuda::gl_cuda_vram_t, platf::dxgi::d3d_avcodec_encode_device_t, platf::nv12_zero_device, va::va_ram_t, va::va_vram_t, video::avcodec_software_encode_device_t, and vk::vk_vram_t.
|
inlinevirtual |
Provides a hook for allow platform-specific code to adjust codec options.
| ctx | Native context object used by the operation or callback. |
| options | Request options or socket options to apply. |
Reimplemented in va::va_t, and vk::vk_vram_t.
|
inlinevirtual |
Initialize the hwframes context.
| frames | FFmpeg hardware frames context to initialize. |
Reimplemented in platf::dxgi::d3d_avcodec_encode_device_t, and vk::vk_vram_t.
|
inlinevirtual |
Prepare to derive a context.
| hw_device_type | FFmpeg hardware device type requested for context derivation. |
Reimplemented in platf::dxgi::d3d_avcodec_encode_device_t.
|
inlinevirtual |
Set the frame to be encoded.
| frame | Video or graphics frame being processed. |
| hw_frames_ctx | FFmpeg hardware frames context associated with the frame. |
Reimplemented in cuda::cuda_ram_t, cuda::cuda_t, cuda::gl_cuda_vram_t, platf::dxgi::d3d_avcodec_encode_device_t, platf::nv12_zero_device, va::va_t, video::avcodec_software_encode_device_t, and vk::vk_vram_t.