BOOL CPlayerHik::SavePic(char * pBuf, long nSize, long nWidth, long nHeight, long nType) { if (m_iType == 0) { return PlayM4_ConvertToBmpFile((char*)pBuf, nSize, nWidth, nHeight, nType, m_saveFile); } else { PlayM4_ConvertToJpegFile((char*)(char*)pBuf, nSize, nWidth, nHeight, nType, m_saveFile); } }
/********************************************************* Function: DisplayCBFun Desc: the call back function to snatch the bmp pictrue Input: nPort,port;pBuf,pic buffer;nSize,pic size;nWidth,pic width;nHeight,pic height;nType,type; Output: none Return: none **********************************************************/ void CALLBACK RemoteDisplayCBFun(long nPort,char * pBuf,long nSize,long nWidth,long nHeight,long nStamp,long nType,long nReserved) { int screenNo = DlgMain->DlgScreen.m_video.m_haikang.GetPortWndindex(nPort); if(screenNo<0) return; if( ! DlgMain->DlgScreen.m_video.m_haikang.CapturePath[screenNo].IsEmpty()) { PlayM4_ConvertToJpegFile(pBuf, nSize, nWidth, nHeight, nType, DlgMain->DlgScreen.m_video.m_haikang.CapturePath[screenNo].GetBuffer(0)); DlgMain->DlgScreen.m_video.m_haikang.CapturePath[screenNo]=""; } //在这做识别 //车牌识别 #if OPEN_CARDETECT_CODE //启用识别 if(DlgMain->DlgScreen.m_videoInfo[screenNo].enableDetect) { //拷贝数值 DlgMain->DlgScreen.CarDetect[screenNo].m_playhandle=screenNo; DlgMain->DlgScreen.CarDetect[screenNo].alarmflag= DlgMain->DlgScreen.m_videoInfo[screenNo].enableAlarm; DlgMain->DlgScreen.CarDetect[screenNo].camid= DlgMain->DlgScreen.m_videoInfo[screenNo].camID; strcpy(DlgMain->DlgScreen.CarDetect[screenNo].cam_name, DlgMain->DlgScreen.m_videoInfo[screenNo].name.GetBuffer(0)); strcpy(DlgMain->DlgScreen.CarDetect[screenNo].l_ipaddr, DlgMain->DlgScreen.m_videoInfo[screenNo].ip.GetBuffer(0)); //颜色LC_VIDEO_FORMAT_YV12 与颜色LC_VIDEO_FORMAT_I420 相反 DlgMain->DlgScreen.CarDetect[screenNo].Start(LC_VIDEO_FORMAT_YV12,\ (unsigned char *)pBuf,nWidth,nHeight,nSize); DlgMain->DlgScreen.CarDetect[screenNo].Result(); } #endif }
/********************************************************* Function: DisplayCBFun Desc: the call back function to snatch the bmp pictrue Input: nPort,port;pBuf,pic buffer;nSize,pic size;nWidth,pic width;nHeight,pic height;nType,type; Output: none Return: none **********************************************************/ void CALLBACK RemoteDisplayCBFun(long nPort,char * pBuf,long nSize,long nWidth,long nHeight,long nStamp,long nType,long nReserved) { int screenNo = DlgMain->DlgTabVideo.DlgScreen.m_video.m_haikang.GetPortWndindex(nPort); if(screenNo<0) return; if( ! DlgMain->DlgTabVideo.DlgScreen.m_video.m_haikang.CapturePath[screenNo].IsEmpty()) { PlayM4_ConvertToJpegFile(pBuf, nSize, nWidth, nHeight, nType, DlgMain->DlgTabVideo.DlgScreen.m_video.m_haikang.CapturePath[screenNo].GetBuffer(0)); DlgMain->DlgTabVideo.DlgScreen.m_video.m_haikang.CapturePath[screenNo]=""; } //在这做识别 //车牌识别 #if OPEN_LC_CARDETECT_CODE //启用识别 if(DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].enableCarDetect) { //拷贝数值 DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].m_playhandle=screenNo; DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].camid= DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].camID; strcpy(DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].cam_name, DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].name.GetBuffer(0)); strcpy(DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].l_ipaddr, DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].ip.GetBuffer(0)); DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].cam_Direction= DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].Direction; //颜色LC_VIDEO_FORMAT_YV12 与颜色LC_VIDEO_FORMAT_I420 相反 DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].Start(LC_VIDEO_FORMAT_YV12,\ (unsigned char *)pBuf,nWidth,nHeight,nSize); DlgMain->DlgTabVideo.DlgScreen.CarDetect[screenNo].Result(); } #endif //车牌识别 #if OPEN_HYZJ_CARDETECT_CODE //启用识别 if(DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].enableCarDetect) { //拷贝数值 DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].m_playhandle=screenNo; DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].camid= DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].camID; strcpy(DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].cam_name, DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].name.GetBuffer(0)); strcpy(DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].l_ipaddr, DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].ip.GetBuffer(0)); DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].cam_Direction= DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].Direction; //颜色LC_VIDEO_FORMAT_YV12 与颜色LC_VIDEO_FORMAT_I420 相反 DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].Start(ImageFormatYV12,\ (unsigned char *)pBuf,nWidth,nHeight,nSize); DlgMain->DlgTabVideo.DlgScreen.HYZJCarDetect[screenNo].Result(); } #endif #if OPEN_FACEDETECT_CODE //启用识别 if(DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].enableFaceDetect) { DlgMain->DlgTabVideo.DlgScreen.FaceAdd[screenNo]++; if(0==DlgMain->DlgTabVideo.DlgScreen.FaceAdd[screenNo]%FACE_JUMP_NUM) { DlgMain->DlgTabVideo.DlgScreen.FaceAdd[screenNo]=0; long long ftime; CTime nowtime=CTime::GetTickCount(); ftime=nowtime.GetTime(); // YUV2RGB((unsigned char *)pBuf, DlgMain->DlgTabVideo.DlgScreen.RGBdata[screenNo], nWidth,nHeight); //拷贝数值 DlgMain->DlgTabVideo.DlgScreen.FaceDetect[screenNo].m_playhandle=screenNo; DlgMain->DlgTabVideo.DlgScreen.FaceDetect[screenNo].camid= DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].camID; strcpy(DlgMain->DlgTabVideo.DlgScreen.FaceDetect[screenNo].cam_name, DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].name.GetBuffer(0)); strcpy(DlgMain->DlgTabVideo.DlgScreen.FaceDetect[screenNo].l_ipaddr, DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].ip.GetBuffer(0)); DlgMain->DlgTabVideo.DlgScreen.FaceDetect[screenNo].cam_Direction= DlgMain->DlgTabVideo.DlgScreen.m_videoInfo[screenNo].Direction; DlgMain->DlgTabVideo.DlgScreen.FaceDetect[screenNo].Start(VIDEO_FORMAT_YV12, (unsigned char *)pBuf,nWidth,nHeight,nWidth*3,nSize); //ZOGDramBMP("d:\\112212121.bmp",DlgMain->DlgTabVideo.DlgScreen.RGBdata[screenNo], nWidth,nHeight); } } #endif }