@@ -1,4 +1,5 @@
#include "XNetSDKTest.h"
#include <string>
int CALLBACK Test_MediaCallBack(XSDK_HANDLE hMedia, const unsigned char *pData, int nDataLen, int nDataType, void *pDataInfo, int nDataInfoSize, void *pUserData)
{
@@ -17,10 +18,13 @@ int CALLBACK Test_MediaCallBack(XSDK_HANDLE hMedia, const unsigned char *pData,
if (pFrame->nType == XSDK_FRAME_TYPE_VIDEO)
{
ABFile("video_header.dat", pFrame->pHeader, pFrame->nLength);
ABFile("video_content.dat", pFrame->pContent, pFrame->nFrameLength);
string fmt("/media-file/origin/%04d-%02d-%02d-%02d.dat");
char file_name[1024];
snprintf(file_name,sizeof(file_name),fmt.c_str(),pFrame->nYear,pFrame->nMonth,pFrame->nDay,pFrame->nHour) ;
// 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)
{