mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-09 16:18:20 +00:00
[host] nvfbc: add an option to specify adapter
This commit is contained in:
parent
9fa643484c
commit
b21d842f0e
1
AUTHORS
1
AUTHORS
@ -54,3 +54,4 @@ thejavascriptman <thejavascriptman@outlook.com> (thejavascriptman)
|
||||
vroad <396351+vroad@users.noreply.github.com> (vroad)
|
||||
williamvds <w.vigolodasilva@gmail.com> (williamvds)
|
||||
SytheZN <sythe.zn@gmail.com> (SytheZN)
|
||||
RTXUX <wyf@rtxux.xyz> (RTXUX)
|
||||
|
@ -140,6 +140,13 @@ static void nvfbc_initOptions(void)
|
||||
.type = OPTION_TYPE_INT,
|
||||
.value.x_int = 128
|
||||
},
|
||||
{
|
||||
.module = "nvfbc",
|
||||
.name = "adapterIndex",
|
||||
.description = "The index of the adapter to capture from",
|
||||
.type = OPTION_TYPE_INT,
|
||||
.value.x_int = 0
|
||||
},
|
||||
{0}
|
||||
};
|
||||
|
||||
@ -186,12 +193,14 @@ static bool nvfbc_init(void)
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
int adapterIndex = option_get_int("nvfbc", "adapterIndex");
|
||||
|
||||
// NOTE: Calling this on hardware that doesn't support NvFBC such as GeForce
|
||||
// causes a substantial performance pentalty even if it fails! As such we only
|
||||
// attempt NvFBC as a last resort, or if configured via the app:capture
|
||||
// option.
|
||||
if (!NvFBCToSysCreate(privData, privDataLen, &this->nvfbc, &this->maxWidth, &this->maxHeight))
|
||||
if (!NvFBCToSysCreate(adapterIndex, privData, privDataLen, &this->nvfbc, &this->maxWidth, &this->maxHeight))
|
||||
{
|
||||
free(privData);
|
||||
return false;
|
||||
|
@ -109,6 +109,7 @@ void NvFBCFree()
|
||||
}
|
||||
|
||||
bool NvFBCToSysCreate(
|
||||
int adapterIndex,
|
||||
void * privData,
|
||||
unsigned int privDataSize,
|
||||
NvFBCHandle * handle,
|
||||
@ -121,7 +122,7 @@ bool NvFBCToSysCreate(
|
||||
params.dwVersion = NVFBC_CREATE_PARAMS_VER;
|
||||
params.dwInterfaceType = NVFBC_TO_SYS;
|
||||
params.pDevice = NULL;
|
||||
params.dwAdapterIdx = 0;
|
||||
params.dwAdapterIdx = adapterIndex;
|
||||
params.dwPrivateDataSize = privDataSize;
|
||||
params.pPrivateData = privData;
|
||||
|
||||
|
@ -52,6 +52,7 @@ bool NvFBCInit();
|
||||
void NvFBCFree();
|
||||
|
||||
bool NvFBCToSysCreate(
|
||||
int adapterIndex,
|
||||
void * privData,
|
||||
unsigned int privDataSize,
|
||||
NvFBCHandle * handle,
|
||||
|
Loading…
Reference in New Issue
Block a user