-
Notifications
You must be signed in to change notification settings - Fork 0
/
SwitcherConnection.cpp
29 lines (25 loc) · 948 Bytes
/
SwitcherConnection.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "SwitcherConnection.h"
void simpleConsoleLog(const char* message) {
// Using C standard library for console output
printf("%s\n", message);
}
HRESULT ConnectToSwitcher(IBMDSwitcher*& switcher, BMDSwitcherConnectToFailure& connectToFailReason) {
HRESULT result;
// Create discovery instance
IBMDSwitcherDiscovery* discovery = CreateBMDSwitcherDiscoveryInstance();
if (!discovery) {
simpleConsoleLog("Failed to create IBMDSwitcherDiscovery!");
return E_FAIL;
}
// Use the discovery instance to connect to the switcher
//simpleConsoleLog("Connecting to switcher...");
result = discovery->ConnectTo(ip_address, &switcher, &connectToFailReason);
discovery->Release();
if (result != S_OK) {
//simpleConsoleLog("Failed to connect to switcher! :/");
return result;
} else {
//simpleConsoleLog("Connected to switcher! :)");
return S_OK;
}
}