VideoUSB.h
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- #if !defined(AFX_VIDEOUSB_H__6F061C73_9101_4E4F_8166_60487BAA5B7A__INCLUDED_)
- #define AFX_VIDEOUSB_H__6F061C73_9101_4E4F_8166_60487BAA5B7A__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // VideoUSB.h : header file
- //
- #pragma warning(disable:4786)
- #include "vfw.h"
- #include "AVI.h"
- #include "VideoCodecVideoCodec.h"
- #include "DirectDrawDirectDraw.h"
- /////////////////////////////////////////////////////////////////////////////
- // CVideoUSB window
- class CVideoUSB : public CWnd
- {
- public:
- CVideoUSB( );
- virtual ~CVideoUSB( );
- //初始化摄像头
- bool Init( HWND hWnd , void ( * OnCapture )( void * pContext , char * buffer , int size , bool m_bHeader ) , void * pContext );
- //获得视频头信息
- bool GetHeader( char ** header , int * size );
- //开始预览
- bool StartPreview( int fps = 15 );
- //停止预览
- void StopPreview( void );
- //开始捕捉
- bool StartCapture( void );
- //停止捕捉
- void StopCapture( void );
- //初始化显示
- virtual bool InitDraw( HWND hWnd , char * buffer , int size );
- //显示单帧图像
- virtual bool Draw( char * buffer , int size );
- //释放显示
- virtual void ReleaseDraw( void );
- protected:
- //本地显示
- static LRESULT CALLBACK OnVideo( HWND hWnd , VIDEOHDR * lpVHdr );
- //网络发送
- static UINT OnSend( void * wParam );
- //{{AFX_VIRTUAL(CVideoUSB)
- //}}AFX_VIRTUAL
- //{{AFX_MSG(CVideoUSB)
- afx_msg void OnClose();
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg UINT OnNcHitTest(CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP( )
- private:
- BITMAPINFOHEADER header;
- CVideoCodec codec;
- char * send_buffer;
- void ( * OnCapture )( void * pContext , char * buffer , int size , bool m_bHeader ) ;
- void * pContext;
- CDirectDraw ddraw;
- bool m_bPreview;
- bool m_bCapture;
- CAVI avi;
- bool m_bRecord;
- CString recordDir;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_VIDEOUSB_H__6F061C73_9101_4E4F_8166_60487BAA5B7A__INCLUDED_)