Hello Cameron,
That's exactly what I mean!
This piece of code is from the DeviceNotification example:
- Code: Select all
// Set the device arrival / removal callback object
if(deckLinkDiscovery->InstallDeviceNotifications(deckLinkDeviceDiscoveryCallback) != S_OK)
{
fprintf(stderr, "Could not install device discovery callback object\n");
goto bail;
}
printf("Waiting for DeckLink devices.... Press <RETURN> to exit\n");
getchar();
printf("Exiting.\n");
// Uninstall device notifications
if(deckLinkDiscovery->UninstallDeviceNotifications() != S_OK)
{
fprintf(stderr, "Could not uninstall device discovery callback objects\n");
goto bail;
}
The getchar() is what we need to replace, so, the application could run as a service. Probable a small delay by Sleep(x) is the solution, but how long to wait? There is no way to know when the discovery process has finished. Maybe the solution is, knowing in advance the count of Decklink devices to expect, to check in small intervals of time until we get all cards?
Is there a way to know in advance how many IDeckLink instances we'll get by the callback?
Greetings,
Plamen