Abstract Direct3D11 NVENC encoder. Encapsulates common code used by native and interop implementations.
More...
#include <src/nvenc/nvenc_d3d11.h>
|
| 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.
|
| |
| bool | wait_for_async_event (uint32_t timeout_ms) override |
| | Optional. Override if you want to create encoder in async mode. In this case must also set async_event_handle variable.
|
| |
| virtual bool | create_and_register_input_buffer ()=0 |
| | Required. Used for creating outside-facing input surface, registering this surface with nvenc->nvEncRegisterResource() and setting registered_input_buffer variable. Called during create_encoder().
|
| |
| bool | nvenc_failed (NVENCSTATUS status) |
| | Check whether an NVENC API status represents failure.
|
| |
| 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.
|
| |
|
| void * | async_event_handle = nullptr |
| |
| void * | device = nullptr |
| |
|
const NV_ENC_DEVICE_TYPE | device_type |
| | NVENC device backend used by this encoder instance.
|
| |
|
void * | encoder = nullptr |
| | Opaque NVENC encoder session handle returned by the driver.
|
| |
|
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 | |
| | Current encoder dimensions, pixel format, and reference-frame settings.
|
| |
|
std::string | last_nvenc_error_string |
| | Last NVENC error string.
|
| |
| std::shared_ptr< NV_ENCODE_API_FUNCTION_LIST > | nvenc |
| |
| NV_ENC_REGISTERED_PTR | registered_input_buffer = nullptr |
| |
Abstract Direct3D11 NVENC encoder. Encapsulates common code used by native and interop implementations.
◆ nvenc_d3d11()
| nvenc::nvenc_d3d11::nvenc_d3d11 |
( |
NV_ENC_DEVICE_TYPE | device_type | ) |
|
|
explicit |
Initialize an NVENC session wrapper for D3D11 input textures.
- Parameters
-
| device_type | NVENC device type used by the encoder session. |
◆ get_input_texture()
| virtual ID3D11Texture2D * nvenc::nvenc_d3d11::get_input_texture |
( |
| ) |
|
|
pure virtual |
◆ init_library()
| bool nvenc::nvenc_d3d11::init_library |
( |
| ) |
|
|
overrideprotectedvirtual |
Required. Used for loading NvEnc library and setting nvenc variable with NvEncodeAPICreateInstance(). Called during create_encoder() if nvenc variable is not initialized.
- Returns
true on success, false on error
Implements nvenc::nvenc_base.
◆ wait_for_async_event()
| bool nvenc::nvenc_d3d11::wait_for_async_event |
( |
uint32_t | timeout_ms | ) |
|
|
overrideprotectedvirtual |
Optional. Override if you want to create encoder in async mode. In this case must also set async_event_handle variable.
- Parameters
-
| timeout_ms | Wait timeout in milliseconds |
- Returns
true on success, false on timeout or error
Reimplemented from nvenc::nvenc_base.
The documentation for this class was generated from the following files: