ScheduledFrameCompleted is never triggered.

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

Dario Maljur

  • Posts: 6
  • Joined: Thu Jun 18, 2020 7:01 am
  • Real Name: Dario Maljur

ScheduledFrameCompleted is never triggered.

PostThu Jul 02, 2020 2:55 pm

Hi,

I'm trying to use ScheduleVideoFrame to output the video frames to Shogun device, but my callback never seem to trigger.

I've found the devices and I can successfully output frames using DisplayVideoFrameSync but not with ScheduleVideoFrame.

I'm initiating playback like this.


Code: Select all
   
result = selectedDevice_->GetDeviceConfiguration()->SetFlag(bmdDeckLinkConfig444SDIVideoOutput, output444);

   // If a device without SDI output is used, then SetFlags will return E_NOTIMPL
   if ((result != S_OK) && (result != E_NOTIMPL))
   {
      printf("Error while setting GetDeviceConfiguration()->SetFlag()\n");
      return;
   }

        // I need to convert my frames to YUV
   result = CoCreateInstance(CLSID_CDeckLinkVideoConversion, NULL, CLSCTX_ALL, IID_IDeckLinkVideoConversion, (void**)&frameConverter);
   if (result != S_OK)
   {
      printf("Unable to create video converter\n");
      return;
   }

   // set video output
   deckLinkOutput = selectedDevice_->GetDeviceOutput();

   BMDDisplayMode displayMode = bmdModeHD1080p50;

   result = deckLinkOutput->EnableVideoOutput(displayMode, bmdVideoOutputFlagDefault);
   if (result != S_OK)
   {
      printf("Error while Enabling video output\n");
      return;
   }

   result = deckLinkOutput->SetScheduledFrameCompletionCallback(selectedDevice_);
   if (result != S_OK)
   {
      printf("Unable to SetScheduledFrameCompletionCallback\n");
      return;
   }


And as I can figure out from the examples, whenever I call ScheduleVideoFrame, I should receive a frame finished callback where I schedule another frame.

So my general idea was to create a simple structure from my main event loop with struct of IDeckLinkVideoFrame, displayTime, duration and timeScale and push it to a small frameQueue that callback function would pull frames when ready. But I can't seem to trigger it.

I seems that I can also preroll around a second of frames without the queue, by just calling ScheduleVideoFrame() but then my frame converter starts failing and I stop receiving frames altogether (?)

Anyone can help me with this?
Offline

Cameron Nichols

Blackmagic Design

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

Re: ScheduledFrameCompleted is never triggered.

PostFri Jul 03, 2020 2:53 am

Hi Dario,

How are you implementing IDeckLinkOutput::StartScheduledPlayback? You won't get callbacks associated with the IDeckLinkVideoOutputCallback interface until you have called this.

Please review InputLoopThrough sample (from Desktop Video SDK 11.5 or later) for an example how to queue IDeckLinkVideoFrame for output with stream times.

Regards
Cameron
Offline

Dario Maljur

  • Posts: 6
  • Joined: Thu Jun 18, 2020 7:01 am
  • Real Name: Dario Maljur

Re: ScheduledFrameCompleted is never triggered.

PostFri Jul 03, 2020 7:12 am

I'm following the SignalGenerator example. But since I'm not currently working with audio I sort of missed the StartScheduledPlayback which was called in the RenderAudioSamples in the example.

I've added it to my InitPlayback function and now it works.

Thanks Cameron.

Offtopic.

Is there somewhere I can report bugs in SDK?

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 14 guests