- Posts: 4
- Joined: Fri May 20, 2022 9:56 am
- Real Name: Nikita Dedov
The preferred method of getting the reference locked status is with the IDeckLinkStatus interface by querying the status item bmdDeckLinkStatusReferenceSignalLocked [1][2] with the following example code:
- Code: Select all
HRESULT hr = S_OK;
IDeckLink* deckLink = nullptr;
bool referenceLockedStatus; // Use BOOL for Windows
// ... Initialize deckLink.
hr = deckLink->QueryInterface(IID_IDeckLinkStatus, (void**) &deckLinkStatus);
if (hr != S_OK)
{
// Error
return;
}
hr = deckLinkStatus->GetFlag(bmdDeckLinkStatusReferenceSignalLocked, &referenceLockedStatus);
if (hr != S_OK)
{
// Error
return;
}
- Code: Select all
int64_t statusInt;
hr = deckLinkStatus->GetInt(bmdDeckLinkStatusReferenceSignalMode, &statusInt);
if (hr == S_OK)
{
BMDDisplayMode referenceVideoMode = (BMDDisplayMode)statusInt;
}
- Generate a class that implements the IDeckLinkNotificationCallback interface [3].
- In your implementation of IDeckLinkNotificationCallback::Notify, check for topic == bmdStatusChanged and param1 == bmdDeckLinkStatusReferenceSignalLocked. In this case use a conditional variable or similar to notify your application that this value has changed [4].
- Get an IDeckLinkNotification object by calling IDeckLink::QueryInterface with IID_IDeckLinkNotification [5].
- Register your IDeckLinkNotificationCallback with IDeckLinkNotification::Subscribe, with topic = bmdStatusChanged.
- Remember to unsubscribe your IDeckLinkNotificationCallback with DeckLinkNotification::Unsubscribe when you have completed with notifications, to prevent memory leak.
Regards
Cameron
References (DeckLink SDK Manual):
[1] 2.5.42 IDeckLinkStatus Interface
[2] 3.59 DeckLink Status ID
[3] 2.5.34 IDeckLinkNotificationCallback Interface
[4] 3.43 DeckLink Device Notification
[5] 2.5.33 IDeckLinkNotification Interface