- Posts: 7
- Joined: Mon Jan 25, 2021 7:25 am
- Real Name: Keith Wiley
I see the high-level documentation of CreateVideoFrame and ConvertFrame in the manual, but I can't find an example in the provided sample code of using these interfaces and functions. I'm using the Capture sample as a starting point and I'm trying to extend it to convert the incoming YUV frame to an RGB frame, but I don't know how to use it. As far as I can see, the functions are only provided through interfaces. Are we supposed to define new classes to perform straightforward conversions of this sort? Here's my muddled attempt so far:
Obviously that doesn't work because it erroneously calls directly into the virtual interface:
What is the correct approach here?
Thanks.
- Code: Select all
IDeckLinkVideoConversion *videoConverter = CreateVideoConversionInstance();
void* rgbFrame = IDeckLinkOutput::CreateVideoFrame(
videoFrame->GetWidth(), videoFrame->GetHeight(), videoFrame->GetRowBytes(),
bmdFormat8BitARGB, bmdFrameFlagDefault, NULL);
HRESULT convertResult = videoConverter->ConvertFrame(videoFrame, (IDeckLinkVideoFrame*)rgbFrame);
Obviously that doesn't work because it erroneously calls directly into the virtual interface:
- Code: Select all
Capture.cpp: In member function ‘virtual HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*)’:
Capture.cpp:133:126: error: cannot call member function ‘virtual HRESULT IDeckLinkOutput::CreateVideoFrame(int32_t, int32_t, int32_t, BMDPixelFormat, BMDFrameFlags, IDeckLinkMutableVideoFrame**)’ without object
videoFrame->GetWidth(), videoFrame->GetHeight(), videoFrame->GetRowBytes(), bmdFormat8BitARGB, bmdFrameFlagDefault, NULL);
What is the correct approach here?
Thanks.