2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
25 #include "IGraphBuilder2.h"
29 , public IGraphBuilder2
30 , public IGraphBuilderDeadEnd
34 struct path_t
{CLSID clsid
; CString filter
, pin
;};
36 class CStreamPath
: public CAtlList
<path_t
>
39 void Append(IBaseFilter
* pBF
, IPin
* pPin
);
40 bool Compare(const CStreamPath
& path
);
43 class CStreamDeadEnd
: public CStreamPath
46 CAtlList
<CMediaType
> mts
;
50 CComPtr
<IUnknown
> m_pUnkInner
;
53 CStreamPath m_streampath
;
54 CAutoPtrArray
<CStreamDeadEnd
> m_deadends
;
57 CComPtr
<IFilterMapper2
> m_pFM
;
58 CInterfaceList
<IUnknown
, &IID_IUnknown
> m_pUnks
;
59 CAtlList
<CFGFilter
*> m_source
, m_transform
, m_override
;
61 static bool CheckBytes(HANDLE hFile
, CString chkbytes
);
63 HRESULT
EnumSourceFilters(LPCWSTR lpcwstrFileName
, CFGFilterList
& fl
);
64 HRESULT
AddSourceFilter(CFGFilter
* pFGF
, LPCWSTR lpcwstrFileName
, LPCWSTR lpcwstrFilterName
, IBaseFilter
** ppBF
);
68 STDMETHODIMP
AddFilter(IBaseFilter
* pFilter
, LPCWSTR pName
);
69 STDMETHODIMP
RemoveFilter(IBaseFilter
* pFilter
);
70 STDMETHODIMP
EnumFilters(IEnumFilters
** ppEnum
);
71 STDMETHODIMP
FindFilterByName(LPCWSTR pName
, IBaseFilter
** ppFilter
);
72 STDMETHODIMP
ConnectDirect(IPin
* pPinOut
, IPin
* pPinIn
, const AM_MEDIA_TYPE
* pmt
);
73 STDMETHODIMP
Reconnect(IPin
* ppin
);
74 STDMETHODIMP
Disconnect(IPin
* ppin
);
75 STDMETHODIMP
SetDefaultSyncSource();
79 STDMETHODIMP
Connect(IPin
* pPinOut
, IPin
* pPinIn
);
80 STDMETHODIMP
Render(IPin
* pPinOut
);
81 STDMETHODIMP
RenderFile(LPCWSTR lpcwstrFile
, LPCWSTR lpcwstrPlayList
);
82 STDMETHODIMP
AddSourceFilter(LPCWSTR lpcwstrFileName
, LPCWSTR lpcwstrFilterName
, IBaseFilter
** ppFilter
);
83 STDMETHODIMP
SetLogFile(DWORD_PTR hFile
);
85 STDMETHODIMP
ShouldOperationContinue();
89 STDMETHODIMP
AddSourceFilterForMoniker(IMoniker
* pMoniker
, IBindCtx
* pCtx
, LPCWSTR lpcwstrFilterName
, IBaseFilter
** ppFilter
);
90 STDMETHODIMP
ReconnectEx(IPin
* ppin
, const AM_MEDIA_TYPE
* pmt
);
91 STDMETHODIMP
RenderEx(IPin
* pPinOut
, DWORD dwFlags
, DWORD
* pvContext
);
95 STDMETHODIMP
IsPinDirection(IPin
* pPin
, PIN_DIRECTION dir
);
96 STDMETHODIMP
IsPinConnected(IPin
* pPin
);
97 STDMETHODIMP
ConnectFilter(IBaseFilter
* pBF
, IPin
* pPinIn
);
98 STDMETHODIMP
ConnectFilter(IPin
* pPinOut
, IBaseFilter
* pBF
);
99 STDMETHODIMP
ConnectFilterDirect(IPin
* pPinOut
, IBaseFilter
* pBF
, const AM_MEDIA_TYPE
* pmt
);
100 STDMETHODIMP
NukeDownstream(IUnknown
* pUnk
);
101 STDMETHODIMP
FindInterface(REFIID iid
, void** ppv
, BOOL bRemove
);
102 STDMETHODIMP
AddToROT();
103 STDMETHODIMP
RemoveFromROT();
105 // IGraphBuilderDeadEnd
107 STDMETHODIMP_(size_t) GetCount();
108 STDMETHODIMP
GetDeadEnd(int iIndex
, CAtlList
<CStringW
>& path
, CAtlList
<CMediaType
>& mts
);
111 CFGManager(LPCTSTR pName
, LPUNKNOWN pUnk
);
112 virtual ~CFGManager();
115 STDMETHODIMP
NonDelegatingQueryInterface(REFIID riid
, void** ppv
);
118 class CFGManagerCustom
: public CFGManager
123 STDMETHODIMP
AddFilter(IBaseFilter
* pFilter
, LPCWSTR pName
);
126 CFGManagerCustom(LPCTSTR pName
, LPUNKNOWN pUnk
, UINT src
, UINT tra
);
129 class CFGManagerPlayer
: public CFGManagerCustom
133 UINT64 m_vrmerit
, m_armerit
;
137 STDMETHODIMP
ConnectDirect(IPin
* pPinOut
, IPin
* pPinIn
, const AM_MEDIA_TYPE
* pmt
);
140 CFGManagerPlayer(LPCTSTR pName
, LPUNKNOWN pUnk
, UINT src
, UINT tra
, HWND hWnd
);
143 class CFGManagerDVD
: public CFGManagerPlayer
148 STDMETHODIMP
RenderFile(LPCWSTR lpcwstrFile
, LPCWSTR lpcwstrPlayList
);
149 STDMETHODIMP
AddSourceFilter(LPCWSTR lpcwstrFileName
, LPCWSTR lpcwstrFilterName
, IBaseFilter
** ppFilter
);
152 CFGManagerDVD(LPCTSTR pName
, LPUNKNOWN pUnk
, UINT src
, UINT tra
, HWND hWnd
);
155 class CFGManagerCapture
: public CFGManagerPlayer
158 CFGManagerCapture(LPCTSTR pName
, LPUNKNOWN pUnk
, UINT src
, UINT tra
, HWND hWnd
);
161 class CFGManagerMuxer
: public CFGManagerCustom
164 CFGManagerMuxer(LPCTSTR pName
, LPUNKNOWN pUnk
);
169 class CFGAggregator
: public CUnknown
172 CComPtr
<IUnknown
> m_pUnkInner
;
175 CFGAggregator(const CLSID
& clsid
, LPCTSTR pName
, LPUNKNOWN pUnk
, HRESULT
& hr
);
176 virtual ~CFGAggregator();
179 STDMETHODIMP
NonDelegatingQueryInterface(REFIID riid
, void** ppv
);