Sunshine latest
Self-hosted game stream host for Moonlight.
cuda::gl_cuda_vram_t Class Reference
Inheritance diagram for cuda::gl_cuda_vram_t:
[legend]
Collaboration diagram for cuda::gl_cuda_vram_t:
[legend]

Public Member Functions

void apply_colorspace () override
 Configures shader parameters for the specified colorspace.
 
int convert (platf::img_t &img) override
 Convert the captured image into the target CUDA frame.
 
int init (int in_width, int in_height, int offset_x, int offset_y)
 Initialize the GL->CUDA encoding device.
 
int set_frame (AVFrame *frame, AVBufferRef *hw_frames_ctx_buf) override
 Initialize color conversion into target CUDA frame.
 
- 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.
 

Public Attributes

egl::ctx_t ctx
 
egl::display_t display
 
file_t file
 
gbm::gbm_t gbm
 
int height
 
frame_t hwframe
 
egl::nv12_t nv12
 
int offset_x
 
int offset_y
 
egl::rgb_t rgb
 
std::uint64_t sequence
 
stream_t stream
 
AVPixelFormat sw_format
 
egl::sws_t sws
 
registered_resource_t uv_res
 
int width
 
registered_resource_t y_res
 
- Public Attributes inherited from platf::avcodec_encode_device_t
void * data {}
 
AVFrame * frame {}
 
- Public Attributes inherited from platf::encode_device_t
video::sunshine_colorspace_t colorspace
 

Member Function Documentation

◆ apply_colorspace()

void cuda::gl_cuda_vram_t::apply_colorspace ( )
inlineoverridevirtual

Configures shader parameters for the specified colorspace.

Reimplemented from platf::avcodec_encode_device_t.

◆ convert()

int cuda::gl_cuda_vram_t::convert ( platf::img_t & img)
inlineoverridevirtual

Convert the captured image into the target CUDA frame.

Parameters
imgCaptured screen image.
Returns
0 on success or -1 on failure.

Reimplemented from platf::avcodec_encode_device_t.

◆ init()

int cuda::gl_cuda_vram_t::init ( int in_width,
int in_height,
int offset_x,
int offset_y )
inline

Initialize the GL->CUDA encoding device.

Parameters
in_widthWidth of captured frames.
in_heightHeight of captured frames.
offset_xOffset of content in captured frame.
offset_yOffset of content in captured frame.
Returns
0 on success or -1 on failure.

◆ set_frame()

int cuda::gl_cuda_vram_t::set_frame ( AVFrame * frame,
AVBufferRef * hw_frames_ctx_buf )
inlineoverridevirtual

Initialize color conversion into target CUDA frame.

Parameters
frameDestination CUDA frame to write into.
hw_frames_ctx_bufFFmpeg hardware frame context.
Returns
0 on success or -1 on failure.

Reimplemented from platf::avcodec_encode_device_t.


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