#include "stdafx.h"
#include "play.h"
#include "playDoc.h"
#include "playView.h"
#include "MainFrm.h"
#include "av8api.h"
#include "Define.h"
#include "Dos.h"
#include "direct.h"
#include "Afxmt.h"
#include "Windowsx.h"
#include "StopModeDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define BLOCKNUM 50
#define BLOCKLEN 32768 //32k
#define FILE_CLOSE(x) if(x) { mmioClose(x, NULL);x=NULL;}
#define RELEASE_AV8BUFFER if(g_pBuffer) {g_pBuffer->Stop();delete g_pBuffer;g_pBuffer = NULL;}
#define RELEASE_CVIDEOPLAY if(pVideoPlay){pVideoPlay->StopPlay();delete pVideoPlay;pVideoPlay=NULL;}
extern CMenu PopMenu;
BOOL m_Capture=FALSE; //是否采集
CAV8Buffer *g_pBuffer = NULL;
HMMIO hmmioOutput; //采集文件的句斌
HMMIO hmmioSendOutput; //发送时保存文件的句斌
CString CapFileName; //采集文件名
BOOL m_FileSend=FALSE; //是否在发送文件数据
CEvent g_eventFileStopSend; //停止发送文件标志,自动设置
CEvent g_eventRealSend(FALSE,TRUE,NULL,NULL); //开始实时发送标志,手工设置
CEvent g_eventClearup; //完成清除工作,可以Destory窗口标志
HWND hWnd ;//发送数窗口的句斌
float m_size=0.00; //采集数据大小
CString SendFilePath="";
#define WM_CAPTURE_STOP WM_USER+1000 //采集大小到,停止采集
//发送组播数据
DWORD SendData(LPWSABUF stWSABuf)
{
CString msg;
DWORD cbRet;
cbRet = 0;
CPlayApp* pApp=(CPlayApp*)AfxGetApp();
//向指定地址发送数据
int status = WSASendTo (MultiSock, /* socket */
stWSABuf, /* output buffer structure */
1, /* buffer count */
&cbRet, /* number of bytes sent */
0, /* flags */
(struct sockaddr FAR *)&DestAddr,/* destination address */
sizeof(DestAddr), /* size of addr structure */
NULL, /* overlapped structure */
NULL); /* overlapped callback function */
if (status == SOCKET_ERROR)
{
AfxMessageBox("WSASendTo() Error");
return -1;
}
return cbRet;
}