回调返回的handle是空指针 IMV_INVALID_HANDLE
//这里的pUser是0x00000 使用全局的handle代替
void onGetFrame(IMV_Frame* pFrame, void* pUser)
{
if (pFrame == NULL)
{
printf("pFrame is NULL\n");
return;
}
idx += 1;
if (idx==1) {
start = chrono::steady_clock::now();
}
//
//pFrame->pData
saveImageToBmp(pFrame);
if (idx==20) {
idx = 0;
printf("Get frame blockId = %llu\n", pFrame->frameInfo.blockId);
auto end = chrono::steady_clock::now();
cout << "Elapsed time in milliseconds: "
<< chrono::duration_cast<chrono::milliseconds>(end - start).count()
<< " ms" << endl;
}
//printf("Get frame blockId = %llu\n", pFrame->frameInfo.blockId);
return;
}