From c4f5a0aff93e05b3c01de0dbdc7c05e5d9530eda Mon Sep 17 00:00:00 2001 From: Igor Govorov Date: Wed, 11 Apr 2018 18:28:51 +0300 Subject: Push GeForceExperience SDK 1.1.201 --- doc/html/index.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'doc/html/index.html') diff --git a/doc/html/index.html b/doc/html/index.html index 9a665c8..20a22de 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -89,20 +89,20 @@ $(document).ready(function(){initNavTree('index.html','');});

See Core header documentation

See Highlights header documentation

C++ Bindings

-
createParams.appName = "gfesdk_dx_sample"; // appName will only be used/visible if GFE cannot identify your game
createParams.pollForCallbacks = true; // We will poll for callbacks in order to execute callbacks from game loop
createParams.requiredScopes = {
GfeSDK::NVGSDK_SCOPE_HIGHLIGHTS,
GfeSDK::NVGSDK_SCOPE_HIGHLIGHTS_VIDEO,
GfeSDK::NVGSDK_SCOPE_HIGHLIGHTS_SCREENSHOT
};
createParams.notificationCallback = std::bind(&HighlightsWrapper::OnNotification, this, _1, _2);
GfeSDK::Core* gfesdkCore = GfeSDK::Core::Create(createParams, response);
if (GfeSDK::NVGSDK_SUCCEEDED(response.returnCode))
{
// Valid handle has been returned
LOG("Success: %s", GfeSDK::NVGSDK_RetCodeToString(response.returnCode));
LOG("PC is running GFE version %s", response.nvidiaGfeVersion.c_str());
LOG("PC is running GfeSDK version %d.%d", response.versionMajor, response.versionMinor);
switch (response.returnCode)
{
case GfeSDK::NVGSDK_SUCCESS_VERSION_OLD_GFE:
LOG("Compatible, but the user should update to the latest version of GFE.");
break;
case GfeSDK::NVGSDK_SUCCESS_VERSION_OLD_SDK:
LOG("Compatible, but this application should update to a more recent GfeSDK to get latest features/bugfixes");
break;
}
}
else
{
// No valid handle
LOG("Failure: %s", GfeSDK::NVGSDK_RetCodeToString(response.returnCode));
switch (response.returnCode)
{
case GfeSDK::NVGSDK_ERR_SDK_VERSION:
LOG("This version of the SDK is too old to communicate with the user's SDK. We're never planning on this happening.");
LOG("PC is running GFE version %s", response.nvidiaGfeVersion.c_str());
LOG("PC is running GfeSDK version %d.%d", response.versionMajor, response.versionMinor);
break;
case GfeSDK::NVGSDK_SUCCESS_VERSION_OLD_SDK:
LOG("The installed version of GFE is too old to continue. User must upgrade.");
LOG("PC is running GFE version %s", response.nvidiaGfeVersion.c_str());
LOG("PC is running GfeSDK version %d.%d", response.versionMajor, response.versionMinor);
break;
}
return;
}

// After using GfeSDK

-
delete gfesdkCore;

C API

-
memset(&inParams, 0, sizeof(inParams));
NVGSDK_Scope scopes[] = { NVGSDK_SCOPE_HIGHLIGHTS, NVGSDK_SCOPE_HIGHLIGHTS_VIDEO, NVGSDK_SCOPE_HIGHLIGHTS_SCREENSHOT };
NVGSDK_ScopePermission scopePermissions[COUNT_OF(scopes)];
inParams.appName = "gfesdk_dx_sample";
inParams.pollForCallbacks = true;
inParams.scopeTable = &scopes[0];
inParams.scopeTableSize = COUNT_OF(scopes);
inParams.notificationCallback = handleNotification;
memset(&outParams, 0, sizeof(outParams));
outParams.scopePermissionTable = &scopePermissions[0];
outParams.scopePermissionTableSize = COUNT_OF(scopes);
NVGSDK_RetCode rc = NVGSDK_Create(&g_sdk, &inParams, &outParams);
if (NVGSDK_SUCCEEDED(rc))
{
// Valid handle has been returned
LOG("Success: %s", NVGSDK_RetCodeToString(rc));
LOG("PC is running GFE version %s", outParams.gfeVersionStr);
LOG("PC is running GfeSDK version %d.%d", outParams.versionMajor, outParams.versionMinor);
switch (rc)
{
case NVGSDK_SUCCESS_VERSION_OLD_GFE:
LOG("Compatible, but the user should update to the latest version of GFE.");
break;
case NVGSDK_SUCCESS_VERSION_OLD_SDK:
LOG("Compatible, but this application should update to a more recent GfeSDK to get latest features/bugfixes");
break;
}
}
else
{
// No valid handle
LOG("Failure: %s", NVGSDK_RetCodeToString(rc));
switch (rc)
{
case NVGSDK_ERR_SDK_VERSION:
LOG("This version of the SDK is too old to communicate with the user's SDK. We're never planning on this happening.");
LOG("PC is running GFE version %s", outParams.gfeVersionStr);
LOG("PC is running GfeSDK version %d.%d", outParams.versionMajor, outParams.versionMinor);
break;
case NVGSDK_SUCCESS_VERSION_OLD_SDK:
LOG("The installed version of GFE is too old to continue. User must upgrade.");
LOG("PC is running GFE version %s", outParams.gfeVersionStr);
LOG("PC is running GfeSDK version %d.%d", outParams.versionMajor, outParams.versionMinor);
break;
}
return;
}

