apShow.h
资源名称:Direct90.rar [点击查看]
上传用户:maxzhb99
上传日期:2013-03-13
资源大小:48k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // apShow.h: CapShow 僋儔僗偺僀儞僞乕僼僃僀僗
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_APSHOW_H__F85DAB28_1077_4F71_9CD4_C95229E2F852__INCLUDED_)
- #define AFX_APSHOW_H__F85DAB28_1077_4F71_9CD4_C95229E2F852__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "BlendText.h" // Added by ClassView
- #include <dshow.h>
- #include <atlbase.h>
- #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
- #define JIF(x) if (FAILED(hr=(x)))
- {Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("n "), hr); return hr;}
- #define LIF(x) if (FAILED(hr=(x)))
- {Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("n "), hr);}
- enum PLAYSTATE {Stopped, Paused, Running, Init};
- class CapShow
- {
- public:
- void UpdataStr(HWND ghApp,CString str);
- void SetFont(HWND hwnd);
- void OnPaint(HWND hwnd);
- CBlendText m_blender;
- CapShow();
- virtual ~CapShow();
- HRESULT InitializeWindowlessVMR(HWND ghApp);
- void ResizeVideoWindow(HWND ghApp);
- void CloseInterfaces();
- HRESULT CaptureVideo(HWND ghApp);
- HRESULT PlayWindow(HWND ghApp);
- private:
- // DirectShow interfaces
- IMediaSeeking * g_pMS;
- PLAYSTATE g_psCurrent;
- IGraphBuilder * g_pGB;
- IVideoWindow * g_pVW;
- IMediaControl * g_pMC;
- IMediaEventEx * g_pME;
- IGraphBuilder * g_pGraph;
- IVMRWindowlessControl * g_pWC;
- ICaptureGraphBuilder2 * g_pCapture;
- //font
- HFONT g_hFont;
- HRESULT FindCaptureDevice(IBaseFilter ** ppSrcFilter);
- HRESULT SetupVideoWindow(HWND ghApp);
- HRESULT GetInterfaces(HWND ghApp);
- };
- #endif // !defined(AFX_APSHOW_H__F85DAB28_1077_4F71_9CD4_C95229E2F852__INCLUDED_)