X64 transport [Part 5] (Update plugins.cpp)
[xy_vsfilter.git] / src / apps / mplayerc / FGManager.h
blob49579f6b3ebcbb5e20023fd02fedd1bb43e74f68
1 /*
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)
8 * any later version.
9 *
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
22 #pragma once
24 #include "FGFilter.h"
25 #include "IGraphBuilder2.h"
27 class CFGManager
28 : public CUnknown
29 , public IGraphBuilder2
30 , public IGraphBuilderDeadEnd
31 , public CCritSec
33 public:
34 struct path_t {CLSID clsid; CString filter, pin;};
36 class CStreamPath : public CAtlList<path_t>
38 public:
39 void Append(IBaseFilter* pBF, IPin* pPin);
40 bool Compare(const CStreamPath& path);
43 class CStreamDeadEnd : public CStreamPath
45 public:
46 CAtlList<CMediaType> mts;
49 private:
50 CComPtr<IUnknown> m_pUnkInner;
51 DWORD m_dwRegister;
53 CStreamPath m_streampath;
54 CAutoPtrArray<CStreamDeadEnd> m_deadends;
56 protected:
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);
66 // IFilterGraph
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();
77 // IGraphBuilder
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);
84 STDMETHODIMP Abort();
85 STDMETHODIMP ShouldOperationContinue();
87 // IFilterGraph2
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);
93 // IGraphBuilder2
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);
110 public:
111 CFGManager(LPCTSTR pName, LPUNKNOWN pUnk);
112 virtual ~CFGManager();
114 DECLARE_IUNKNOWN;
115 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
118 class CFGManagerCustom : public CFGManager
120 public:
121 // IFilterGraph
123 STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName);
125 public:
126 CFGManagerCustom(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra);
129 class CFGManagerPlayer : public CFGManagerCustom
131 protected:
132 HWND m_hWnd;
133 UINT64 m_vrmerit, m_armerit;
135 // IFilterGraph
137 STDMETHODIMP ConnectDirect(IPin* pPinOut, IPin* pPinIn, const AM_MEDIA_TYPE* pmt);
139 public:
140 CFGManagerPlayer(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd);
143 class CFGManagerDVD : public CFGManagerPlayer
145 protected:
146 // IGraphBuilder
148 STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList);
149 STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter);
151 public:
152 CFGManagerDVD(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd);
155 class CFGManagerCapture : public CFGManagerPlayer
157 public:
158 CFGManagerCapture(LPCTSTR pName, LPUNKNOWN pUnk, UINT src, UINT tra, HWND hWnd);
161 class CFGManagerMuxer : public CFGManagerCustom
163 public:
164 CFGManagerMuxer(LPCTSTR pName, LPUNKNOWN pUnk);
169 class CFGAggregator : public CUnknown
171 protected:
172 CComPtr<IUnknown> m_pUnkInner;
174 public:
175 CFGAggregator(const CLSID& clsid, LPCTSTR pName, LPUNKNOWN pUnk, HRESULT& hr);
176 virtual ~CFGAggregator();
178 DECLARE_IUNKNOWN;
179 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);