|
|
@@ -5,14 +5,20 @@ 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)
|
|
|
|
//{
|
|
|
|
// FILE *file = fopen("real.dat","ab+") ;
|
|
|
|
// if(file)
|
|
|
|
// {
|
|
|
|
// fwrite(pFrame->pContent,1,pFrame->nFrameLength,file);
|
|
|
|
// fclose(file);
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
if (pFrame->nType == XSDK_FRAME_TYPE_VIDEO)
|
|
|
|
{
|
|
|
|
ABFile("video_header.dat", pFrame->pHeader, pFrame->nLength);
|
|
|
|
ABFile("video_content.dat", 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));
|
|
|
|
}
|
|
|
|