我有一份代码,是用object c写的里面有一段代码某实不知。请大神指点。
void fRealDataCallBack_V30(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, void* pUser)
{
PlayerDemoViewController *pDemo = (PlayerDemoViewController*)pUser;
[pDemo performSelectorOnMainThread:@selector(playerPlay)
withObject:nil
waitUntilDone:NO];//主要是这段的写法
}
//play,the function PlayM4_Play must be called in main thread
– (void) playerPlay
{
int nRet = 0;
nRet = PlayM4_Play(m_nPreviewPort, m_playView);
if (nRet != 1)
{
NSLog(@”PlayM4_Play fail”);
[self stopPlay];
return;
}
}
而我用c++,就不知道这段怎么个写法了。
MainWindow.h
class MainWindow : public QMainWindow
{
};
MainWindow.mm
void CALLBACK fRealDataCallBack_V30(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize,void *dwUser)
{
}
应该怎么添加代码?