// After using GfeSDK

-

The Create call will inform the app if one or more scopes require user permission. If so, make this call. It will display the overlay UI.

+

// After using GfeSDK

+

C API

+

// After using GfeSDK

+

The Create call will inform the app if one or more scopes require user permission. If so, make this call. It will display the overlay UI.

C++ Bindings

-
// Request Permissions if user hasn't decided yet
GfeSDK::RequestPermissionsParams requestPermissionsParams;
// 'response' came from create call. It tells us which permissions we requested during Create,
// but the user hasn't yet made a decision on
for (auto&& entry : response.scopePermissions)
{
if (entry.second == GfeSDK::NVGSDK_PERMISSION_MUST_ASK)
{
requestPermissionsParams.scopes.push_back(entry.first);
}
}
if (!requestPermissionsParams.scopes.empty())
{
// If the user hasn't given permission for recording yet, ask them to do so now via overlay
m_gfesdk->RequestPermissionsAsync(requestPermissionsParams, [this, defaultLocale, highlights, numHighlights](GfeSDK::NVGSDK_RetCode rc, void* cbContext) {
UpdateLastResultString(rc);
if (GfeSDK::NVGSDK_SUCCEEDED(rc))
{
ConfigureHighlights(defaultLocale, highlights, numHighlights);
}
});
}
else
{
// Otherwise, go ahead and set up now
ConfigureHighlights(defaultLocale, highlights, numHighlights);
}

C API

-
// Request Permissions if user hasn't decided yet
NVGSDK_RequestPermissionsParams requestPermissionsParams = { 0 };
NVGSDK_Scope requestScopes[COUNT_OF(scopes)];
memset(requestScopes, NVGSDK_SCOPE_MAX, COUNT_OF(scopes));
requestPermissionsParams.scopeTable = &requestScopes[0];
// 'response' came from create call. It tells us which permissions we requested during Create,
// but the user hasn't yet made a decision on
for (size_t i = 0, j = 0; i < outParams.scopePermissionTableSize; ++i)
{
if (outParams.scopePermissionTable[i].permission == NVGSDK_PERMISSION_MUST_ASK)
{
requestPermissionsParams.scopeTable[j++] = outParams.scopePermissionTable[i].scope;
requestPermissionsParams.scopeTableSize++;
}
}
if (requestPermissionsParams.scopeTableSize > 0)
{
TConfigHolder* configHolder = malloc(sizeof(TConfigHolder));
configHolder->defaultLocale = defaultLocale;
configHolder->highlights = highlights;
configHolder->numHighlights = numHighlights;
// If the user hasn't given permission for recording yet, ask them to do so now via overlay
NVGSDK_RequestPermissionsAsync(g_sdk, &requestPermissionsParams, &handlePermissionRequested, configHolder);
}
else
{
// Otherwise, go ahead and set up now
ConfigureHighlights(defaultLocale, highlights, numHighlights);
}

This only needs to happen once ever. It is persistent. It could even happen during game installation.

+

C API

+

This only needs to happen once ever. It is persistent. It could even happen during game installation.

C++ Bindings

