1 Star 1 Fork 0

xu / MFCCapture

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CaptureVideo.h 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
xu 提交于 2016-12-23 21:16 . 2016122202
/////////////////////////////////////////////////////////////////////
#if !defined(AFX_CAPTUREVIDEO_H__F5345AA4_A39F_4B07_B843_3D87C4287AA0__INCLUDED_)
#define AFX_CAPTUREVIDEO_H__F5345AA4_A39F_4B07_B843_3D87C4287AA0__INCLUDED_
/////////////////////////////////////////////////////////////////////
// CaptureVideo.h : header file
/////////////////////////////////////////////////////////////////////
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <atlbase.h>
#include <windows.h>
#include <dshow.h>
#include <qedit.h>
#include <initguid.h>
#include <uuids.h>
#include <streambuf>
#include <Wincrypt.h>
#pragma comment(lib,"crypt32")
#include "base64.h"
using namespace gloox;
#ifndef srelease
#define srelease(x) \
if ( NULL != x ) \
{ \
x->Release( ); \
x = NULL; \
}
#endif
class CSampleGrabberCB;
class CCaptureVideo :public CWnd
{
friend class CSampleGrabberCB;
public:
void GrabOneFrame(BOOL bGrab);
HRESULT Init(int iDeviceID, HWND hWnd);
int EnumDevices(HWND hList);
CCaptureVideo();
virtual ~CCaptureVideo();
private:
HWND m_hWnd;
IGraphBuilder *m_pGB;
ICaptureGraphBuilder2* m_pCapture;
IBaseFilter* m_pBF;
IMediaControl* m_pMC;
IVideoWindow* m_pVW;
CComPtr <ISampleGrabber> m_pGrabber;
protected:
void FreeMediaType(AM_MEDIA_TYPE& mt);
bool BindFilter(int deviceId, IBaseFilter **pFilter);
void ResizeVideoWindow();
HRESULT SetupVideoWindow();
HRESULT InitCaptureGraphBuilder();
public:
// ֹͣƵ
void StopVideo();
// õֵ
char* GetPhoto();
HWND form_HWND;
};
#endif // !defined(AFX_CAPTUREVIDEO_H__F5345AA4_A39F_4B07_B843_3D87C4287AA0__INCLUDED_)
1
https://gitee.com/xtvj/MFCCapture.git
git@gitee.com:xtvj/MFCCapture.git
xtvj
MFCCapture
MFCCapture
master

搜索帮助