Click here to Skip to main content
15,900,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 1:26
yaminisridaran12-Jul-07 1:26 
GeneralRe: How I can use DirectShow Pin
Hamid_RT12-Jul-07 1:34
Hamid_RT12-Jul-07 1:34 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 0:53
yaminisridaran12-Jul-07 0:53 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 1:25
yaminisridaran12-Jul-07 1:25 
GeneralRe: How I can use DirectShow Pin
Hamid_RT12-Jul-07 1:37
Hamid_RT12-Jul-07 1:37 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 1:39
yaminisridaran12-Jul-07 1:39 
GeneralRe: How I can use DirectShow Pin
Hamid_RT12-Jul-07 1:57
Hamid_RT12-Jul-07 1:57 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 2:00
yaminisridaran12-Jul-07 2:00 
#if !defined(AFX_CAPTUREVIDEO_H__057736B5_B61B_4850_8D82_E181E0B25B61__INCLUDED_)
#define AFX_CAPTUREVIDEO_H__057736B5_B61B_4850_8D82_E181E0B25B61__INCLUDED_

//--------------------------------------------------------------------------//
// Copyright DILLIP KUMAR KARA 2004
// You may do whatever you want with this code, as long as you include this
// copyright notice in your implementation files.
// Comments and bug Reports: codeguru_bank@yahoo.com
//--------------------------------------------------------------------------//

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CaptureVideo.h : header file
#include <atlbase.h>
#include <windows.h>
#include <dshow.h>

//
enum PLAYSTATE {STOPPED, PAUSED, RUNNING, INIT};

#define WM_GRAPHNOTIFY WM_USER+1

#ifndef SAFE_RELEASE

#define SAFE_RELEASE( x ) \
if ( NULL != x ) \
{ \
x->Release( ); \
x = NULL; \
}

#endif

/////////////////////////////////////////////////////////////////////////////
// CCaptureVideo window

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

// Attributes
public:
void StopCapture();
void StartTVTuner();
void StartWebcam();
void StartCompositeVideo();
void StartSVideo();
void RemoveGraphFromRot(DWORD pdwRegister);
void UnIntializeVideo();
HRESULT InitializeVideo(HWND hWnd);
// Operations
public:

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

// Implementation
public:
void ResizeVideoWindow();
virtual ~CCaptureVideo();

// Generated message map functions
protected:
//{{AFX_MSG(CCaptureVideo)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
afx_msg HRESULT OnGraphNotify(WPARAM wp , LPARAM lp);
DECLARE_MESSAGE_MAP()
protected:
void ResizeVideoWindowMoniker();
void CloseInterfacesMoniker();
//----------------For Webcam-----------------//
void RemoveGraphFromRotMoniker(DWORD pdwRegister);
HRESULT AddGraphToRotMoniker(IUnknown *pUnkGraph, DWORD *pdwRegister);
HRESULT SetupVideoWindowMoniker();
HRESULT HandleGraphEventMoniker();
HRESULT FindCaptureDeviceMoniker(IMoniker** ppMoniker);
HRESULT AddCaptureMonikerToGraph(IMoniker* pMoniker);
HRESULT CaptureVideoByMoniker();
HRESULT GetInterfacesMoniker();

//------------------Video--------------------//
void DisplayMesg(TCHAR* szFormat, ...);
LRESULT ClearInterfaces(WPARAM wp, LPARAM lp);
void CloseInterfaces();
HRESULT AddGraphToRot(IUnknown* pUnkGraph, DWORD* pdwRegister);

HRESULT CaptureVideo();
HRESULT HandleGraphEvent();
HRESULT ChangePreviewState(int nShow);
HRESULT SetupVideoWindow();
HRESULT FindCaptureDevice(IBaseFilter** ppSrcFilter);
HRESULT GetInterfaces();

private:
UINT chSVideo, chCompVideo , chWebCam , chFullScreen , chAlwaysOnTop ;

int nVSourceCount;
int nAnalogCount;

CBrush m_emptyBrush;
DWORD m_dwGraphRegister;
BOOL bDevCheck;
HWND m_hApp;
//------------------Video--------------------//
IVideoWindow* m_pVW ;
IMediaControl* m_pMC ;
IMediaEventEx* m_pME ;
IGraphBuilder* m_pGraph ;
ICaptureGraphBuilder2* m_pCapture ;
IBaseFilter* pSrcF;
PLAYSTATE m_psCurrent;

//----------------For Webcam-----------------//
IVideoWindow* m_pVWMoniker ;
IMediaControl* m_pMCMoniker ;
IMediaEventEx* m_pMEMoniker ;
ICaptureGraphBuilder2* m_pCaptureMoniker ;
IFilterGraph2* m_pFilterGraph ;// IFilterGraph2 provides AddSourceFileForMoniker()

BOOL bVideo , bWebCam;
int vType;

};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CAPTUREVIDEO_H__057736B5_B61B_4850_8D82_E181E0B25B61__INCLUDED_)


I have copied my header file code but I am getting error only for ICaptureGraphBuilder2


S.Yamini
GeneralRe: How I can use DirectShow Pin
Hamid_RT12-Jul-07 2:06
Hamid_RT12-Jul-07 2:06 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 2:19
yaminisridaran12-Jul-07 2:19 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 2:24
yaminisridaran12-Jul-07 2:24 
GeneralRe: How I can use DirectShow Pin
Hamid_RT13-Jul-07 1:44
Hamid_RT13-Jul-07 1:44 
AnswerRe: How I can use DirectShow Pin
#realJSOP12-Jul-07 1:35
professional#realJSOP12-Jul-07 1:35 
AnswerRe: How I can use DirectShow Pin
Mark Salsbery12-Jul-07 5:31
Mark Salsbery12-Jul-07 5:31 
GeneralRe: How I can use DirectShow Pin
yaminisridaran12-Jul-07 18:42
yaminisridaran12-Jul-07 18:42 
GeneralRe: How I can use DirectShow Pin
Hamid_RT13-Jul-07 1:43
Hamid_RT13-Jul-07 1:43 
GeneralRe: How I can use DirectShow Pin
Mark Salsbery13-Jul-07 17:14
Mark Salsbery13-Jul-07 17:14 
QuestionChange BAR Color of CProgressCtrl Pin
CodeMak11-Jul-07 23:47
CodeMak11-Jul-07 23:47 
AnswerRe: Change BAR Color of CProgressCtrl Pin
Nibu babu thomas11-Jul-07 23:53
Nibu babu thomas11-Jul-07 23:53 
GeneralRe: Change BAR Color of CProgressCtrl Pin
CodeMak11-Jul-07 23:56
CodeMak11-Jul-07 23:56 
GeneralRe: Change BAR Color of CProgressCtrl Pin
Nibu babu thomas12-Jul-07 0:11
Nibu babu thomas12-Jul-07 0:11 
GeneralRe: Change BAR Color of CProgressCtrl Pin
CodeMak12-Jul-07 0:34
CodeMak12-Jul-07 0:34 
AnswerRe: Change BAR Color of CProgressCtrl Pin
David Crow12-Jul-07 2:33
David Crow12-Jul-07 2:33 
QuestionEnumerating all paths on a drive? Pin
Lord Kixdemp11-Jul-07 23:41
Lord Kixdemp11-Jul-07 23:41 
AnswerRe: Enumerating all paths on a drive? Pin
Nibu babu thomas11-Jul-07 23:55
Nibu babu thomas11-Jul-07 23:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.