Click here to Skip to main content
12,296,088 members (58,112 online)
Click here to Skip to main content
Articles » Multimedia » DirectX » General » Downloads

Stats

100.8K views
4.9K downloads
77 bookmarked
Posted

Streaming Server using Direct Show and Windows Media Format

, 13 May 2010 CPOL
A simple streaming server using Direct Show and Windows Media Format SDK
Server
Release
Server.exe
res
Server.ico
Server.clw
Server.dsp
Server.dsw
Server.opt
Server.plg
// ServerDlg.h : header file
//

#if !defined(AFX_SERVERDLG_H__E8CA8A80_BBF1_4E7F_9AE4_8119DF6EE94E__INCLUDED_)
#define AFX_SERVERDLG_H__E8CA8A80_BBF1_4E7F_9AE4_8119DF6EE94E__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CServerDlg dialog

class CServerDlg : public CDialog
{

	IGraphBuilder  *m_pGraph ;
	IBaseFilter *m_pVidDeviceFilter;
	IBaseFilter *m_pAudDeviceFilter;
	IMediaControl *m_pMediaControl;
	IMediaEvent *m_pEvent ; //Media Event interface for capture the media events
	IBaseFilter *m_pWMASFWritter ; //IBase Filter for WMASFWritter 
	IFileSinkFilter* m_pFileSinkFilter;
	IWMWriterAdvanced2 *m_pWriter2 ; //Windows media writer advanced from WMF
	IWMWriterNetworkSink *m_pNetSink;
	IServiceProvider *m_pProvider ;
	
// Construction
public:
	GetAudeoDevices(CString strDevName,IBaseFilter **pFilter);
	HRESULT ConnectFilters(IGraphBuilder *pGraph,IBaseFilter *pFirst, IBaseFilter *pSecond,CString strAsfFilterPin);
	IPin* GetPinByName(IBaseFilter *pFilter, LPCOLESTR pinname);
	BOOL StartStreaming();
	HRESULT GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, IPin **ppPin);
	HRESULT ConnectFilters(IGraphBuilder *pGraph, IBaseFilter *pFirst, IBaseFilter *pSecond);
	GetVideoDevices(CString strDevName,IBaseFilter **pFilter);
	CServerDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CServerDlg)
	enum { IDD = IDD_SERVER_DIALOG };
	CStatic	m_StaticUrl;
	CEdit	m_EditPort;
	CButton	m_btnStop;
	CButton	m_btnPause;
	CButton	m_btnStart;
	CComboBox	m_CboAudioDevices;
	CComboBox	m_CboVideoDevices;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CServerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonStart();
	afx_msg void OnButtonPause();
	afx_msg void OnButtonStop();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_SERVERDLG_H__E8CA8A80_BBF1_4E7F_9AE4_8119DF6EE94E__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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

R@jeev K R
Architect
India India
I am an iOS\VC++\.net programmer. I am currently employed as an Architect in a software development company. The main technologies I used are
Objective C, Swift,VC++,MFC,C#.NET,DirectShow,COM,Windows media Format etc...

I'm looking to advance my career by learning new technologies and extending my programming experience.

EMail : rajeevkr.asr@gmail.com
Skype : rajeevkr_asr

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160525.2 | Last Updated 13 May 2010
Article Copyright 2010 by R@jeev K R
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid