Sunshine latest
Self-hosted game stream host for Moonlight.
nvenc::nvenc_d3d11_native Class Referencefinal

Native Direct3D11 NVENC encoder. More...

#include <src/nvenc/nvenc_d3d11_native.h>

Inheritance diagram for nvenc::nvenc_d3d11_native:
[legend]
Collaboration diagram for nvenc::nvenc_d3d11_native:
[legend]

Public Member Functions

ID3D11Texture2D * get_input_texture () override
 Get input surface texture.
 
 nvenc_d3d11_native (ID3D11Device *d3d_device)
 
- Public Member Functions inherited from nvenc::nvenc_d3d11
 nvenc_d3d11 (NV_ENC_DEVICE_TYPE device_type)
 
- Public Member Functions inherited from nvenc::nvenc_base
bool create_encoder (const nvenc_config &config, const video::config_t &client_config, const nvenc_colorspace_t &colorspace, NV_ENC_BUFFER_FORMAT buffer_format)
 Create the encoder.
 
void destroy_encoder ()
 Destroy the encoder. Derived classes classes call it in the destructor.
 
nvenc_encoded_frame encode_frame (uint64_t frame_index, bool force_idr)
 Encode the next frame using platform-specific input surface.
 
bool invalidate_ref_frames (uint64_t first_frame, uint64_t last_frame)
 Perform reference frame invalidation (RFI) procedure.
 
 nvenc_base (const nvenc_base &)=delete
 
 nvenc_base (NV_ENC_DEVICE_TYPE device_type)
 
nvenc_baseoperator= (const nvenc_base &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from nvenc::nvenc_d3d11
bool init_library () override
 Required. Used for loading NvEnc library and setting nvenc variable with NvEncodeAPICreateInstance(). Called during create_encoder() if nvenc variable is not initialized.
 
- Protected Member Functions inherited from nvenc::nvenc_base
uint32_t min_struct_version (uint32_t version, uint32_t v11_struct_version=0, uint32_t v12_struct_version=0)
 This function returns the corresponding struct version for the minimum API required by the codec.
 
bool nvenc_failed (NVENCSTATUS status)
 
virtual bool synchronize_input_buffer ()
 Optional. Override if you must perform additional operations on the registered input surface in the beginning of encode_frame(). Typically used for interop copy.
 
virtual bool wait_for_async_event (uint32_t timeout_ms)
 Optional. Override if you want to create encoder in async mode. In this case must also set async_event_handle variable.
 
- Protected Attributes inherited from nvenc::nvenc_base
void * async_event_handle = nullptr
 
void * device = nullptr
 
const NV_ENC_DEVICE_TYPE device_type
 
void * encoder = nullptr
 
struct { 
 
   NV_ENC_BUFFER_FORMAT   buffer_format = NV_ENC_BUFFER_FORMAT_UNDEFINED 
 
   uint32_t   height = 0 
 
   uint32_t   ref_frames_in_dpb = 0 
 
   bool   rfi = false 
 
   uint32_t   width = 0 
 
encoder_params 
 
std::string last_nvenc_error_string
 
std::shared_ptr< NV_ENCODE_API_FUNCTION_LIST > nvenc
 
NV_ENC_REGISTERED_PTR registered_input_buffer = nullptr
 

Detailed Description

Native Direct3D11 NVENC encoder.

Constructor & Destructor Documentation

◆ nvenc_d3d11_native()

nvenc::nvenc_d3d11_native::nvenc_d3d11_native ( ID3D11Device * d3d_device)
explicit
Parameters
d3d_deviceDirect3D11 device used for encoding.

Member Function Documentation

◆ get_input_texture()

ID3D11Texture2D * nvenc::nvenc_d3d11_native::get_input_texture ( )
overridevirtual

Get input surface texture.

Returns
Input surface texture.

Implements nvenc::nvenc_d3d11.


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