ProtocalDef.h
上传用户:weiliangfb
上传日期:2007-01-23
资源大小:142k
文件大小:2k
- #ifndef _PROTOCALDEF_H_
- #define _PROTOCALDEF_H_
- //X:DXSDK = DXSDK8.1的安装路径
- //1.打开dshow工作空间(workspace) X:DXSDKsamplesMultimediaDirectShow
- //2.编译 baseclasses
- //3.编译 asynbase
- //4.设Options的Directories,Include Files中加入X:DXSDKINCLUDE
- //X:DXSDKSAMPLESMULTIMEDIADIRECTSHOWBASECLASSES
- //X:DXSDKSAMPLESMULTIMEDIADIRECTSHOWFILTERSASYNCINCLUDE
- //Library Files 中加入
- //X:DXSDKLIB
- //X:DXSDKSAMPLESMULTIMEDIADIRECTSHOWBASECLASSESDEBUG (STRMBASD.lib)
- //X:DXSDKSAMPLESMULTIMEDIADIRECTSHOWBASECLASSESRelease (STRMBASE.lib)
- //将上两个目录移至最顶
- //X:DXSDKsamplesMultimediaDirectShowFiltersAsyncBaseDebug (asynbase.lib)
- //X:DXSDKsamplesMultimediaDirectShowFiltersAsyncBaseRelease (asynbase.lib)//注意与上一条不能同时
- // {5CF7E6A8-44C5-4104-AF3D-84F6214A16A9}
- static const GUID WPGirFriendInstance = //DirectPlay用到的GUID
- { 0x5cf7e6a8, 0x44c5, 0x4104, { 0xaf, 0x3d, 0x84, 0xf6, 0x21, 0x4a, 0x16, 0xa9 } };
- typedef enum
- {
- mmsg_DataRequire = 1//需要数据
- ,mmsg_DataRespons = 2//数据响应
- ,mmsg_MediaInfoRequire = 3//媒体信息需求消息
- ,mmsg_MediaInfoRespons = 4//媒体信息响应消息
- }MMSGTYPE;
- typedef struct
- {
- MMSGTYPE mmsgType;
- DWORD dwBufferLen;
- #pragma warning( disable : 4200 )
- BYTE lpParamBuffer[];
- #pragma warning( default: 4200 )
- }MEDIAMSG,*PMEDIAMSG;
- //mmsgType ==mmsg_DataRequire 或 mmsg_DataRespons 时lpParamBuffer为如下结构
- typedef struct
- {
- LONGLONG llDataPos;
- DWORD dwDataSize;
- #pragma warning( disable : 4200 )
- BYTE lpDataBuff[];//只有当mmsg_DataRespons有效
- #pragma warning( default: 4200 )
- }MEDIADATAPARAM ,* PMEDIADATAPARAM;
- //当mmsgType ==mmsg_MediaInfoRequire时无参数
- //mmsgType ==mmsg_MediaInfoRespons时lpParamBuffer为 LONGLONG媒体数据的长度
- struct MediaMessageReqEvent//服务器上当需要网络数据时发生,可以主线程中实现
- {
- virtual HRESULT OnNeedData(LONGLONG llDataPos,DWORD dwSize,DWORD * pdwGotSize,LPBYTE lpBuffer)=0;
- virtual HRESULT OnNeedLength(LONGLONG * llMediaLenght)=0;
- };
- struct MediaMessageRespEvent//客户端当网络有数据时实现发生,可以主线程中实现
- {
- virtual HRESULT OnDataArrive(LONGLONG llDataPos,DWORD dwSize,LPBYTE lpBuffer) = 0;
- virtual HRESULT OnLenghtArrive(LONGLONG lMediaLen)=0;
- };
- struct PlayerEvent//播放器需要数据时发生,可以主线程中实现
- {
- virtual HRESULT OnPlayerNeedData(LONGLONG llDataPos,DWORD dwSize,DWORD * pdwGotSize,LPBYTE lpBuffer)=0;
-
- };
- #endif