Click here to Skip to main content
15,895,084 members
Articles / Desktop Programming / MFC

Preview and Record with MPEG2 Capture device

Rate me:
Please Sign up or sign in to vote.
4.39/5 (16 votes)
11 Jun 20048 min read 220.1K   9.7K   94  
This article shows how to work with MPEG2 capture devices such as Preview, Record. Works with all video renderers. Grab picture and configure MPEG2 Demux.
// MPEG2CaptureAppDlg.h : header file
//

#if !defined(AFX_MPEG2CAPTUREAPPDLG_H__9968A6CB_9442_4EC1_A8E3_51A50DE0E1BE__INCLUDED_)
#define AFX_MPEG2CAPTUREAPPDLG_H__9968A6CB_9442_4EC1_A8E3_51A50DE0E1BE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include  "HyperLink.h"
#include  "ActiveWindowDlg.h"
#include  "MPEG2Handler.h"

#define DIRECTX_8_1      0 
#define DIRECTX_9_VMR9   1
#define DIRECTX_9_VMR    2 


class CMPEG2Handler; 

/////////////////////////////////////////////////////////////////////////////
// CMPEG2CaptureAppDlg dialog

class CHyperLink; 

class CMPEG2CaptureAppDlg : public CDialog
{
// Construction
public:
	CMPEG2CaptureAppDlg(CWnd* pParent = NULL);	// standard constructor
	~CMPEG2CaptureAppDlg(); 


	CActiveWindowDlg  *pWindow; 

	int GetFileName(LPTSTR szName);  

	void dsDelete(); 
	int  Start(); 

	int dx_window; 
 
	CMPEG2Handler  *MPEG2Handler; 


// Dialog Data
	//{{AFX_DATA(CMPEG2CaptureAppDlg)
	enum { IDD = IDD_MPEG2CAPTUREAPP_DIALOG };
	CEdit	m_filename;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMPEG2CaptureAppDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMPEG2CaptureAppDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnPreview();
	afx_msg void OnRecord();
	afx_msg void OnPause();
	afx_msg void OnBrowse();
	afx_msg void OnStop();
	afx_msg void OnDvrGrabpicture();
	afx_msg void OnDirectxDxwindow();
	afx_msg void OnDirectxVideorendererDx81();
	afx_msg void OnDirectxVideorendererVmr9();
	afx_msg void OnDirectxVideorendererVmrxp();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_MPEG2CAPTUREAPPDLG_H__9968A6CB_9442_4EC1_A8E3_51A50DE0E1BE__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Israel Israel
Enjoy from Cabelim.com

Comments and Discussions