视频捕捉
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'