Example #1
0
HI_S32 NETSDK_APICALL OnStreamCallback(HI_U32 u32Handle, /* 句柄 */
                                HI_U32 u32DataType,     /* 数据类型,视频或音频数据或音视频复合数据 */
                                HI_U8*  pu8Buffer,      /* 数据包含帧头 */
                                HI_U32 u32Length,      /* 数据长度 */
                                HI_VOID* pUserData    /* 用户数据*/
                                )
{
    HI_S_AVFrame* pstruAV = HI_NULL;
	HI_S_SysHeader* pstruSys = HI_NULL;
	
	if (u32DataType == HI_NET_DEV_AV_DATA)
	{
		pstruAV = (HI_S_AVFrame*)pu8Buffer;

		if (pstruAV->u32AVFrameFlag == HI_NET_DEV_VIDEO_FRAME_FLAG)
		{
			if(fPusherHandle == 0 ) return 0;

			if(pstruAV->u32AVFrameLen > 0)
			{
				unsigned char* pbuf = (unsigned char*)(pu8Buffer+sizeof(HI_S_AVFrame));

				EASY_AV_Frame  avFrame;
				memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
				avFrame.u32AVFrameLen = pstruAV->u32AVFrameLen;
				avFrame.pBuffer = (unsigned char*)pbuf;
				avFrame.u32VFrameType = (pstruAV->u32VFrameType==HI_NET_DEV_VIDEO_FRAME_I)?EASY_SDK_VIDEO_FRAME_I:EASY_SDK_VIDEO_FRAME_P;
				avFrame.u32AVFrameFlag = EASY_SDK_VIDEO_FRAME_FLAG;
				EasyPusher_PushFrame(fPusherHandle, &avFrame);
			}	
		}
		else
		if (pstruAV->u32AVFrameFlag == HI_NET_DEV_AUDIO_FRAME_FLAG)
		{
			if(fPusherHandle == 0 ) return 0;

			if(pstruAV->u32AVFrameLen > 0)
			{
				unsigned char* pbuf = (unsigned char*)(pu8Buffer+sizeof(HI_S_AVFrame));

				EASY_AV_Frame  avFrame;
				memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
				avFrame.u32AVFrameLen = pstruAV->u32AVFrameLen-4;//去掉厂家自定义的4字节头
				avFrame.pBuffer = (unsigned char*)pbuf+4;
				avFrame.u32AVFrameFlag = EASY_SDK_AUDIO_FRAME_FLAG;
				EasyPusher_PushFrame(fPusherHandle, &avFrame);
			}			
		}
	}
	else
	if (u32DataType == HI_NET_DEV_SYS_DATA)
	{
		pstruSys = (HI_S_SysHeader*)pu8Buffer;
		printf("Video W:%u H:%u Audio: %u \n", pstruSys->struVHeader.u32Width, pstruSys->struVHeader.u32Height, pstruSys->struAHeader.u32Format);
	}
	return HI_SUCCESS;
}
Example #2
0
/* EasyRTSPClient Callback */
int Easy_APICALL __RTSPSourceCallBack( int _chid, int *_chPtr, int _mediatype, char *pbuf, RTSP_FRAME_INFO *frameinfo)
{
	if (_mediatype == EASY_SDK_VIDEO_FRAME_FLAG)
	{
		if(fPusherHandle == 0 ) return 0;

		if(frameinfo && frameinfo->length)
		{
			EASY_AV_Frame  avFrame;
			memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
			avFrame.u32AVFrameLen = frameinfo->length;
			avFrame.pBuffer = (unsigned char*)pbuf;
			avFrame.u32VFrameType = frameinfo->type;
			avFrame.u32AVFrameFlag = EASY_SDK_VIDEO_FRAME_FLAG;
			avFrame.u32TimestampSec = frameinfo->timestamp_sec;
			avFrame.u32TimestampUsec = frameinfo->timestamp_usec;
			EasyPusher_PushFrame(fPusherHandle, &avFrame);
		}	
	}

	if (_mediatype == EASY_SDK_AUDIO_FRAME_FLAG)
	{
		if(fPusherHandle == 0 ) return 0;

		if(frameinfo && frameinfo->length)
		{
			EASY_AV_Frame  avFrame;
			memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
			avFrame.u32AVFrameLen = frameinfo->length;
			avFrame.pBuffer = (unsigned char*)pbuf;
			avFrame.u32VFrameType = frameinfo->type;
			avFrame.u32AVFrameFlag = EASY_SDK_AUDIO_FRAME_FLAG;
			avFrame.u32TimestampSec = frameinfo->timestamp_sec;
			avFrame.u32TimestampUsec = frameinfo->timestamp_usec;
			EasyPusher_PushFrame(fPusherHandle, &avFrame);
		}	
	}

	if (_mediatype == EASY_SDK_MEDIA_INFO_FLAG)
	{
		if((pbuf != NULL) && (fPusherHandle == NULL))
		{
			EASY_MEDIA_INFO_T mediainfo;
			memset(&mediainfo, 0x00, sizeof(EASY_MEDIA_INFO_T));
			memcpy(&mediainfo, pbuf, sizeof(EASY_MEDIA_INFO_T));

			fPusherHandle = EasyPusher_Create();
			EasyPusher_SetEventCallback(fPusherHandle, __EasyPusher_Callback, 0, NULL);
			EasyPusher_StartStream(fPusherHandle, ConfigIP, atoi(ConfigPort), ConfigName, "admin", "admin", &mediainfo, 1024, false);//1M»º³åÇø
			printf("*** live streaming url:rtsp://%s:%d/%s ***\n", ConfigIP, atoi(ConfigPort), ConfigName);
		}
	}
	return 0;
}
Example #3
0
/* EasyRTSPClient数据回调 */
int CALLBACK __RTSPSourceCallBack( int _chid, int *_chPtr, int _mediatype, char *pbuf, RTSP_FRAME_INFO *frameinfo)
{
	if (_mediatype == EASY_SDK_VIDEO_FRAME_FLAG)
	{
		if(fPusherHandle == 0 ) return 0;

		if(frameinfo && frameinfo->length)
		{
			EASY_AV_Frame  avFrame;
			memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
			avFrame.u32AVFrameLen = frameinfo->length;
			avFrame.pBuffer = (unsigned char*)pbuf;
			avFrame.u32VFrameType = frameinfo->type;
			avFrame.u32AVFrameFlag = EASY_SDK_VIDEO_FRAME_FLAG;
			EasyPusher_PushFrame(fPusherHandle, &avFrame);
		}	
	}

	if (_mediatype == EASY_SDK_AUDIO_FRAME_FLAG)
	{
		if(fPusherHandle == 0 ) return 0;

		if(frameinfo && frameinfo->length)
		{
			EASY_AV_Frame  avFrame;
			memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
			avFrame.u32AVFrameLen = frameinfo->length;
			avFrame.pBuffer = (unsigned char*)pbuf;
			avFrame.u32VFrameType = frameinfo->type;
			avFrame.u32AVFrameFlag = EASY_SDK_AUDIO_FRAME_FLAG;
			EasyPusher_PushFrame(fPusherHandle, &avFrame);
		}	
	}

	if (_mediatype == EASY_SDK_MEDIA_INFO_FLAG)
	{
		if((pbuf != NULL) && (fPusherHandle == NULL))
		{
			EASY_MEDIA_INFO_T mediainfo;
			memset(&mediainfo, 0x00, sizeof(EASY_MEDIA_INFO_T));
			memcpy(&mediainfo, pbuf, sizeof(EASY_MEDIA_INFO_T));

			fPusherHandle = EasyPusher_Create();
			EasyPusher_SetEventCallback(fPusherHandle, __EasyPusher_Callback, 0, NULL);

			EasyPusher_StartStream(fPusherHandle, SHOST, SPORT, SNAME, "admin", "admin", &mediainfo, 1024);//1M缓冲区
			printf("*** live streaming url:rtsp://%s:%d/%s ***\n", SHOST, SPORT, SNAME);
		}
	}
	return 0;
}
Example #4
0
HI_S32 NETSDK_APICALL OnStreamCallback(HI_U32 u32Handle, /* 句柄 */
                                HI_U32 u32DataType,     /* 数据类型,视频或音频数据或音视频复合数据 */
                                HI_U8*  pu8Buffer,      /* 数据包含帧头 */
                                HI_U32 u32Length,      /* 数据长度 */
                                HI_VOID* pUserData    /* 用户数据*/
                                )
{

	HI_S_AVFrame* pstruAV = HI_NULL;
	HI_S_SysHeader* pstruSys = HI_NULL;
	

	if (u32DataType == HI_NET_DEV_AV_DATA)
	{
		pstruAV = (HI_S_AVFrame*)pu8Buffer;

		if (pstruAV->u32AVFrameFlag == HI_NET_DEV_VIDEO_FRAME_FLAG)
		{
			if(pusherHandle == 0 )
				return 0;

			if(pstruAV->u32AVFrameLen > 5)
			{
				unsigned char* pbuf = (unsigned char*)(pu8Buffer+sizeof(HI_S_AVFrame));
				unsigned char naltype = ( (unsigned char)pbuf[4] & 0x1F);

				if ( (unsigned char)pbuf[0]== 0x00 && 
						(unsigned char)pbuf[1]== 0x00 && 
						(unsigned char)pbuf[2] == 0x00 &&
						(unsigned char)pbuf[3] == 0x01 &&
						(naltype==0x07 || naltype==0x01) )
				{
					EASY_AV_Frame  avFrame;

					naltype = (unsigned char)pbuf[4] & 0x1F;
					memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
					avFrame.u32AVFrameLen = pstruAV->u32AVFrameLen;
					avFrame.pBuffer = (unsigned char*)pbuf;
					avFrame.u32VFrameType = (naltype==0x07)?EASY_SDK_VIDEO_FRAME_I:EASY_SDK_VIDEO_FRAME_P;
					EasyPusher_PushFrame(pusherHandle, &avFrame);
				}
			}	
		}
		else
		if (pstruAV->u32AVFrameFlag == HI_NET_DEV_AUDIO_FRAME_FLAG)
		{
			//printf("Audio %u PTS: %u \n", pstruAV->u32AVFrameLen, pstruAV->u32AVFramePTS);
			//SaveRecordFile("Video.hx", pu8Buffer, u32Length);			
		}
	}
	else
	if (u32DataType == HI_NET_DEV_SYS_DATA)
	{
		pstruSys = (HI_S_SysHeader*)pu8Buffer;
		printf("Video W:%u H:%u Audio: %u \n", pstruSys->struVHeader.u32Width, pstruSys->struVHeader.u32Height, pstruSys->struAHeader.u32Format);
	} 

	return HI_SUCCESS;
}
QTSS_Error EasyCameraSource::PushFrame(unsigned char* frame, int len)
{	
	if(fPusherHandle == NULL) return QTSS_Unimplemented;

	HI_S_AVFrame* pstruAV = (HI_S_AVFrame*)frame;

	EASY_AV_Frame  avFrame;
	memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));

	if (pstruAV->u32AVFrameFlag == HI_NET_DEV_VIDEO_FRAME_FLAG)
	{
		if(pstruAV->u32AVFrameLen > 0)
		{
			unsigned char* pbuf = (unsigned char*)frame+sizeof(HI_S_AVFrame);

			EASY_AV_Frame  avFrame;
			memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
			avFrame.u32AVFrameLen = pstruAV->u32AVFrameLen;
			avFrame.pBuffer = (unsigned char*)pbuf;
			avFrame.u32VFrameType = (pstruAV->u32VFrameType==HI_NET_DEV_VIDEO_FRAME_I)?EASY_SDK_VIDEO_FRAME_I:EASY_SDK_VIDEO_FRAME_P;
			avFrame.u32AVFrameFlag = EASY_SDK_VIDEO_FRAME_FLAG;
			avFrame.u32TimestampSec = pstruAV->u32AVFramePTS/1000;
			avFrame.u32TimestampUsec = (pstruAV->u32AVFramePTS%1000)*1000;
			EasyPusher_PushFrame(fPusherHandle, &avFrame);
		}	
	}
	else if (pstruAV->u32AVFrameFlag == HI_NET_DEV_AUDIO_FRAME_FLAG)
	{
		if(pstruAV->u32AVFrameLen > 0)
		{
			unsigned char* pbuf = (unsigned char*)frame+sizeof(HI_S_AVFrame);

			EASY_AV_Frame  avFrame;
			memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
			avFrame.u32AVFrameLen = pstruAV->u32AVFrameLen - 4;//去掉厂家自定义的4字节头
			avFrame.pBuffer = (unsigned char*)pbuf+4;
			avFrame.u32AVFrameFlag = EASY_SDK_AUDIO_FRAME_FLAG;
			avFrame.u32TimestampSec = pstruAV->u32AVFramePTS/1000;
			avFrame.u32TimestampUsec = (pstruAV->u32AVFramePTS%1000)*1000;
			EasyPusher_PushFrame(fPusherHandle, &avFrame);
		}			
	}
	return Easy_NoErr;
}
Example #6
0
int CSourceManager::SourceManager(int _channelId, int *_channelPtr, int _frameType, char *pBuf, RTSP_FRAME_INFO* _frameInfo)
{
	EASY_LOCAL_SOURCE_T *pLocalSource = (EASY_LOCAL_SOURCE_T *)_channelPtr;
	if (NULL == pLocalSource)		return 0;

	EASY_AV_Frame	frame;
	memset(&frame, 0x00, sizeof(EASY_AV_Frame));
	if (NULL != _frameInfo)
	{
		frame.pBuffer = (Easy_U8*)pBuf;
		frame.u32AVFrameLen = _frameInfo->length;
		frame.u32TimestampSec = _frameInfo->timestamp_sec;
		frame.u32TimestampUsec = _frameInfo->timestamp_usec;
		frame.u32VFrameType   = _frameInfo->type;
	}
	if (_frameType == EASY_SDK_VIDEO_RAW_RGB)
	{
		UpdateLocalVideo((unsigned char*)pBuf, _frameInfo->length, _frameInfo->width, _frameInfo->height);
	}
	else if (_frameType == EASY_SDK_VIDEO_FRAME_FLAG)
	{
		BOOL bIsPushing = IsInPushing();
		if(bIsPushing )
		{
			frame.u32AVFrameFlag = EASY_SDK_VIDEO_FRAME_FLAG;
			EasyPusher_PushFrame(m_sPushInfo.pusherHandle, &frame );

			//推送RTMP
			if (m_pEasyrtmp)
			{
				bool bKeyFrame = (_frameInfo->type == EASY_SDK_VIDEO_FRAME_I) ?  true : false;
				long nTimeStamp = clock();
				m_pEasyrtmp->WriteVideoH264((unsigned char*)pBuf, _frameInfo->length, nTimeStamp, bKeyFrame);
			}
		}

		bool bKeyFrame  = (_frameInfo->type == 1) ? true : false;
		if (bKeyFrame)
		{
			if (m_bWriteMp4)
			{
				if (!m_bRecording)
				{
					char sFileName[MAX_PATH];
					sprintf(sFileName, "./ThisIsAMP4File_%d.mp4", _channelId );
					CreateMP4Writer(sFileName, _frameInfo->width, _frameInfo->height, _frameInfo->fps, _frameInfo->sample_rate,  _frameInfo->channels, 16, ZOUTFILE_FLAG_FULL, m_bUseGpac);
				}
			}
		}
		if (m_bRecording)
		{
			WriteMP4VideoFrame((unsigned char*)pBuf,  _frameInfo->length, bKeyFrame, clock(), _frameInfo->width, _frameInfo->height);
		}
	}
	else if (_frameType == EASY_SDK_AUDIO_FRAME_FLAG)
	{
		if(IsInPushing())
		{
			frame.u32AVFrameFlag = EASY_SDK_AUDIO_FRAME_FLAG;
			EasyPusher_PushFrame(m_sPushInfo.pusherHandle, &frame );
			//推送RTMP
			if (m_pEasyrtmp)
			{
				long nTimeStamp = clock();
				m_pEasyrtmp->WriteAudioAdst((unsigned char*)pBuf, _frameInfo->length,nTimeStamp);
			}
		}
		if (m_bRecording)
		{
			//如果AAC编码音频带有adst头则需要去掉头7个字节的头
			WriteMP4AudioFrame((unsigned char*)pBuf+7,  _frameInfo->length-7, clock());
		}
	}
	else if (_frameType == EASY_SDK_MEDIA_INFO_FLAG)
	{
		memcpy_s(&m_mediainfo, sizeof(m_mediainfo), pBuf, sizeof(EASY_MEDIA_INFO_T));
		if (IsInPushing())
		{
			//停止推流
			StopPush();
			//开始推流
			StartPush(m_sPushInfo.pushServerAddr, m_sPushInfo.pushServerPort, m_sPushInfo.sdpName);

		}
// 		pLocalSource->pusherHandle = EasyPusher_Create();
// 		if (NULL != pLocalSource->pusherHandle)
// 		{
// 			EasyPusher_StartStream(pLocalSource->pusherHandle, pLocalSource->pushServerAddr, pLocalSource->pushServerPort, pLocalSource->sdpName+1, "", "", (EASY_MEDIA_INFO_T*)pBuf, 1024, 0);
// 		}
	}
	return 1;
}
Example #7
0
int main()
{
    char szIP[16] = {0};
    Easy_Pusher_Handle pusherId = 0;
    EASY_MEDIA_INFO_T   mediainfo;

    int buf_size = 1024*512;
    char *pbuf = (char *) malloc(buf_size);
    FILE *fES = NULL;
	int position = 0;
	int iFrameNo = 0;
#ifdef _WIN32
    WSADATA wsaData;
    WSAStartup(MAKEWORD(2,2), &wsaData);
#endif
    memset(&mediainfo, 0x00, sizeof(EASY_MEDIA_INFO_T));
    mediainfo.u32VideoCodec =   0x1C;

    fES = fopen("./EasyPusher.264", "rb");
    if (NULL == fES)        return 0;

    pusherId = EasyPusher_Create();

    EasyPusher_SetEventCallback(pusherId, __EasyPusher_Callback, 0, NULL);

    EasyPusher_StartStream(pusherId, "115.29.139.20", 554, "720p.sdp", "admin", "admin", &mediainfo, 2048);
	printf("*** live streaming url:rtsp://115.29.139.20/720p.sdp ***\n");

	while (1)
	{
		int nReadBytes = fread(pbuf+position, 1, 1, fES);
		if (nReadBytes < 1)
		{
			if (feof(fES))
			{
				position = 0;
				fseek(fES, 0, SEEK_SET);
				continue;
			}
			break;
		}

		position ++;

		if (position > 5)
		{
			unsigned char naltype = ( (unsigned char)pbuf[position-1] & 0x1F);

			if ( (unsigned char)pbuf[position-5]== 0x00 && 
					(unsigned char)pbuf[position-4]== 0x00 && 
					(unsigned char)pbuf[position-3] == 0x00 &&
					(unsigned char)pbuf[position-2] == 0x01 &&
					//(((unsigned char)pbuf[position-1] == 0x61) ||
					//((unsigned char)pbuf[position-1] == 0x67) ) )
					(naltype==0x07||naltype==0x01) )
			{
				int framesize = position - 5;
                EASY_AV_Frame   avFrame;

				naltype = (unsigned char)pbuf[4] & 0x1F;

                memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
                avFrame.u32AVFrameLen   =   framesize;
                avFrame.pBuffer = (unsigned char*)pbuf;
				avFrame.u32VFrameType = (naltype==0x07)?EASY_SDK_VIDEO_FRAME_I:EASY_SDK_VIDEO_FRAME_P;
                EasyPusher_PushFrame(pusherId, &avFrame);
#ifndef _WIN32
                usleep(30*1000);
#else
                Sleep(30);
#endif
				memmove(pbuf, pbuf+position-5, 5);
				position = 5;

				iFrameNo ++;

                //if (iFrameNo > 100000) break;
                //break;
			}
		}
	}

    _TRACE("Press Enter exit...\n");
    getchar();
    EasyPusher_StopStream(pusherId);
    EasyPusher_Release(pusherId);

#ifdef _WIN32
    WSACleanup();
#endif
    return 0;
}
Example #8
0
//实时音视频数据管理
// nDevId: 设备编号:音频 == -1,视频 == 0---N
// realDataType: 实时音视频数据类型;视频 == 1,音频 == 2
int CMaster::RealDataManager(int nDevId, unsigned char *pBuffer, int nBufSize, 
							 RealDataStreamType realDataType, /*RealDataStreamInfo*/void* realDataInfo)
{
	if (!pBuffer || nBufSize <= 0 )
	{
		return -1;
	}
	//获取实时数据流回调信息
	RealDataStreamInfo* callbackParam = (RealDataStreamInfo*)realDataInfo;
	// 	//录制设备型号
	// 	RecordDevFlag nDeviceType = (RecordDevFlag)(nDevId + 1);
	// 
	// 	BYTE* pWriteBuffer = NULL;//new BYTE[nBufSize];
	// 	BOOL bUseMutiThread = m_pEncConfigInfo->bUseMutiThread;

	//实时音视频数据处理
	switch (realDataType)
	{
	case REALDATA_VIDEO:
		{
			if (m_bStartPusher)
			{
				int nVideoWidth = 640;
				int	nVideoHeight = 480;
				int nWidhtHeightBuf=(nVideoWidth*nVideoHeight*3)>>1;
				BYTE* pDataBuffer=new unsigned char[nWidhtHeightBuf];
				YUY2toI420(nVideoWidth, nVideoHeight, pBuffer, pDataBuffer);
				
				//编码实现
				byte*pdata=NULL;
				int datasize=0;
				bool keyframe=false;
				pdata=m_H264EncoderManager.Encoder(0, pDataBuffer,
					nWidhtHeightBuf,datasize,keyframe);

				if (pDataBuffer)
				{
					delete pDataBuffer;
					pDataBuffer = NULL;
				}
				if (datasize>0&&m_bStartPusher)
				{
					memset(m_pFrameBuf, 0, 1024*512);
					EASY_AV_Frame   avFrame;
					bool bKeyF = keyframe;
					byte btHeader[4];
					btHeader[0] = 0x00;
					btHeader[1] = 0x00;
					btHeader[2] = 0x00;
					btHeader[3] = 0x01;
					memset(&avFrame, 0x00, sizeof(EASY_AV_Frame));
					if (bKeyF)
					{
						avFrame.u32AVFrameLen  =  datasize + 8 + m_spslen+m_ppslen;
						memcpy(m_pFrameBuf, btHeader, 4);
						memcpy(m_pFrameBuf+4, m_sps, m_spslen);
						memcpy(m_pFrameBuf+4+m_spslen, btHeader, 4);
						memcpy(m_pFrameBuf+4+m_spslen+4, m_pps, m_ppslen);
						memcpy(m_pFrameBuf+4+m_spslen+4+m_ppslen, btHeader, 4);
						memcpy(m_pFrameBuf+4+m_spslen+4+m_ppslen+4, pdata+4, datasize-4);
					} 
					else
					{
						avFrame.u32AVFrameLen = datasize;
						memcpy(m_pFrameBuf, btHeader, 4);
						memcpy(m_pFrameBuf+4, pdata+4, datasize-4);
					}
					avFrame.u32AVFrameFlag = EASY_SDK_VIDEO_FRAME_FLAG;
					avFrame.pBuffer = (unsigned char*)m_pFrameBuf;
					avFrame.u32VFrameType = (bKeyF)?EASY_SDK_VIDEO_FRAME_I:EASY_SDK_VIDEO_FRAME_P;
					long nTimeStamp = clock();
					avFrame.u32TimestampSec = nTimeStamp/1000;
					avFrame.u32TimestampUsec = (nTimeStamp%1000)*1000;

					EasyPusher_PushFrame(m_pusherId, &avFrame);
				}
			}

// 			if (m_pRecordModel->nRecFlag==RECFLAG_RUNNING&&(m_pmp4file[0]||m_pMP4Package[0]))//&&(m_nCountQueueVideoFrames<m_nMaxQueueVideoFrames))
// 			{	
// 				FrameInfo *pTmpinfo=NULL;
// 				pTmpinfo=new FrameInfo;
// 
// 				int nWidhtHeightBuf=(nVideoWidth*nVideoHeight*3)>>1;
// 				pTmpinfo->pDataBuffer=new unsigned char[nWidhtHeightBuf];
// 				YUY2toI420(nVideoWidth,nVideoHeight,pDataWriteWaterMask,pTmpinfo->pDataBuffer);
// 				pTmpinfo->nBufSize=nWidhtHeightBuf;
// 				//	memcpy(pTmpinfo->pDataBuffer,m_pRealWriteBuffer,nBufSize);			
// 				pTmpinfo->bIsVideo=TRUE;
// 				pTmpinfo->nID=0;	
// 
// 				EnterCriticalSection(&m_cs);					
// 				pTmpinfo->nTimestamp=clock()-m_unVPauseTime;
// 				m_queueframe.push(pTmpinfo);
// 				m_nCountQueueVideoFrames++;
// 				LeaveCriticalSection(&m_cs);
// 			}					

		}//case REALDATA_VIDEO
		break;//REALDATA_VIDEO

	case REALDATA_AUDIO://PCM等原始音频数据
		{
			if (m_bStartPusher)
			{
				byte*pdata=NULL;
				int datasize=0;
				pdata=m_AACEncoderManager.Encoder(pBuffer,nBufSize,datasize);	
				if(datasize>0&&m_bStartPusher)
				{

					EASY_AV_Frame   AudioFrame;
					AudioFrame.u32AVFrameFlag = EASY_SDK_AUDIO_FRAME_FLAG;
					AudioFrame.pBuffer = (unsigned char*)pdata;
					AudioFrame.u32VFrameType = FALSE;//(bKeyF)?EASY_SDK_VIDEO_FRAME_I:EASY_SDK_VIDEO_FRAME_P;
					AudioFrame.u32AVFrameLen = datasize;
					long nTimeStamp = clock();
					AudioFrame.u32TimestampSec = nTimeStamp/1000;
					AudioFrame.u32TimestampUsec = (nTimeStamp%1000)*1000;

					EasyPusher_PushFrame(m_pusherId, &AudioFrame);

// 					if(m_pRecordModel->nRecFlag==RECFLAG_RUNNING&&m_bIsAudioWriteInFile==TRUE)
// 					{
// 						FrameInfo *pTmpinfo;
// 						pTmpinfo=new FrameInfo;
// 						pTmpinfo->pDataBuffer=new unsigned char[datasize];
// 						memcpy(pTmpinfo->pDataBuffer,pdata,datasize);					
// 						pTmpinfo->nBufSize=datasize;
// 						pTmpinfo->bIsVideo=FALSE;
// 						pTmpinfo->nID=0;	
// 
// 						EnterCriticalSection(&m_cs);
// 						pTmpinfo->nTimestamp=clock()-m_unAPauseTime;
// 						m_queueframe.push(pTmpinfo);
// 						LeaveCriticalSection(&m_cs);
// 					}

				}
			}	
		}
		break;

	default:
		break;
	}

	return TRUE;//音视频文件录制
}