StatusMonitor for sub-device

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Bill Dunning

  • Posts: 7
  • Joined: Fri Feb 20, 2015 2:50 pm

StatusMonitor for sub-device

PostTue Nov 08, 2016 10:30 pm

StatusMonitor example app only gets status of first channel of a card. So, a Decklink Duo 2 for example will only show input 1 and not the other three sub-devices.

Does anyone have an implementation of the StatusMonitor that can take a param for the sub-device to query? Or is anyone interested in writing something to do that? Unfortunately, I'm only a Java developer and haven't looked at C++ in a very long time.
Offline

Bill Dunning

  • Posts: 7
  • Joined: Fri Feb 20, 2015 2:50 pm

Re: StatusMonitor for sub-device

PostFri Feb 10, 2017 5:53 pm

We wrote a customized version Status monitor that can address any input port. If interested, PM me and I'll get it to you.
Offline

Mustafa

  • Posts: 6
  • Joined: Fri Apr 06, 2018 4:47 pm
  • Real Name: Mustafa Al Ani

Re: StatusMonitor for sub-device

PostSat Aug 07, 2021 11:32 am

Bill Dunning wrote:We wrote a customized version Status monitor that can address any input port. If interested, PM me and I'll get it to you.


Hi Bill, can I get your customized version of the status monitor please?

Thank you
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 443
  • Joined: Mon Sep 04, 2017 4:05 am

Re: StatusMonitor for sub-device

PostTue Aug 10, 2021 7:03 am

Hi Mustafa,

The following function can be used to select an IDeckLink* device based on the display name:
Code: Select all
static IDeckLink* getDeckLinkWithDisplayName(std::string& displayName)
{
    IDeckLinkIterator*   deckLinkIterator = nullptr;
    IDeckLink*           deckLink = nullptr;

    result = GetDeckLinkIterator(&deckLinkIterator);
    if (result != S_OK)
    {
        fprintf(stderr, "A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.\n");
        return nullptr;
    }

    while (deckLinkIterator->Next(&deckLink) == S_OK)
    {
        STRINGOBJ deckLinkDisplayName;

        if (deckLink->GetDisplayName(&deckLinkDisplayName) == S_OK)
        {
            std::string deckLinkDisplayNameStr;
            StringToStdString(deckLinkDisplayName, deckLinkDisplayNameStr);
            STRINGFREE(deckLinkDisplayName);
           
            if (deckLinkDisplayNameStr == displayName)
                break;
        }

        deckLink->Release();
        deckLink = nullptr;
    }

    deckLinkIterator->Release();
    deckLinkIterator = nullptr;

    return deckLink;
}

You can then call from main() to return the required IDeckLink device directly from the display name;
Code: Select all
const std::string kTargetDeviceDisplayName = "DeckLink Duo (1)";
...
deckLink = getDeckLinkWithDisplayName(kTargetDeviceDisplayName);
if (deckLink == nullptr)
    goto bail;

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 8 guests