我正在尝试实现此代码,但我在Xcode中遇到了编译错误: “没有用于初始化'PlaybackDelegate'的匹配构造函数” “从不兼容的类型'PlaybackDelegate'”分配给'PlaybackDelegate *'
我从一个有效的示例中复制/粘贴代码。但是我无法弄清楚为什么它在我的项目中不起作用。
header file
class PlaybackDelegate : public IDeckLinkVideoOutputCallback
{
DecklinkDevice* pDecklinkDevice;
public:
PlaybackDelegate (DecklinkDevice* owner);
virtual HRESULT QueryInterface (REFIID iid, LPVOID *ppv) {return E_NOINTERFACE;}
virtual ULONG AddRef () {return 1;}
virtual ULONG Release () {return 1;}
virtual HRESULT ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result);
virtual HRESULT ScheduledPlaybackHasStopped ();
};
.mm文件
playerDelegate = new PlaybackDelegate(self, deckLinkOutput);
if (playerDelegate == NULL)
{
//NSLog(@"fout completed frame callback");
//fout
}
PlaybackDelegate::PlaybackDelegate (DecklinkDevice* owner)
{
pDecklinkDevice = owner;
}
HRESULT PlaybackDelegate::ScheduledFrameCompleted (IDeckLinkVideoFrame* completedFrame, BMDOutputFrameCompletionResult result)
{
NSLog(@"Frame Completed");
return S_OK;
}
HRESULT PlaybackDelegate::ScheduledPlaybackHasStopped ()
{
return S_OK;
}