VideoPlay.h
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:2k
- // VideoPlay.h: interface for the CVideoPlay class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_VIDEOPLAY_H__761FDC3A_3404_11D4_883E_0000210A0111__INCLUDED_)
- #define AFX_VIDEOPLAY_H__761FDC3A_3404_11D4_883E_0000210A0111__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <streams.h> //要访问DirectShow的接口必须包含该头文件
- #include <mmsystem.h>
- #define HELPER_RELEASE(x) if (x) {x->Release(); x = NULL; }
- #define CHECK_ERROR(x, idFailMsg) if (FAILED(hr = (x))) { if (idFailMsg) MessageBox(m_hwnd,idFailMsg,"Error",MB_OK); return;}
- #define WM_PLAYOVER WM_USER+300
- class CVideoPlay
- {
- public:
- CVideoPlay();
- CVideoPlay(HWND hwnd);
- virtual ~CVideoPlay();
- void FindDevice(CStringList &DevName); //搜索视频设备
- void RealPlay(); //实时图像的播放
- void PlayFromFile(CString szFile); //视频文件的播放
- void PausePlay(); //暂停播放
- void ResumePlay(); //继续播放
- void StopPlay(); //停止播放
- void DisplayVideoWin(); //显示视频播放窗口
- int PlayOver();
- HWND m_hwnd; //视频播放窗口的父窗口句柄
- REFTIME tCurrent; //视频文件的当前位置时间
- REFTIME tLength; //视频文件的总时间长度
- REFTIME tRemain; //视频文件的剩余时间
- IGraphBuilder *pigb; //视频文件过滤器图表生成器接口指针
- ICaptureGraphBuilder *CapPigb; //捕捉过滤器图表生成器接口指针
- IGraphBuilder *CappFg; //实时图像过滤器图表生成器接口指针
- IMediaControl *pimc; //数据流的控制接口指针
- IMediaEventEx *pimex; //过滤器图表的事件接口指针
- IVideoWindow *pivw; //视频播放窗口接口指针
- IAMDroppedFrames *pDF; //捕捉过滤器性能查询接口指针
- IMediaPosition * pmp; //数据流的位置查询接口指针
- IBaseFilter *pVCap; //过滤器接口指针
- };
- #endif // !defined(AFX_VIDEOPLAY_H__761FDC3A_3404_11D4_883E_0000210A0111__INCLUDED_)