?? videoplay.h
字號:
// 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_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -