Using Decklink 8K Pro as input and output at the same time

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

plamen.m.petrov

  • Posts: 6
  • Joined: Tue May 21, 2019 8:09 am
  • Real Name: Plamen Petrov

Using Decklink 8K Pro as input and output at the same time

PostTue May 21, 2019 8:20 am

Hello guys,

Is it possible to use the 8K Pro in this way? We have faced, that if output pin's StopScheduledPlayback() is not called, then the input pin's VideoInputFrameArrived() is not fired.

Thanks,
Offline

Cameron Nichols

Blackmagic Design

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

Re: Using Decklink 8K Pro as input and output at the same ti

PostWed May 22, 2019 3:20 am

Hi Plamen,

Which mode/profile have you configured the DeckLink 8K Pro? Simultaneous capture and playback is supported with the following profiles:
  • bmdProfileFourSubDevicesHalfDuplex
  • bmdProfileTwoSubDevicesFullDuplex
  • bmdProfileOneSubDevicesFullDuplex
But with profile bmdProfileOneSubDevicesHalfDuplex, only capture or playback is supported at one time.

Regards
Cameron
Offline

plamen.m.petrov

  • Posts: 6
  • Joined: Tue May 21, 2019 8:09 am
  • Real Name: Plamen Petrov

Re: Using Decklink 8K Pro as input and output at the same ti

PostFri May 24, 2019 6:17 am

Hello,

We're back to this problem.

So far we use IDeckLinkIterator to enumerate the the cards - thus we get a IDeckLink pointer for every installed device.

What we need now is to get a IDeckLink instance for every card pin and decide how to use it - as input or output. This is how the DeckLink sample SignalGenerator does it by the IDeckLinkDeviceNotificationCallback functionality.

Unfortunatelly the trick with the IDeckLinkDeviceNotificationCallback doesn't work for us, because we develop a server, which has no UI, and we can't get the DeckLinkDeviceArrived() callback called. What we suppose is, that the SignalGenerator gets the callback called in the idle time - we've put trace messages into the sample code and see, that DeckLinkDeviceArrived() could be fired even after OnInitDialog() ends.

Is there is a sample which could help us? Or, if it is possible, provide us a piece of pseudo code, showing how to retrieve the IDeckLink instances for the card pins separately.

Greetings,
Plamen
Offline

Cameron Nichols

Blackmagic Design

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

Re: Using Decklink 8K Pro as input and output at the same ti

PostThu May 30, 2019 3:59 am

Hi Plamen,

The IDeckLinkDeviceNotificationCallback interface can be used in console applications. The DeckLinkAPI allocates the thread for the DeviceArrived and DeviceRemoved callbacks.

Please have a look at the DeviceNotification sample in the Examples folder of the SDK package for a code sample.

Regards
Cameron
Offline

plamen.m.petrov

  • Posts: 6
  • Joined: Tue May 21, 2019 8:09 am
  • Real Name: Plamen Petrov

Re: Using Decklink 8K Pro as input and output at the same ti

PostThu May 30, 2019 10:04 am

Hello Cameron,

That's exactly what I mean!

This piece of code is from the DeviceNotification example:
Code: Select all
   
   // Set the device arrival / removal callback object
   if(deckLinkDiscovery->InstallDeviceNotifications(deckLinkDeviceDiscoveryCallback) != S_OK)
   {
      fprintf(stderr, "Could not install device discovery callback object\n");
      goto bail;   
   }
   
   printf("Waiting for DeckLink devices.... Press <RETURN> to exit\n");

   getchar();

   printf("Exiting.\n");

   // Uninstall device notifications
   if(deckLinkDiscovery->UninstallDeviceNotifications() != S_OK)
   {
      fprintf(stderr, "Could not uninstall device discovery callback objects\n");
      goto bail;   
   }


The getchar() is what we need to replace, so, the application could run as a service. Probable a small delay by Sleep(x) is the solution, but how long to wait? There is no way to know when the discovery process has finished. Maybe the solution is, knowing in advance the count of Decklink devices to expect, to check in small intervals of time until we get all cards?

Is there a way to know in advance how many IDeckLink instances we'll get by the callback?

Greetings,
Plamen
Offline

Cameron Nichols

Blackmagic Design

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

Re: Using Decklink 8K Pro as input and output at the same ti

PostThu May 30, 2019 11:59 pm

Hi Plamen,

Thanks for your clarification, from your description, IDeckLinkDeviceNotificationCallback is not the right approach for you and you should use IDeckLinkIterator interface.

For each DeckLink device found by the iterator, you should have the following checks:
Code: Select all
IDeckLinkProfileAttributes* deckLinkAttributes;
if (deckLink->QueryInterface(IID_IDeckLinkProfileAttributes, (void**)&m_deckLinkAttributes) != S_OK)
    goto bail;

// First check whether device is active for the device profile
int64_t intAttribute;
if ((deckLinkAttributes->GetInt(BMDDeckLinkDuplex, &intAttribute) != S_OK) ||
        ((BMDDuplexMode) intAttribute == bmdDuplexInactive))
    goto bail;

// Next determine whether device supports capture and/or playback
if (deckLinkAttributes->GetInt(BMDDeckLinkVideoIOSupport, &intAttribute) != S_OK)
    goto bail;

if ((BMDVideoIOSupport)intAttribute & bmdDeviceSupportsCapture)
{
    // Device supports capture
}

if ((BMDVideoIOSupport)intAttribute & bmdDeviceSupportsPlayback)
{
    // Device supports playback
}

bail:
if (deckLinkAttributes != nullptr)
    deckLinkAttributes->Release();
In the case of the DeckLink 8K Pro, you should find all devices can support capture and playback, but more importantly is the check for whether the device is active for the profile.

Kind Regards
Cameron Nichols

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests