Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
nvenc_d3d11.h
Go to the documentation of this file.
1
5#pragma once
6#ifdef _WIN32
7
8 // standard includes
9 #include <comdef.h>
10 #include <d3d11.h>
11
12 // local includes
13 #include "nvenc_base.h"
15 #include "nvenc_shared_dll.h"
16
17namespace NVENC_NAMESPACE {
18
19 #ifdef DOXYGEN
23 using ID3D11DevicePtr = ID3D11Device *;
27 using ID3D11Texture2DPtr = ID3D11Texture2D *;
31 using IDXGIDevicePtr = IDXGIDevice *;
35 using IDXGIAdapterPtr = IDXGIAdapter *;
36 #else
37 _COM_SMARTPTR_TYPEDEF(ID3D11Device, IID_ID3D11Device);
38 _COM_SMARTPTR_TYPEDEF(ID3D11Texture2D, IID_ID3D11Texture2D);
39 _COM_SMARTPTR_TYPEDEF(IDXGIDevice, IID_IDXGIDevice);
40 _COM_SMARTPTR_TYPEDEF(IDXGIAdapter, IID_IDXGIAdapter);
41 #endif
42
48 public:
55 explicit nvenc_d3d11(NV_ENC_DEVICE_TYPE device_type, ::nvenc::shared_dll dll);
56 ~nvenc_d3d11() override;
57
62 ID3D11Texture2D *get_input_texture() override = 0;
63
64 protected:
65 bool init_library() override;
66 bool wait_for_async_event(uint32_t timeout_ms) override;
67
68 private:
70 };
71
72} // namespace NVENC_NAMESPACE
73#endif
const NV_ENC_DEVICE_TYPE device_type
NVENC device backend used by this encoder instance.
Definition nvenc_base.h:138
nvenc_base(NV_ENC_DEVICE_TYPE device_type)
Definition nvenc_base.cpp:187
SDK-neutral Direct3D11 NVENC encoder interface.
Definition nvenc_d3d11_interface.h:20
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_even...
Definition nvenc_d3d11.cpp:49
ID3D11Texture2D * get_input_texture() override=0
Get input surface texture.
bool init_library() override
Required. Used for loading NvEnc library and setting nvenc variable with NvEncodeAPICreateInstance()....
Definition nvenc_d3d11.cpp:25
nvenc_d3d11(NV_ENC_DEVICE_TYPE device_type, ::nvenc::shared_dll dll)
Initialize an NVENC session wrapper for D3D11 input textures.
Definition nvenc_d3d11.cpp:13
IDXGIAdapter * IDXGIAdapterPtr
COM smart pointer for IDXGIAdapter.
Definition nvenc_d3d11.h:35
ID3D11Texture2D * ID3D11Texture2DPtr
COM smart pointer for ID3D11Texture2D.
Definition nvenc_d3d11.h:27
IDXGIDevice * IDXGIDevicePtr
COM smart pointer for IDXGIDevice.
Definition nvenc_d3d11.h:31
std::shared_ptr< std::remove_pointer_t< HMODULE > > shared_dll
Shared ownership wrapper for a loaded Windows module.
Definition nvenc_shared_dll.h:20
ID3D11Device * ID3D11DevicePtr
COM smart pointer for ID3D11Device.
Definition nvenc_d3d11.h:23
Declarations for abstract platform-agnostic base of standalone NVENC encoder.
Declarations for the SDK-neutral Direct3D11 NVENC interface.
#define NVENC_NAMESPACE
Namespace used for the documented NVENC implementation.
Definition nvenc_sdk.h:12
Windows module lifetime helpers shared by NVENC factories and encoders.