Sunshine master
Self-hosted game stream host for Moonlight.
nvenc::nvenc_encoder Class Referenceabstract

SDK-neutral standalone NVENC encoder interface. More...

#include <src/nvenc/nvenc_encoder.h>

Inheritance diagram for nvenc::nvenc_encoder:
[legend]

Public Member Functions

virtual bool create_encoder (const nvenc_config &config, const video::config_t &client_config, const video::sunshine_colorspace_t &colorspace, platf::pix_fmt_e buffer_format)=0
 Create the encoder.
 
virtual void destroy_encoder ()=0
 Destroy the encoder.
 
virtual nvenc_encoded_frame encode_frame (std::uint64_t frame_index, bool force_idr)=0
 Encode the next frame using the platform-specific input surface.
 
virtual bool invalidate_ref_frames (std::uint64_t first_frame, std::uint64_t last_frame)=0
 Invalidate reference frames in the requested range.
 
virtual ~nvenc_encoder ()=default
 Destroy the SDK-neutral encoder interface.
 

Detailed Description

SDK-neutral standalone NVENC encoder interface.

Member Function Documentation

◆ create_encoder()

virtual bool nvenc::nvenc_encoder::create_encoder ( const nvenc_config & config,
const video::config_t & client_config,
const video::sunshine_colorspace_t & colorspace,
platf::pix_fmt_e buffer_format )
pure virtual

Create the encoder.

Parameters
configNVENC encoder configuration.
client_configStream configuration requested by the client.
colorspaceSunshine colorspace metadata.
buffer_formatPlatform-agnostic input surface format.
Returns
true on success, false on error.

◆ destroy_encoder()

virtual void nvenc::nvenc_encoder::destroy_encoder ( )
pure virtual

Destroy the encoder.

Implemented in nvenc::nvenc_base.

◆ encode_frame()

virtual nvenc_encoded_frame nvenc::nvenc_encoder::encode_frame ( std::uint64_t frame_index,
bool force_idr )
pure virtual

Encode the next frame using the platform-specific input surface.

Parameters
frame_indexFrame index that uniquely identifies the frame.
force_idrWhether to encode the frame as a forced IDR.
Returns
Encoded frame.

◆ invalidate_ref_frames()

virtual bool nvenc::nvenc_encoder::invalidate_ref_frames ( std::uint64_t first_frame,
std::uint64_t last_frame )
pure virtual

Invalidate reference frames in the requested range.

Parameters
first_frameFirst frame index of the invalidation range.
last_frameLast frame index of the invalidation range.
Returns
true on success, false on error.

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