diff --git a/AUTHORS b/AUTHORS index ded3599a..3e32a293 100644 --- a/AUTHORS +++ b/AUTHORS @@ -54,3 +54,4 @@ thejavascriptman (thejavascriptman) vroad <396351+vroad@users.noreply.github.com> (vroad) williamvds (williamvds) SytheZN (SytheZN) +RTXUX (RTXUX) diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index 283b513a..becf041f 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -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; diff --git a/host/platform/Windows/capture/NVFBC/src/wrapper.cpp b/host/platform/Windows/capture/NVFBC/src/wrapper.cpp index 8df5a11a..0e9d9e0b 100644 --- a/host/platform/Windows/capture/NVFBC/src/wrapper.cpp +++ b/host/platform/Windows/capture/NVFBC/src/wrapper.cpp @@ -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; diff --git a/host/platform/Windows/capture/NVFBC/src/wrapper.h b/host/platform/Windows/capture/NVFBC/src/wrapper.h index 0f0f184b..dfcf60da 100644 --- a/host/platform/Windows/capture/NVFBC/src/wrapper.h +++ b/host/platform/Windows/capture/NVFBC/src/wrapper.h @@ -52,6 +52,7 @@ bool NvFBCInit(); void NvFBCFree(); bool NvFBCToSysCreate( + int adapterIndex, void * privData, unsigned int privDataSize, NvFBCHandle * handle,