- Posts: 6
- Joined: Thu Jun 18, 2020 7:01 am
- Real Name: Dario Maljur
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.
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?
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?