Sunshine master
Self-hosted game stream host for Moonlight.
vk::vk_vram_t Class Reference

Vulkan encode device that keeps converted frames in GPU memory. More...

Inheritance diagram for vk::vk_vram_t:
[legend]
Collaboration diagram for vk::vk_vram_t:
[legend]

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 frame into a Vulkan hardware frame.
 
int init (int in_width, int in_height, int in_offset_x=0, int in_offset_y=0)
 Initialize Vulkan encode device and conversion resources.
 
void init_codec_options (AVCodecContext *ctx, AVDictionary **options) override
 Initialize codec options.
 
void init_hwframes (AVHWFramesContext *frames) override
 Configure FFmpeg Vulkan hardware frames for video encode input.
 
int set_frame (AVFrame *new_frame, AVBufferRef *hw_frames_ctx_buf) override
 Attach frame resources used by the next conversion or encode operation.
 
- Public Member Functions inherited from platf::avcodec_encode_device_t
virtual int prepare_to_derive_context (int hw_device_type)
 Prepare to derive a context.
 
- Public Member Functions inherited from platf::encode_device_t

Additional Inherited Members

- Public Attributes inherited from platf::avcodec_encode_device_t
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.
 

Detailed Description

Vulkan encode device that keeps converted frames in GPU memory.

Member Function Documentation

◆ apply_colorspace()

void vk::vk_vram_t::apply_colorspace ( )
inlineoverridevirtual

Apply the configured colorspace metadata to the active frame.

Reimplemented from platf::avcodec_encode_device_t.

◆ convert()

int vk::vk_vram_t::convert ( platf::img_t & img)
inlineoverridevirtual

Convert a captured frame into a Vulkan hardware frame.

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

Reimplemented from platf::avcodec_encode_device_t.

◆ init()

int vk::vk_vram_t::init ( int in_width,
int in_height,
int in_offset_x = 0,
int in_offset_y = 0 )
inline

Initialize Vulkan encode device and conversion resources.

Parameters
in_widthIn width.
in_heightIn height.
in_offset_xIn offset x.
in_offset_yIn offset y.
Returns
0 on success; nonzero or negative platform status on failure.

◆ init_codec_options()

void vk::vk_vram_t::init_codec_options ( AVCodecContext * ctx,
AVDictionary ** options )
inlineoverridevirtual

Initialize codec options.

Parameters
ctxNative context object used by the operation or callback.
optionsRequest options or socket options to apply.

Reimplemented from platf::avcodec_encode_device_t.

◆ init_hwframes()

void vk::vk_vram_t::init_hwframes ( AVHWFramesContext * frames)
inlineoverridevirtual

Configure FFmpeg Vulkan hardware frames for video encode input.

Parameters
framesFFmpeg hardware frames context to initialize.

Reimplemented from platf::avcodec_encode_device_t.

◆ set_frame()

int vk::vk_vram_t::set_frame ( AVFrame * new_frame,
AVBufferRef * hw_frames_ctx_buf )
inlineoverridevirtual

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

Parameters
new_frameFrame to attach.
hw_frames_ctx_bufHardware frames context buffer.
Returns
Status from updating frame.

Reimplemented from platf::avcodec_encode_device_t.


The documentation for this class was generated from the following file: