Unable to set input connection via C++
Posted: Fri Aug 04, 2017 10:15 pm
The essential problem is that it seems I cannot programmatically set the input connection.
* Decklink Mini recorder
* Ubuntu 16.04 X64
This:
doesn't seem to work. I can change the input via the "Video Setup" app, and it sticks.
Doesn't matter if I'm trying to change it from SDI-->HDMI or HDMI-->SDI.
Below is the constructor for a subclass of IDeckLinkInputCallback. The "CaptureDelegate" parameter it takes is for a higher-level API.
* Decklink Mini recorder
* Ubuntu 16.04 X64
This:
- Code: Select all
result = deckLinkConfiguration->SetInt(bmdDeckLinkConfigVideoInputConnection, bmdVideoConnectionHDMI);
// (full code below)
doesn't seem to work. I can change the input via the "Video Setup" app, and it sticks.
Doesn't matter if I'm trying to change it from SDI-->HDMI or HDMI-->SDI.
Below is the constructor for a subclass of IDeckLinkInputCallback. The "CaptureDelegate" parameter it takes is for a higher-level API.
- Code: Select all
Capture::Capture(CaptureDelegate& delegate) : m_delegate(delegate) {
HRESULT result;
const char* errstr = NULL;
IDeckLinkConfiguration* deckLinkConfiguration;
IDeckLinkIterator* it;
it = CreateDeckLinkIteratorInstance();
if (it == NULL) {
errstr = "Unable to load DeckLink drivers";
goto cleanup;
}
it->Next(&m_deckLink);
if (m_deckLink == NULL) {
errstr = "Capture device not found";
goto cleanup;
}
result = m_deckLink->QueryInterface(IID_IDeckLinkInput, (void**)&m_deckLinkInput);
if (result != S_OK) {
errstr = "Unable to obtain input object";
goto cleanup;
}
result = m_deckLink->QueryInterface(IID_IDeckLinkConfiguration, (void**)&deckLinkConfiguration);
if (result != S_OK) {
errstr = "Unable to get DeckLinkConfiguration object";
}
//result = deckLinkConfiguration->SetInt(bmdDeckLinkConfigVideoInputConnection, bmdVideoConnectionHDMI);
result = deckLinkConfiguration->SetInt(bmdDeckLinkConfigVideoInputConnection, bmdVideoConnectionSDI);
if (result != S_OK) {
errstr = "Unable to select HDMI as input";
goto cleanup;
}
cleanup:
if (it != NULL)
it->Release();
if (deckLinkConfiguration != NULL)
deckLinkConfiguration->Release();
if (errstr != NULL)
throw CaptureException(errstr);
m_callback = new CaptureCallback(m_deckLinkInput, m_delegate);
m_deckLinkInput->SetCallback(m_callback);
m_deckLinkInput->EnableVideoInput(bmdModeHD1080p30, bmdFormat8BitYUV, bmdVideoInputEnableFormatDetection);
printf("everything ok\n");
}