视频捕捉

srgzf 2007-01-29 05:19:12
#if !defined(AFX_CAPTUREVIDEO_H__F5345AA4_A39F_4B07_B843_3D87C4287AA0__INCLUDED_)
#define AFX_CAPTUREVIDEO_H__F5345AA4_A39F_4B07_B843_3D87C4287AA0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// aptureVideo.h : header file
//
#include <streams.h> //DS接口、基类的定义
#include <atlbase.h>
/////////////////////////////////////////////////////////////////////////////
// CaptureVideo window

#include <windows.h>

#include <dshow.h>
#ifndef SAFE_RELEASE
#define SAFE_RELEASE( x ) \
if ( NULL != x ) \
{ \
 x->Release( ); \
 x = NULL; \
}
#endif

class CaptureVideo : public CWnd
{
// Construction
public:
CaptureVideo();

// Attributes
public:

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CaptureVideo)
//}}AFX_VIRTUAL

// Implementation
public:
HRESULT Init(int iDeviceID,HWND hWnd);
void GrabOneFrame(BOOL bGrab);
virtual ~CaptureVideo();

// Generated message map functions
protected:
HRESULT InitCaptureGraphBuilder();
HRESULT SetupVideoWindow();
void ResizeVideoWindow();
void FreeMediaType(AM_MEDIA_TYPE& mt);
//{{AFX_MSG(CaptureVideo)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
HWND m_hWnd;
IGraphBuilder *m_pGB;
ICaptureGraphBuilder2* m_pCapture;
IBaseFilter* m_pBF;
IMediaControl* m_pMC;
IVideoWindow* m_pVW;
CComPtr<ISampleGrabber> m_pGrabber;

};

CComPtr<ISampleGrabber> m_pGrabber;
我这儿定义有什么错吗?怎么解决呢,我用的是VC6.0+DirectShow9.0
编译器接示,
c:\ds\apturevideo.h(68) : error C2065: 'ISampleGrabber' : undeclared identifier
c:\ds\apturevideo.h(68) : error C2955: 'CComPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
...全文
230 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