Sunshine master
Self-hosted game stream host for Moonlight.
platf::dxgi::d3d_nvenc_encode_device_t Class Reference

D3D11 encode device that exposes captured textures to NVENC. More...

Inheritance diagram for platf::dxgi::d3d_nvenc_encode_device_t:
[legend]
Collaboration diagram for platf::dxgi::d3d_nvenc_encode_device_t:
[legend]

Public Member Functions

int convert (platf::img_t &img_base) override
 Convert a captured D3D texture for NVENC encoding.
 
bool init_device (std::shared_ptr< platf::display_t > display, adapter_t::pointer adapter_p, pix_fmt_e pix_fmt)
 Create D3D11 and NVENC resources for texture-based encoding.
 
bool init_encoder (const ::video::config_t &client_config, const ::video::sunshine_colorspace_t &colorspace) override
 Initialize the platform encoder for the client stream configuration.
 
- Public Member Functions inherited from platf::nvenc_encode_device_t
virtual bool init_encoder (const video::config_t &client_config, const video::sunshine_colorspace_t &colorspace)=0
 Initialize the platform encoder for the client stream configuration.
 
- Public Member Functions inherited from platf::encode_device_t

Additional Inherited Members

- Public Attributes inherited from platf::nvenc_encode_device_t
nvenc::nvenc_basenvenc = nullptr
 NVENC encoder instance 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

D3D11 encode device that exposes captured textures to NVENC.

Member Function Documentation

◆ convert()

int platf::dxgi::d3d_nvenc_encode_device_t::convert ( platf::img_t & img_base)
inlineoverridevirtual

Convert a captured D3D texture for NVENC encoding.

Parameters
img_baseD3D image supplied by the capture backend.
Returns
Conversion status.

Implements platf::encode_device_t.

◆ init_device()

bool platf::dxgi::d3d_nvenc_encode_device_t::init_device ( std::shared_ptr< platf::display_t > display,
adapter_t::pointer adapter_p,
pix_fmt_e pix_fmt )
inline

Create D3D11 and NVENC resources for texture-based encoding.

Parameters
displayDisplay object or identifier associated with the operation.
adapter_pAdapter p.
pix_fmtSunshine pixel format to convert or allocate for.
Returns
True when the D3D11 device resources are initialized.

◆ init_encoder()

bool platf::dxgi::d3d_nvenc_encode_device_t::init_encoder ( const ::video::config_t & client_config,
const ::video::sunshine_colorspace_t & colorspace )
inlineoverride

Initialize the platform encoder for the client stream configuration.

Parameters
client_configClient stream configuration negotiated for this session.
colorspaceColorimetry information used for conversion or encoding.
Returns
True when the NVENC encoder initializes for the client configuration.

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