-
// Create handle to highlights module
m_highlights.reset(GfeSDK::Highlights::Create(m_gfesdk.get()));
configParams.defaultLocale = defaultLocale;
// Set up highlight definition table
for (size_t i = 0; i < numHighlights; ++i)
{
highlightDef.id = highlights[i].id;
highlightDef.userDefaultInterest = highlights[i].userInterest;
highlightDef.significance = highlights[i].significance;
highlightDef.highlightTags = highlights[i].highlightTags;
for (size_t j = 0; j < highlights[i].nameTableSize; ++j)
{
highlightDef.nameLocaleTable[highlights[i].nameTable[j].localeCode] = highlights[i].nameTable[j].localizedString;
}
configParams.highlightDefinitions.push_back(highlightDef);
}
m_highlights->ConfigureAsync(configParams, [this](GfeSDK::NVGSDK_RetCode rc, void*) {
UpdateLastResultString(rc);
});

C API

-
NVGSDK_Highlight* highlights = calloc(numHighlights, sizeof(NVGSDK_Highlight));
highlights[0].userInterest = false;
params->defaultLocale = defaultLocale;
params->highlightDefinitionTable = highlights;
params->highlightTableSize = numHighlights;
for (size_t i = 0; i < numHighlights; ++i)
{
highlights[i].id = hl[i].id;
highlights[i].highlightTags = hl[i].highlightTags;
highlights[i].significance = hl[i].significance;
highlights[i].userInterest = hl[i].userInterest;
highlights[i].nameTableSize = hl[i].nameTableSize;
highlights[i].nameTable = hl[i].nameTableSize > 0 ? calloc(hl[i].nameTableSize, sizeof(NVGSDK_LocalizedPair)) : NULL;
for (size_t name = 0; name < hl[i].nameTableSize; ++name)
{
highlights[i].nameTable[name].localeCode = calloc(NVGSDK_MAX_LENGTH, sizeof(char));
strncpy_s((char*)highlights[i].nameTable[name].localeCode, NVGSDK_MAX_LENGTH, hl[i].nameTable[name].localeCode, NVGSDK_MAX_LENGTH);
highlights[i].nameTable[name].localizedString = calloc(NVGSDK_MAX_LENGTH, sizeof(char));
strncpy_s((char*)highlights[i].nameTable[name].localizedString, NVGSDK_MAX_LENGTH, hl[i].nameTable[name].localizedString, NVGSDK_MAX_LENGTH);
}
}
NVGSDK_Highlights_ConfigureAsync(g_sdk, params, &handleConfigured, params);

C++ Bindings

-
params.groupId = id;
params.groupDescriptionLocaleTable["en-US"] = id;
m_highlights->OpenGroupAsync(params, [this](GfeSDK::NVGSDK_RetCode rc, void*) {
UpdateLastResultString(rc);
});
params.startDelta = startDelta;
params.endDelta = endDelta;
params.groupId = groupId;
params.highlightId = highlightId;
m_highlights->SetVideoHighlightAsync(params, [this](GfeSDK::NVGSDK_RetCode rc, void*) {
UpdateLastResultString(rc);
});
params.groupId = id;
params.destroyHighlights = destroy;
m_highlights->CloseGroupAsync(params, [this](GfeSDK::NVGSDK_RetCode rc, void*) {
UpdateLastResultString(rc);
});

C API

-
params.groupId = groupId;
NVGSDK_Highlights_OpenGroupAsync(g_sdk, &params, &handleGenericResponse, NULL);
params.groupId = groupId;
params.highlightId = highlightId;
params.startDelta = startDelta;
params.endDelta = endDelta;
NVGSDK_Highlights_SetVideoHighlightAsync(g_sdk, &params, &handleGenericResponse, NULL);
params.groupId = groupId;
params.destroyHighlights = destroy;
NVGSDK_Highlights_CloseGroupAsync(g_sdk, &params, &handleGenericResponse, NULL);

C++ Bindings

-
// Can show more than one group at a time, each with their own filters if desired
for (size_t i = 0; i < numGroups; ++i)
{
v.groupId = groupIds[i];
v.significanceFilter = sigFilter;
v.tagsFilter = tagFilter;
params.groupViews.push_back(v);
}
m_highlights->OpenSummaryAsync(params, [this](GfeSDK::NVGSDK_RetCode rc, void*) {
UpdateLastResultString(rc);
});

C API

-
NVGSDK_SummaryParams* params = calloc(1, sizeof(NVGSDK_SummaryParams));
params->groupSummaryTable = calloc(numGroups, sizeof(NVGSDK_GroupView));
params->groupSummaryTableSize = numGroups;
for (size_t i = 0; i < numGroups; ++i)
{
params->groupSummaryTable[i].groupId = groupIds[i];
params->groupSummaryTable[i].significanceFilter = sigFilter;
params->groupSummaryTable[i].tagsFilter = tagFilter;
}
NVGSDK_Highlights_OpenSummaryAsync(g_sdk, params, &handleSummaryOpened, params);

