decklink: Add feature to detect resolution/format

Closes jp9000/obs-studio#879
This commit is contained in:
mntone
2017-05-05 21:55:06 +09:00
committed by jp9000
parent 1e7e50114e
commit 41c2f5e13b
10 changed files with 220 additions and 18 deletions

View File

@@ -29,6 +29,21 @@ ULONG DeckLinkDevice::Release()
bool DeckLinkDevice::Init()
{
ComPtr<IDeckLinkAttributes> attributes;
const HRESULT result = device->QueryInterface(IID_IDeckLinkAttributes,
(void **)&attributes);
if (result == S_OK) {
decklink_bool_t detectable = false;
if (attributes->GetFlag(BMDDeckLinkSupportsInputFormatDetection,
&detectable) == S_OK && !!detectable) {
DeckLinkDeviceMode *mode =
new DeckLinkDeviceMode("Auto", MODE_ID_AUTO);
modes.push_back(mode);
modeIdMap[MODE_ID_AUTO] = mode;
}
}
ComPtr<IDeckLinkInput> input;
if (device->QueryInterface(IID_IDeckLinkInput, (void**)&input) != S_OK)
return false;
@@ -66,9 +81,6 @@ bool DeckLinkDevice::Init()
hash = displayName;
ComPtr<IDeckLinkAttributes> attributes;
const HRESULT result = device->QueryInterface(IID_IDeckLinkAttributes,
(void **)&attributes);
if (result != S_OK)
return true;