我正在尝试开始使用 Balckagic SDK。而且我很难获得设备“DeckLink SDI”的框架
void get_video(IDeckLink* decklink){
HRESULT result;
IDeckLinkInput* decklinkinput = NULL;
BSTR name = NULL;
IDeckLinkDisplayModeIterator* displayModeIterator = NULL;
IDeckLinkInputCallback* theCallback = NULL;
IDeckLinkVideoInputFrame* decklinkInputVideoframe =NULL;
IDeckLinkDisplayMode* displayMode = NULL;
IDeckLinkVideoInputFrame* inputVideoFrame;
IDeckLinkAudioInputPacket* inputAudioPacket;
IBMDStreamingDeviceInput* capture;
IDeckLinkVideoFrame* deckLinkVideoFrame = NULL;
unsigned long avaibleFrames = NULL;
result = decklink->QueryInterface(IID_IDeckLinkInput,(void**) &decklinkinput);
result = decklinkinput->GetDisplayModeIterator(&displayModeIterator);
result = decklinkinput->SetCallback(theCallback);
result = decklinkinput->EnableVideoInput(BMDDisplayMode::bmdModeHD1080i50,BMDPixelFormat::bmdFormat8BitYUV,bmdVideoInputEnableFormatDetection);
result = decklinkinput->DisableAudioInput();
result = decklinkinput->StartStreams();
decklinkinput->GetAvailableVideoFrameCount(&avaibleFrames);
cout<<"Number of avaible frames " << avaibleFrames<<endl;
result = decklinkinput->SetCallback(theCallback);
theCallback->VideoInputFrameArrived(inputVideoFrame, inputAudioPacket);
result = decklinkinput->StopStreams();
}
而且我没有语法错误,我得到的只是帧数为0。而且我不知道如何保存帧。我很感激任何帮助。