The GfeSDK is composed of two parts, the client/app, and the backend/server. This distribution contains GfeSDK.dll which represents the client/app part. The end-user downloads GFE onto their machine. The GFE package includes the backend pieces necessary to support the calls coming from the client. See Versioning for more information regarding this communication.

+

C API

+

C++ Bindings

+

C API

+

C++ Bindings

+

C API

+

The GfeSDK is composed of two parts, the client/app, and the backend/server. This distribution contains GfeSDK.dll which represents the client/app part. The end-user downloads GFE onto their machine. The GFE package includes the backend pieces necessary to support the calls coming from the client. See Versioning for more information regarding this communication.

Calls made will be serialized. Therefore, if the app makes two consecutive calls to NVGSDK_Highlights_OpenGroup and then either NVGSDK_Highlights_SetVideoHighlight or NVGSDK_Highlights_SetScreenshotHighlight, before receiving the callback from open group, the set highlight call will function normally. If open group succeeded, then the set highlights calls will succeed as well. If it failed, the set highlights calls will fail, as there will be no valid group to assign them to.

All strings are to be provided in single-byte width, UTF-8 encoded.

Because there are two different parts, and the client / user's machine may be mismatched at times, the game should be aware of the versioning system. It's GfeSDK's goal to make this as seamless as possible, but there could still be compatibility issues to be aware of.

@@ -125,7 +125,7 @@ Highlights Permission

Most of the calls to GfeSDK are asynchronous. This is due to the client/server architecture described in Concepts. For each asynchronous call, a callback and an opaque void* context are passed in as arguments. If the app does not care or desire to know what happens to the call, is it fine to pass in NULL. If the app does care, supply a callback of the proper type, and optionally a pointer as a context to receive back during the callback.

The callbacks are properly typed. For callbacks that return nothing but the return value and context, a NVGSDK_EmptyCallback is passed in. For versions that do return data, a typed callback is passed in, such as NVGSDK_GetUILanguageCallback.

The callback will be called on one of three threads, depending on the situation. If NVGSDK_CreateInputParams::pollForCallbacks is set to false during creation, the callback will always occur on a GfeSDK controller thread. If the app desires callback to occur on their own thread, true is passed in instead. In that case, the callback will occur on the thread that calls NVGSDK_Poll. The exception is that during NVGSDK_Destroy, GfeSDK pushes out all remaining callbacks. If the app is awaiting any callbacks during this time, they will be called on the same thread that called NVGSDK_Destroy. Usually, this will be the same thread that calls NVGSDK_Poll, so it shouldn't cause any surprises, but it's something to be aware of. See Threading for more information

-
// We are passing two arguments to this function, the function lambda, and a user context. In this case, we're passing
// the 'this' pointer as the user context. This gets passed through unmodified for use in the callback function.
m_gfesdk->GetUILanguageAsync([this](GfeSDK::NVGSDK_RetCode rc, GfeSDK::GetUILanguageResponse const* response, void* context) {
// Passed this pointer through as context
HighlightsWrapper* thiz = reinterpret_cast<HighlightsWrapper*>(context);
UpdateLastResultString(rc);
if (GfeSDK::NVGSDK_SUCCEEDED(rc))
{
m_lastQueryResult = m_converter.from_bytes(response->cultureCode);
}
}, this);
// If the caller doesn't care about the return value, no need to pass callbacks
GfeSDK::HighlightCloseGroupParams params = { "GROUP_1" };
m_highlights->CloseGroupAsync(params);

Note: There is currently a limitation in the GfeSDK backend that depends on game frames being rendered during certain API calls. Therefore, the game cannot block the render loop while awaiting an asynchronous callback. Doing so will result in a deadlock.

+

Note: There is currently a limitation in the GfeSDK backend that depends on game frames being rendered during certain API calls. Therefore, the game cannot block the render loop while awaiting an asynchronous callback. Doing so will result in a deadlock.

In addition to the async callbacks that most of the APIs accept as an argument, the app can also register to recieve unsolicited notifications when certain events occur. For example, the app might want to know when the user can given / removed permission for recording video from the app, either through the permissions dialog, or via GFE3. See NVGSDK_CreateInputParams and NVGSDK_NotificationType

This notification will get called on either the GfeSDK callback thread, or the thread that calls NVGSDK_Poll, depending on params passed in to NVGSDK_Create. See Threading for more information.

There are two different threading models that may be used. The model used depends on the value passed in to NVGSDK_CreateInputParams

-- cgit v1.2.3