|
|
@@ -6,28 +6,21 @@ int CALLBACK Test_MediaCallBack(XSDK_HANDLE hMedia, const unsigned char *pData, |
|
|
|
if (EXSDK_DATA_FORMATE_FRAME == nDataType && nDataInfoSize > 0)
|
|
|
|
{
|
|
|
|
SXSDK_FRAME_INFO *pFrame = (SXSDK_FRAME_INFO *)pDataInfo;
|
|
|
|
//if(pFrame->nType==XSDK_FRAME_TYPE_VIDEO)
|
|
|
|
//{
|
|
|
|
// FILE *file = fopen("real.dat","ab+") ;
|
|
|
|
// if(file)
|
|
|
|
// {
|
|
|
|
// fwrite(pFrame->pContent,1,pFrame->nFrameLength,file);
|
|
|
|
// fclose(file);
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
if (pFrame->nType == XSDK_FRAME_TYPE_VIDEO)
|
|
|
|
int hour = pFrame->nHour ;
|
|
|
|
if(hour>=11 && hour<=22)
|
|
|
|
{
|
|
|
|
//int pos = getPos(hMedia);
|
|
|
|
string fmt("/extdisk/origin/%s/%s-%04d-%02d-%02d-%02d.dat");
|
|
|
|
char file_name[1024];
|
|
|
|
char * userData = (char *)pUserData;
|
|
|
|
snprintf(file_name,sizeof(file_name),fmt.c_str(),userData,userData,pFrame->nYear,pFrame->nMonth,pFrame->nDay,pFrame->nHour) ;
|
|
|
|
printf("file_path: %s ,%s \r\n", userData,file_name);
|
|
|
|
// ABFile("video_header.dat", pFrame->pHeader, pFrame->nLength);
|
|
|
|
ABFile(file_name, pFrame->pContent, pFrame->nFrameLength);
|
|
|
|
if (pFrame->nType == XSDK_FRAME_TYPE_VIDEO)
|
|
|
|
{
|
|
|
|
string fmt("/extdisk/origin/%s/%s-%04d-%02d-%02d-%02d.dat");
|
|
|
|
char file_name[1024];
|
|
|
|
char * userData = (char *)pUserData;
|
|
|
|
snprintf(file_name,sizeof(file_name),fmt.c_str(),userData,userData,pFrame->nYear,pFrame->nMonth,pFrame->nDay,pFrame->nHour) ;
|
|
|
|
printf("file_path: %s ,%s \r\n", userData,file_name);
|
|
|
|
// ABFile("video_header.dat", pFrame->pHeader, pFrame->nLength);
|
|
|
|
ABFile(file_name, pFrame->pContent, pFrame->nFrameLength);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("Media[hMedia:%ld][Len:%d][Type:%d/%d][%04d-%02d-%02d %02d:%02d:%02d-%03d]\r\n", hMedia, nDataLen, pFrame->nType, pFrame->nSubType, pFrame->nYear, pFrame->nMonth, pFrame->nDay, pFrame->nHour, pFrame->nMinute, pFrame->nSecond, (int)(pFrame->nTimeStamp % 1000));
|
|
|
|
printf("Media[hMedia:%ld][Len:%d][Type:%d/%d][%04d-%02d-%02d %02d:%02d:%02d-%03d]\r\n", hMedia, nDataLen, pFrame->nType, pFrame->nSubType, pFrame->nYear, pFrame->nMonth, pFrame->nDay, pFrame->nHour, pFrame->nMinute, pFrame->nSecond, (int)(pFrame->nTimeStamp % 1000));
|
|
|
|
}
|
|
|
|
else if (EXSDK_DATA_MEDIA_ON_PLAY_STATE == nDataType)
|
|
|
|
{
|
|
|
@@ -83,6 +76,7 @@ int TestMediaRealPlay() |
|
|
|
bPause = false;
|
|
|
|
nSpeed = 0;
|
|
|
|
printf("play hMedia:: %x\r\n", hDeviceArr[i]);
|
|
|
|
XSDK_DevSynTime(hDeviceArr[i], "", 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|