mirror of
https://dev.lirent.ru/Vatrog/vm-vgpu-streamer.git
synced 2026-06-18 02:16:38 +03:00
Initial commit: win32 vGPU stream capture module
Capture backends (NvFBC/DDA/GDI), cursor/region/present helpers, publish API, vendor NvFBC headers; CMake build with mingw-w64 toolchain.
This commit is contained in:
Vendored
+275
@@ -0,0 +1,275 @@
|
||||
/**
|
||||
* \file This file contains definitions for NVFBC API.
|
||||
* \copyright
|
||||
*
|
||||
* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
||||
* NOTICE TO LICENSEE: This source code and/or documentation ("Licensed Deliverables")
|
||||
* are subject to the applicable NVIDIA license agreement
|
||||
* that governs the use of the Licensed Deliverables.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
|
||||
typedef unsigned char NvU8;
|
||||
typedef unsigned long NvU32;
|
||||
typedef unsigned long long NvU64;
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC The NVIDIA Frame Buffer Capture API.
|
||||
* \brief Defines a set of interfaces for high performance Capture of desktop content.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC_ENUMS Enums
|
||||
* \ingroup NVFBC
|
||||
* \brief Enumerations to be used with NVFBC API
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC_STRUCTS Structs
|
||||
* \ingroup NVFBC
|
||||
* \brief Defines Parameter Structures to be used with NVFBC APIs.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC_ENTRYPOINTS Entrypoints
|
||||
* \ingroup NVFBC
|
||||
* \brief Declarations for NVFBC Entrypoint functions
|
||||
*/
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Macro to define the NVFBC API version corresponding to this distribution.
|
||||
*/
|
||||
#define NVFBC_DLL_VERSION 0x50
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Macro to construct version numbers for parameter structs.
|
||||
*/
|
||||
#define NVFBC_STRUCT_VERSION(typeName, ver) (NvU32)(sizeof(typeName) | ((ver)<<16) | (NVFBC_DLL_VERSION << 24))
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Calling Convention
|
||||
*/
|
||||
#define NVFBCAPI __stdcall
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Indicates that there are no global overrides specified for NVFBC. To be used with NVFBC_SetGlobalFlags API
|
||||
*/
|
||||
#define NVFBC_GLOBAL_FLAGS_NONE 0x00000000
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Indicates to NVFBC that stereo rendering is enabled. Currently unsupported. To be used with NVFBC_SetGlobalFlags API.
|
||||
*/
|
||||
#define NVFBC_GLOBAL_FLAGS_STEREO_BUFFER 0x00000001
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Indicates that NVFBC should not request a repaint of the desktop when initiating NVFBC capture. To be used with NVFBC_SetGlobalFlags API.
|
||||
*/
|
||||
#define NVFBC_GLOBAL_FLAGS_NO_INITIAL_REFRESH 0x00000002
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC
|
||||
* Indicates that NVFBC should not reset the graphics driver while servicing subsequent NVFBC_Enable API requests.
|
||||
*/
|
||||
|
||||
#define NVFBC_GLOBAL_FLAGS_NO_DEVICE_RESET_TOGGLE 0x00000004
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENUMS
|
||||
* \brief Enumerates status codes returned by NVFBC APIs.
|
||||
*/
|
||||
typedef enum _NVFBCRESULT
|
||||
{
|
||||
NVFBC_SUCCESS = 0,
|
||||
NVFBC_ERROR_GENERIC = -1, /**< Unexpected failure in NVFBC. */
|
||||
NVFBC_ERROR_INVALID_PARAM = -2, /**< One or more of the paramteres passed to NvFBC are invalid [This include NULL pointers]. */
|
||||
NVFBC_ERROR_INVALIDATED_SESSION = -3, /**< NvFBC session is invalid. Client needs to recreate session. */
|
||||
NVFBC_ERROR_PROTECTED_CONTENT = -4, /**< Protected content detected. Capture failed. */
|
||||
NVFBC_ERROR_DRIVER_FAILURE = -5, /**< GPU driver returned failure to process NvFBC command. */
|
||||
NVFBC_ERROR_CUDA_FAILURE = -6, /**< CUDA driver returned failure to process NvFBC command. */
|
||||
NVFBC_ERROR_UNSUPPORTED = -7, /**< API Unsupported on this version of NvFBC. */
|
||||
NVFBC_ERROR_HW_ENC_FAILURE = -8, /**< HW Encoder returned failure to process NVFBC command. */
|
||||
NVFBC_ERROR_INCOMPATIBLE_DRIVER = -9, /**< NVFBC is not compatible with this version of the GPU driver. */
|
||||
NVFBC_ERROR_UNSUPPORTED_PLATFORM = -10, /**< NVFBC is not supported on this platform. */
|
||||
NVFBC_ERROR_OUT_OF_MEMORY = -11, /**< Failed to allocate memory. */
|
||||
NVFBC_ERROR_INVALID_PTR = -12, /**< A NULL pointer was passed. */
|
||||
NVFBC_ERROR_INCOMPATIBLE_VERSION = -13, /**< An API was called with a parameter struct that has an incompatible version. Check dwVersion field of paramter struct. */
|
||||
NVFBC_ERROR_OPT_CAPTURE_FAILURE = -14, /**< Desktop Capture failed. */
|
||||
NVFBC_ERROR_INSUFFICIENT_PRIVILEGES = -15, /**< User doesn't have appropriate previlages. */
|
||||
NVFBC_ERROR_INVALID_CALL = -16, /**< NVFBC APIs called in wrong sequence. */
|
||||
NVFBC_ERROR_SYSTEM_ERROR = -17, /**< Win32 error. */
|
||||
NVFBC_ERROR_INVALID_TARGET = -18, /**< The target adapter idx can not be used for NVFBC capture. It may not correspond to an NVIDIA GPU, or may not be attached to desktop. */
|
||||
NVFBC_ERROR_DYNAMIC_DISABLE = -20, /**< NvFBC is dynamically disabled. Cannot continue to capture */
|
||||
} NVFBCRESULT;
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENUMS
|
||||
* \brief Enumerates NVFBC states. To be used with NvFBC_Enable API
|
||||
*/
|
||||
typedef enum _NVFBC_STATE
|
||||
{
|
||||
NVFBC_STATE_DISABLE = 0, /** Disables NvFBC. */
|
||||
NVFBC_STATE_ENABLE , /** Enables NvFBC. */
|
||||
NVFBC_STATE_LAST , /** Sentinel value. Shouldn't be used. */
|
||||
} NVFBC_STATE;
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_STRUCTS
|
||||
* \brief Defines parameters that describe the grabbed data, and provides detailed information about status of the NVFBC session.
|
||||
*/
|
||||
typedef struct _NvFBCFrameGrabInfo
|
||||
{
|
||||
DWORD dwWidth; /**< [out] Indicates the current width of captured buffer. */
|
||||
DWORD dwHeight; /**< [out] Indicates the current height of captured buffer. */
|
||||
DWORD dwBufferWidth; /**< [out] Indicates the current width of the pixel buffer(padded width). */
|
||||
DWORD dwReserved; /**< [in] Reserved, do not use. */
|
||||
BOOL bOverlayActive; /**< [out] Is set to 1 if overlay was active. */
|
||||
BOOL bMustRecreate; /**< [out] Is set to 1 if the compressor must call NvBFC_Create again. */
|
||||
BOOL bFirstBuffer; /**< [out] Is set to 1 is this was the first capture call, or first call after a desktop mode change.
|
||||
Relevant only for XOR and diff modes supported by NVFBCToSys interface. */
|
||||
BOOL bHWMouseVisible; /**< [out] Is set to 1 if HW cursor was enabled by OS at the time of the grab. */
|
||||
BOOL bProtectedContent; /**< [out] Is set to 1 if protected content was active (DXVA encryption Session). */
|
||||
DWORD dwDriverInternalError; /**< [out] Indicates the status code from lower layers. 0 or 0xFBCA11F9 indicates no error was returned. */
|
||||
BOOL bStereoOn; /**< [out] Is set to 1 if stereo was on. */
|
||||
BOOL bIGPUCapture; /**< [out] Is set to 1 if the captured frame is from iGPU. 0 if capture fails or if captured from dGPU*/
|
||||
DWORD dwSourcePID; /**< [out] Indicates which process caused the last screen update that got grabbed*/
|
||||
DWORD dwReserved3; /**< [in] Reserved, do not use. */
|
||||
NvU32 dwReserved2[13]; /**< [in] Resereved, should be set to 0. */
|
||||
} NvFBCFrameGrabInfo;
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_STRUCTS
|
||||
* \brief Deines the parameters to be used with NvFBC_GetStatusEx API
|
||||
*/
|
||||
typedef struct _NvFBCStatusEx
|
||||
{
|
||||
NvU32 dwVersion; /**< [in] Struct version. Set to NVFBC_STATUS_VER. */
|
||||
NvU32 bIsCapturePossible :1; /**< [out] Indicates if NvFBC feature is enabled. */
|
||||
NvU32 bCurrentlyCapturing:1; /**< [out] Indicates if NVFBC is currently capturing for the Adapter ordinal specified in dwAdapterIdx. */
|
||||
NvU32 bCanCreateNow :1; /**< [out] Deprecated. Do not use. */
|
||||
NvU32 bSupportMultiHead :1; /**< [out] MultiHead grab supported. */
|
||||
NvU32 bSupportMultiClient:1; /**< [out] Multiple capture clients on same display adapter supported. */
|
||||
NvU32 bReservedBits :27; /**< [in] Reserved, do not use. */
|
||||
NvU32 dwNvFBCVersion; /**< [out] Indicates the highest NvFBC interface version supported by the loaded NVFBC library. */
|
||||
NvU32 dwAdapterIdx; /**< [in] Adapter Ordinal corresponding to the display to be grabbed. IGNORED if bCapturePID is set */
|
||||
void* pPrivateData; /**< [in] optional **/
|
||||
NvU32 dwPrivateDataSize; /**< [in] optional **/
|
||||
NvU32 dwReserved[59]; /**< [in] Reserved. Should be set to 0. */
|
||||
void* pReserved[31]; /**< [in] Reserved. Should be set to NULL. */
|
||||
} NvFBCStatusEx;
|
||||
#define NVFBC_STATUS_VER_1 NVFBC_STRUCT_VERSION(NvFBCStatusEx, 1)
|
||||
#define NVFBC_STATUS_VER_2 NVFBC_STRUCT_VERSION(NvFBCStatusEx, 2)
|
||||
#define NVFBC_STATUS_VER NVFBC_STATUS_VER_2
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_STRUCTS
|
||||
* \brief Defines the parameters to be used with NvFBC_CreateEx API.
|
||||
*/
|
||||
typedef struct _NvFBCCreateParams
|
||||
{
|
||||
NvU32 dwVersion; /**< [in] Struct version. Set to NVFBC_CREATE_PARAMS_VER. */
|
||||
NvU32 dwInterfaceType; /**< [in] ID of the NVFBC interface Type being requested. */
|
||||
NvU32 dwMaxDisplayWidth; /**< [out] Max. display width allowed. */
|
||||
NvU32 dwMaxDisplayHeight; /**< [out] Max. display height allowed. */
|
||||
void* pDevice; /**< [in] Device pointer. */
|
||||
void* pPrivateData; /**< [in] Private data [optional]. */
|
||||
NvU32 dwPrivateDataSize; /**< [in] Size of private data. */
|
||||
NvU32 dwInterfaceVersion; /**< [in] Version of the capture interface. */
|
||||
void* pNvFBC; /**< [out] A pointer to the requested NVFBC object. */
|
||||
NvU32 dwAdapterIdx; /**< [in] Adapter Ordinal corresponding to the display to be grabbed. If pDevice is set, this parameter is ignored. */
|
||||
NvU32 dwNvFBCVersion; /**< [out] Indicates the highest NvFBC interface version supported by the loaded NVFBC library. */
|
||||
void* cudaCtx; /**< [in] CUDA context created using cuD3D9CtxCreate with the D3D9 device passed as pDevice. Only used for NvFBCCuda interface.
|
||||
It is mandatory to pass a valid D3D9 device if cudaCtx is passed. The call will fail otherwise.
|
||||
Client must release NvFBCCuda object before destroying the cudaCtx. */
|
||||
void* pPrivateData2; /**< [in] Private data [optional]. */
|
||||
NvU32 dwPrivateData2Size; /**< [in] Size of private data. */
|
||||
NvU32 dwReserved[55]; /**< [in] Reserved. Should be set to 0. */
|
||||
void* pReserved[27]; /**< [in] Reserved. Should be set to NULL. */
|
||||
}NvFBCCreateParams;
|
||||
#define NVFBC_CREATE_PARAMS_VER_1 NVFBC_STRUCT_VERSION(NvFBCCreateParams, 1)
|
||||
#define NVFBC_CREATE_PARAMS_VER_2 NVFBC_STRUCT_VERSION(NvFBCCreateParams, 2)
|
||||
#define NVFBC_CREATE_PARAMS_VER NVFBC_CREATE_PARAMS_VER_2
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_STRUCTS
|
||||
* \brief Defines parameters for a Grab\Capture call to get HW cursor data in the NVFBCToSys capture session.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
NvU32 dwVersion; /**< [in]: Struct version. Set to NVFBC_MOUSE_GRAB_INFO_VER.*/
|
||||
NvU32 dwWidth; /**< [out]: Width of mouse glyph captured.*/
|
||||
NvU32 dwHeight; /**< [out]: Height of mouse glyph captured.*/
|
||||
NvU32 dwPitch; /**< [out]: Pitch of mouse glyph captured.*/
|
||||
NvU32 bIsHwCursor : 1; /**< [out]: Tells if cursor is HW cursor or SW cursor. If set to 0, ignore height, width, pitch and pBits.*/
|
||||
NvU32 bReserved : 32; /**< [in]: Reserved.*/
|
||||
NvU32 dwPointerFlags; /**< [out]: Maps to DXGK_POINTERFLAGS::Value.*/
|
||||
NvU32 dwXHotSpot; /**< [out]: Maps to DXGKARG_SETPOINTERSHAPE::XHot.*/
|
||||
NvU32 dwYHotSpot; /**< [out]: Maps to DXGKARG_SETPOINTERSHAPE::YHot.*/
|
||||
NvU32 dwUpdateCounter; /**< [out]: Cursor update Counter. */
|
||||
NvU32 dwBufferSize; /**< [out]: Size of the buffer contaiing the captured cursor glyph. */
|
||||
void * pBits; /**< [out]: pointer to buffer containing the captured cursor glyph.*/
|
||||
NvU32 dwReservedA[22]; /**< [in]: Reserved. Set to 0.*/
|
||||
void * pReserved[15]; /**< [in]: Reserved. Set to 0.*/
|
||||
}NVFBC_CURSOR_CAPTURE_PARAMS;
|
||||
#define NVFBC_CURSOR_CAPTURE_PARAMS_VER NVFBC_STRUCT_VERSION(NVFBC_CURSOR_CAPTURE_PARAMS, 1)
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENTRYPOINTS
|
||||
* \brief NVFBC API to set global overrides
|
||||
* \param [in] dwFlags Global overrides for NVFBC. Use ::NVFBC_GLOBAL_FLAGS value.
|
||||
*/
|
||||
void NVFBCAPI NvFBC_SetGlobalFlags(DWORD dwFlags);
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENTRYPOINTS
|
||||
* \brief NVFBC API to create an NVFBC capture session.
|
||||
* Instantiates an interface identified by NvFBCCreateParams::dwInterfaceType.
|
||||
* \param [inout] pCreateParams Pointer to a struct of type ::NvFBCCreateParams, typecast to void*
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
NVFBCRESULT NVFBCAPI NvFBC_CreateEx(void * pCreateParams);
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENTRYPOINTS
|
||||
* \brief NVFBC API to query Current NVFBC status.
|
||||
* Queries the status for the adapter pointed to by the NvFBCStatusEx::dwAdapterIdx parameter.
|
||||
* \param [inout] pCreateParams Pointer to a struct of type ::NvFBCStatusEx.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
NVFBCRESULT NVFBCAPI NvFBC_GetStatusEx(NvFBCStatusEx *pNvFBCStatusEx);
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENTRYPOINTS
|
||||
* \brief NVFBC API to enable \ disable NVFBC feature.
|
||||
* \param [in] nvFBCState Refer ::NVFBC_STATE
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
NVFBCRESULT NVFBCAPI NvFBC_Enable(NVFBC_STATE nvFBCState);
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_ENTRYPOINTS
|
||||
* \brief NVFBC API to query highest GRID SDK version supported by the loaded NVFBC library.
|
||||
* \param [out] pVersion Pointer to a 32-bit integer to hold the supported GRID SDK version.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
NVFBCRESULT NVFBCAPI NvFBC_GetSDKVersion(NvU32 * pVersion);
|
||||
|
||||
/**
|
||||
* \cond API_PFN
|
||||
*/
|
||||
typedef void (NVFBCAPI * NvFBC_SetGlobalFlagsType) (DWORD dwFlags);
|
||||
typedef NVFBCRESULT (NVFBCAPI * NvFBC_CreateFunctionExType) (void * pCreateParams);
|
||||
typedef NVFBCRESULT (NVFBCAPI * NvFBC_GetStatusExFunctionType) (void * pNvFBCStatus);
|
||||
typedef NVFBCRESULT (NVFBCAPI * NvFBC_EnableFunctionType) (NVFBC_STATE nvFBCState);
|
||||
typedef NVFBCRESULT (NVFBCAPI * NvFBC_GetSDKVersionFunctionType) (NvU32 * pVersion);
|
||||
/**
|
||||
* \endcond API_PFN
|
||||
*/
|
||||
Vendored
+176
@@ -0,0 +1,176 @@
|
||||
/**
|
||||
* \file This file contains defintions for NVFBCToSys
|
||||
*
|
||||
* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
||||
* NOTICE TO LICENSEE: This source code and/or documentation ("Licensed Deliverables")
|
||||
* are subject to the applicable NVIDIA license agreement
|
||||
* that governs the use of the Licensed Deliverables.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NVFBC_TO_SYS_H_
|
||||
#define NVFBC_TO_SYS_H_
|
||||
/**
|
||||
* \defgroup NVFBC_TOSYS NVFBCToSys Interface
|
||||
* \brief Interface for grabbing Desktop images and generating output in system memory.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC_TOSYS_ENUMS Enums
|
||||
* \ingroup NVFBC_TOSYS
|
||||
* \brief Enumerations used with NVFBCToSys interface.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC_TOSYS_STRUCTS Structs
|
||||
* \ingroup NVFBC_TOSYS
|
||||
* \brief Parameter Structs Defined for use with NVFBCToSys interface.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup NVFBC_TOSYS_INTERFACE Object Interface
|
||||
* \ingroup NVFBC_TOSYS
|
||||
* \brief Interface class definition for NVFBCToSys Capture API
|
||||
*/
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS
|
||||
* \brief Macro to define the interface ID to be passed as NvFBCCreateParams::dwInterfaceType
|
||||
* for creating an NVFBCToSys capture session object.
|
||||
*/
|
||||
#define NVFBC_TO_SYS (0x1204)
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS_ENUMS
|
||||
* Enumerates output buffer pixel data formats supported by NVFBCToSys.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NVFBC_TOSYS_ARGB = 0, /**< Output Pixels in ARGB format: 32bpp, one byte per channel. */
|
||||
NVFBC_TOSYS_RGB , /**< Output Pixels in RGB format: 24bpp, one byte per channel. */
|
||||
NVFBC_TOSYS_YYYYUV420p , /**< Output Pixels in YUV420 format: 12bpp,
|
||||
the Y' channel at full resolution, U channel at half resolution (1 byte for four pixels), V channel at half resolution. */
|
||||
NVFBC_TOSYS_RGB_PLANAR , /**< Output Pixels in planar RGB format: 24bpp,
|
||||
stored sequentially in memory as complete red channel, complete green channel, complete blue channel. */
|
||||
NVFBC_TOSYS_XOR , /**< Output Pixels in RGB format: 24bpp XOR'd with the prior frame. */
|
||||
NVFBC_TOSYS_YUV444p , /**< Output Pixels in YUV444 planar format, i.e. separate 8-bpp Y, U, V planes with no subsampling.*/
|
||||
NVFBC_TOSYS_BUF_FMT_LAST , /**< Sentinel value. Do not use.*/
|
||||
} NVFBCToSysBufferFormat;
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS_ENUMS
|
||||
* Enumerates Capture\Grab modes supported by NVFBCToSys.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NVFBC_TOSYS_SOURCEMODE_FULL = 0, /**< Grab full res */
|
||||
NVFBC_TOSYS_SOURCEMODE_SCALE , /**< Will convert current res to supplied resolution (dwTargetWidth and dwTargetHeight) */
|
||||
NVFBC_TOSYS_SOURCEMODE_CROP , /**< Native res, crops a subwindow, of dwTargetWidth and dwTargetHeight sizes, starting at dwStartX and dwStartY */
|
||||
NVFBC_TOSYS_SOURCEMODE_LAST , /**< Sentinel value. Do not use. */
|
||||
}NVFBCToSysGrabMode;
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS_ENUMS
|
||||
* \enum NVFBC_TOSYS_GRAB_FLAGS Enumerates special commands for grab\capture supported by NVFBCToSys.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NVFBC_TOSYS_NOFLAGS = 0x0, /**< Default (no flags set). Grabbing will wait for a new frame or HW mouse move. */
|
||||
NVFBC_TOSYS_NOWAIT = 0x1, /**< Grabbing will not wait for a new frame nor a HW cursor move. */
|
||||
NVFBC_TOSYS_WAIT_WITH_TIMEOUT = 0x10, /**< Grabbing will wait for a new frame or HW mouse move with a maximum wait time of NVFBC_TOSYS_GRAB_FRAME_PARAMS::dwWaitTime millisecond*/
|
||||
} NVFBC_TOSYS_GRAB_FLAGS;
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS_STRUCTS
|
||||
* \brief Defines parameters used to configure NVFBCToSys capture session.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
NvU32 dwVersion; /**< [in]: Struct version. Set to NVFBC_TOSYS_SETUP_PARAMS_VER.*/
|
||||
NvU32 bWithHWCursor :1; /**< [in]: The client should set this to 1 if it requires the HW cursor to be composited on the captured image.*/
|
||||
NvU32 bDiffMap :1; /**< [in]: The client should set this to use the DiffMap feature.*/
|
||||
NvU32 bEnableSeparateCursorCapture : 1; /**< [in]: The client should set this to 1 if it wants to enable mouse capture in separate stream.*/
|
||||
NvU32 bReservedBits :29; /**< [in]: Reserved. Set to 0.*/
|
||||
NVFBCToSysBufferFormat eMode; /**< [in]: Output image format.*/
|
||||
NvU32 dwReserved1; /**< [in]: Reserved. Set to 0.*/
|
||||
void **ppBuffer; /**< [out]: Container to hold NvFBC output buffers.*/
|
||||
void **ppDiffMap; /**< [out]: Container to hold NvFBC output diffmap buffers.*/
|
||||
void *hCursorCaptureEvent; /**< [out]: Client should wait for mouseEventHandle event before calling MouseGrab function. */
|
||||
NvU32 dwReserved[58]; /**< [in]: Reserved. Set to 0.*/
|
||||
void *pReserved[29]; /**< [in]: Reserved. Set to 0.*/
|
||||
} NVFBC_TOSYS_SETUP_PARAMS_V2;
|
||||
#define NVFBC_TOSYS_SETUP_PARAMS_VER2 NVFBC_STRUCT_VERSION(NVFBC_TOSYS_SETUP_PARAMS, 2)
|
||||
typedef NVFBC_TOSYS_SETUP_PARAMS_V2 NVFBC_TOSYS_SETUP_PARAMS;
|
||||
#define NVFBC_TOSYS_SETUP_PARAMS_VER NVFBC_TOSYS_SETUP_PARAMS_VER2
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS_STRUCTS
|
||||
* \brief Defines parameters for a Grab\Capture call in the NVFBCToSys capture session.
|
||||
* Also holds information regarding the grabbed data.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
NvU32 dwVersion; /**< [in]: Struct version. Set to NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER.*/
|
||||
NvU32 dwFlags; /**< [in]: Special grabbing requests. This should be a bit-mask of NVFBC_TOSYS_GRAB_FLAGS values.*/
|
||||
NvU32 dwTargetWidth; /**< [in]: Target image width. NvFBC will scale the captured image to fit taret width and height. Used with NVFBC_TOSYS_SOURCEMODE_SCALE and NVFBC_TOSYS_SOURCEMODE_CROP. */
|
||||
NvU32 dwTargetHeight; /**< [in]: Target image height. NvFBC will scale the captured image to fit taret width and height. Used with NVFBC_TOSYS_SOURCEMODE_SCALE and NVFBC_TOSYS_SOURCEMODE_CROP. */
|
||||
NvU32 dwStartX; /**< [in]: x-coordinate of starting pixel for cropping. Used with NVFBC_TOSYS_SOURCEMODE_CROP. */
|
||||
NvU32 dwStartY; /**< [in]: y-coordinate of starting pixel for cropping. Used with NVFBC_TOSYS_SOURCEMODE_CROP. .*/
|
||||
NVFBCToSysGrabMode eGMode; /**< [in]: Frame grab mode.*/
|
||||
NvU32 dwWaitTime; /**< [in]: Time limit for NvFBCToSysGrabFrame() to wait until a new frame is available or a HW mouse moves. Use with NVFBC_TOSYS_WAIT_WITH_TIMEOUT */
|
||||
NvFBCFrameGrabInfo *pNvFBCFrameGrabInfo; /**< [in/out]: Frame grab information and feedback from NvFBC driver.*/
|
||||
NvU32 dwReserved[56]; /**< [in]: Reserved. Set to 0.*/
|
||||
void *pReserved[31]; /**< [in]: Reserved. Set to NULL.*/
|
||||
} NVFBC_TOSYS_GRAB_FRAME_PARAMS_V1;
|
||||
#define NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER1 NVFBC_STRUCT_VERSION(NVFBC_TOSYS_GRAB_FRAME_PARAMS, 1)
|
||||
typedef NVFBC_TOSYS_GRAB_FRAME_PARAMS_V1 NVFBC_TOSYS_GRAB_FRAME_PARAMS;
|
||||
#define NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER1
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup NVFBC_TOSYS_INTERFACE
|
||||
* Interface class definition for NVFBCToSys Capture API
|
||||
*/
|
||||
class INvFBCToSys_v3
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Sets up NVFBC System Memory capture according to the provided parameters.
|
||||
* \param [in] pParam Pointer to a struct of type ::NVFBC_TOSYS_SETUP_PARAMS.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
virtual NVFBCRESULT NVFBCAPI NvFBCToSysSetUp (NVFBC_TOSYS_SETUP_PARAMS_V2 *pParam) = 0;
|
||||
|
||||
/**
|
||||
* \brief Captures the desktop and dumps the captured data to a System memory buffer.
|
||||
* If the API returns a failure, the client should check the return codes and ::NvFBCFrameGrabInfo output fields to determine if the session needs to be re-created.
|
||||
* \param [inout] pParam Pointer to a struct of type ::NVFBC_TOSYS_GRAB_FRAME_PARAMS.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
virtual NVFBCRESULT NVFBCAPI NvFBCToSysGrabFrame (NVFBC_TOSYS_GRAB_FRAME_PARAMS *pParam) = 0;
|
||||
|
||||
/**
|
||||
* \brief Captures HW cursor data whenever shape of mouse is changed
|
||||
* \param [inout] pParam Pointer to a struct of type ::NVFBC_CURSOR_CAPTURE_PARAMS.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
virtual NVFBCRESULT NVFBCAPI NvFBCToSysCursorCapture (NVFBC_CURSOR_CAPTURE_PARAMS *pParam) = 0;
|
||||
|
||||
/**
|
||||
* \brief A high precision implementation of Sleep().
|
||||
* Can provide sub quantum (usually 16ms) sleep that does not burn CPU cycles.
|
||||
* \param [in] qwMicroSeconds The number of microseconds that the thread should sleep for.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
virtual NVFBCRESULT NVFBCAPI NvFBCToSysGPUBasedCPUSleep (__int64 qwMicroSeconds) = 0;
|
||||
|
||||
/**
|
||||
* \brief Destroys the NVFBCToSys capture session.
|
||||
* \return An applicable ::NVFBCRESULT value.
|
||||
*/
|
||||
virtual NVFBCRESULT NVFBCAPI NvFBCToSysRelease () = 0;
|
||||
};
|
||||
|
||||
typedef INvFBCToSys_v3 NvFBCToSys;
|
||||
|
||||
#endif // NVFBC_TO_SYS_H_
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/* Windows.h — case-compat shim for the vendor NvFBC header, not our API. */
|
||||
#include <windows.h>
|
||||
Reference in New Issue
Block a user