mirror of
https://dev.lirent.ru/Vatrog/vm-automation-signaling.git
synced 2026-06-26 04:36:37 +03:00
vgpu in-guest producer in-tree, release CI, flexible vmie discovery
- src/si/vgpu-stream: in-guest vgpu producer built as a Windows cross-compiled target (if(WIN32)) - .gitea: release workflow — cross-build the agent and build/publish the deb against system vmie - cmake/makefile: resolve vmie from a source tree (LIBVMIE_PATH) or installed libvmie-dev
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
#ifndef VGPU_NVFBC_TOSYS_C_H
|
||||
#define VGPU_NVFBC_TOSYS_C_H
|
||||
|
||||
/*
|
||||
* C mirror of NvFBC's ToSys interface. The vendor header
|
||||
* third_party/NvFBC/nvFBCToSys.h declares INvFBCToSys_v3 as a C++ abstract
|
||||
* class (vtable of 5 pure-virtual
|
||||
* __stdcall methods). We do NOT edit the vendor header; instead we replicate its
|
||||
* single-inheritance vtable ABI as a COM-in-C interface so the producer stays
|
||||
* pure C. Slot order MUST match declaration order in nvFBCToSys.h:
|
||||
* 0 NvFBCToSysSetUp
|
||||
* 1 NvFBCToSysGrabFrame
|
||||
* 2 NvFBCToSysCursorCapture
|
||||
* 3 NvFBCToSysGPUBasedCPUSleep
|
||||
* 4 NvFBCToSysRelease
|
||||
* On x64 (mingw/MSVC) `this` is the implicit first integer argument; __stdcall
|
||||
* is a no-op for x64 so a plain pointer arg matches the vtable slot.
|
||||
*/
|
||||
|
||||
#include "NvFBC/nvFBC.h" /* vendor (third_party/): NVFBCRESULT, NvU32, param structs */
|
||||
|
||||
/* SetUp / GrabFrame param structs come from nvFBCToSys.h, but that header is C++.
|
||||
* Redeclare the two we use here (layout-identical, C-clean). */
|
||||
|
||||
typedef enum {
|
||||
NVFBC_TOSYS_ARGB = 0,
|
||||
NVFBC_TOSYS_RGB,
|
||||
NVFBC_TOSYS_YYYYUV420p,
|
||||
NVFBC_TOSYS_RGB_PLANAR,
|
||||
NVFBC_TOSYS_XOR,
|
||||
NVFBC_TOSYS_YUV444p,
|
||||
NVFBC_TOSYS_BUF_FMT_LAST
|
||||
} NVFBCToSysBufferFormat_c;
|
||||
|
||||
typedef enum {
|
||||
NVFBC_TOSYS_SOURCEMODE_FULL = 0,
|
||||
NVFBC_TOSYS_SOURCEMODE_SCALE,
|
||||
NVFBC_TOSYS_SOURCEMODE_CROP,
|
||||
NVFBC_TOSYS_SOURCEMODE_LAST
|
||||
} NVFBCToSysGrabMode_c;
|
||||
|
||||
enum {
|
||||
NVFBC_TOSYS_NOFLAGS_C = 0x0,
|
||||
NVFBC_TOSYS_NOWAIT_C = 0x1,
|
||||
NVFBC_TOSYS_WAIT_WITH_TIMEOUT_C = 0x10
|
||||
};
|
||||
|
||||
#define NVFBC_TO_SYS_C (0x1204)
|
||||
|
||||
typedef struct {
|
||||
NvU32 dwVersion;
|
||||
NvU32 bits; /* bWithHWCursor:1, bDiffMap:1, bSep:1, rsvd:29 */
|
||||
NVFBCToSysBufferFormat_c eMode;
|
||||
NvU32 dwReserved1;
|
||||
void **ppBuffer;
|
||||
void **ppDiffMap;
|
||||
void *hCursorCaptureEvent;
|
||||
NvU32 dwReserved[58];
|
||||
void *pReserved[29];
|
||||
} NVFBC_TOSYS_SETUP_PARAMS_C;
|
||||
#define NVFBC_TOSYS_SETUP_PARAMS_VER_C \
|
||||
NVFBC_STRUCT_VERSION(NVFBC_TOSYS_SETUP_PARAMS_C, 2)
|
||||
|
||||
typedef struct {
|
||||
NvU32 dwVersion;
|
||||
NvU32 dwFlags;
|
||||
NvU32 dwTargetWidth;
|
||||
NvU32 dwTargetHeight;
|
||||
NvU32 dwStartX;
|
||||
NvU32 dwStartY;
|
||||
NVFBCToSysGrabMode_c eGMode;
|
||||
NvU32 dwWaitTime;
|
||||
NvFBCFrameGrabInfo *pNvFBCFrameGrabInfo;
|
||||
NvU32 dwReserved[56];
|
||||
void *pReserved[31];
|
||||
} NVFBC_TOSYS_GRAB_FRAME_PARAMS_C;
|
||||
#define NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER_C \
|
||||
NVFBC_STRUCT_VERSION(NVFBC_TOSYS_GRAB_FRAME_PARAMS_C, 1)
|
||||
|
||||
/* COM-in-C interface mirror */
|
||||
typedef struct NvFBCToSys_c NvFBCToSys_c;
|
||||
typedef struct {
|
||||
NVFBCRESULT (__stdcall *NvFBCToSysSetUp)(NvFBCToSys_c*, NVFBC_TOSYS_SETUP_PARAMS_C*);
|
||||
NVFBCRESULT (__stdcall *NvFBCToSysGrabFrame)(NvFBCToSys_c*, NVFBC_TOSYS_GRAB_FRAME_PARAMS_C*);
|
||||
NVFBCRESULT (__stdcall *NvFBCToSysCursorCapture)(NvFBCToSys_c*, void*);
|
||||
NVFBCRESULT (__stdcall *NvFBCToSysGPUBasedCPUSleep)(NvFBCToSys_c*, __int64);
|
||||
NVFBCRESULT (__stdcall *NvFBCToSysRelease)(NvFBCToSys_c*);
|
||||
} NvFBCToSys_c_vtbl;
|
||||
struct NvFBCToSys_c {
|
||||
const NvFBCToSys_c_vtbl* lpVtbl;
|
||||
};
|
||||
|
||||
#endif /* VGPU_NVFBC_TOSYS_C_H */
|
||||
Reference in New Issue
Block a user