|
while (1) {
memset(szData, 0, sizeof(szData));
int iReadSize = fread(szData, sizeof(char), iDataLen, fd);
// memset(szData, 0, sizeof(szData));
BVCSP_Packet packet;
memset(&packet, 0, sizeof(packet));
packet.iDataType = BVCSP_DATA_TYPE_TSP;
packet.iDataSize = iReadSize;
packet.bKeyFrame = 1;
// fread(szData, 1, iReadSize, fd);
packet.pData = szData;
BVCU_Result result = BVCSP_Dialog_Write(getMGBvcsp()->g_hDialog, &packet);
LOGD("BVCSP_Dialog_Write iReadSize=%d,result=%d", iReadSize,result);
usleep(1000);
while(BVCU_Result_FAILED(result)){
sleep(1);
result=BVCSP_Dialog_Write(getMGBvcsp()->g_hDialog, &packet);
}
if (iReadSize < iDataLen) {
break;
}
}
上面是上传文件的代码,上传视频文件比较大,有时候调用BVCSP_Dialog_Write 会返回-65533(分配内存失败) |
|