Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
nvenc_d3d11.h
Go to the documentation of this file.
1
5#pragma once
6#ifdef _WIN32
7
8 #include <comdef.h>
9 #include <d3d11.h>
10
11 #include "nvenc_base.h"
12
13namespace nvenc {
14
15 _COM_SMARTPTR_TYPEDEF(ID3D11Device, IID_ID3D11Device);
16 _COM_SMARTPTR_TYPEDEF(ID3D11Texture2D, IID_ID3D11Texture2D);
17 _COM_SMARTPTR_TYPEDEF(IDXGIDevice, IID_IDXGIDevice);
18 _COM_SMARTPTR_TYPEDEF(IDXGIAdapter, IID_IDXGIAdapter);
19
24 class nvenc_d3d11: public nvenc_base {
25 public:
26 explicit nvenc_d3d11(NV_ENC_DEVICE_TYPE device_type):
27 nvenc_base(device_type) {}
28
30
35 virtual ID3D11Texture2D *
37
38 protected:
39 bool
40 init_library() override;
41
42 private:
43 HMODULE dll = NULL;
44 };
45
46} // namespace nvenc
47#endif
Abstract platform-agnostic base of standalone NVENC encoder. Derived classes perform platform-specifi...
Definition nvenc_base.h:25
nvenc_base(NV_ENC_DEVICE_TYPE device_type)
Definition nvenc_base.cpp:88
Abstract Direct3D11 NVENC encoder. Encapsulates common code used by native and interop implementation...
Definition nvenc_d3d11.h:24
bool init_library() override
Required. Used for loading NvEnc library and setting nvenc variable with NvEncodeAPICreateInstance()....
Definition nvenc_d3d11.cpp:20
virtual ID3D11Texture2D * get_input_texture()=0
Get input surface texture.
Standalone NVENC encoder.
Definition nvenc_base.cpp:86
Declarations for abstract platform-agnostic base of standalone NVENC encoder.