|
|
@@ -2,8 +2,9 @@ |
|
|
|
#include <string>
|
|
|
|
|
|
|
|
int getPos(XSDK_HANDLE hMedia) {
|
|
|
|
int size = sizeof(hDeviceArr) / sizeof(hDeviceArr);
|
|
|
|
int size = sizeof(hDeviceArr) / sizeof(hDeviceArr[0]);
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
printf("pos:: %d , hMedia:: %d,hMedia::%d\r\n",i,hDeviceArr[i],hMedia);
|
|
|
|
if (hDeviceArr[i] == hMedia) {
|
|
|
|
return i;
|
|
|
|
}
|
|
|
@@ -32,7 +33,7 @@ int CALLBACK Test_MediaCallBack(XSDK_HANDLE hMedia, const unsigned char *pData, |
|
|
|
string fmt("/media-file/origin/%s/%04d-%02d-%02d-%02d.dat");
|
|
|
|
char file_name[1024];
|
|
|
|
snprintf(file_name,sizeof(file_name),fmt.c_str(),DeviceIdArr[pos],pFrame->nYear,pFrame->nMonth,pFrame->nDay,pFrame->nHour) ;
|
|
|
|
printf("path: %s \r\n", file_name);
|
|
|
|
printf("path: %d ,%s \r\n", pos,file_name);
|
|
|
|
// ABFile("video_header.dat", pFrame->pHeader, pFrame->nLength);
|
|
|
|
ABFile(file_name, pFrame->pContent, pFrame->nFrameLength);
|
|
|
|
}
|
|
|
|