X64 transport [Part 5] (Update plugins.cpp)
[xy_vsfilter.git] / src / apps / mplayerc / BaseGraph.h
blobfd56597beda46172f71808f8ed34f50b094f5a38
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 "IGraphBuilder2.h"
26 class CPlayerWindow : public CWnd
28 public:
29 CPlayerWindow() {}
31 protected:
32 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
33 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
34 DECLARE_MESSAGE_MAP()
37 typedef enum {DirectShow = 0, RealMedia, QuickTime, ShockWave} engine_t;
39 [uuid("B110CDE5-6331-4118-8AAF-A870D6F7E2E4")]
40 interface IGraphEngine : public IUnknown
42 STDMETHOD_(engine_t, GetEngine) () = 0;
45 enum
47 EC_BG_AUDIO_CHANGED = EC_USER+1,
48 EC_BG_ERROR
51 class CBaseGraph
52 : public CUnknown
53 , public IGraphBuilder2
54 , public IMediaControl
55 , public IMediaEventEx
56 , public IMediaSeeking
57 , public IVideoWindow
58 , public IBasicVideo
59 , public IBasicAudio
60 , public IAMOpenProgress
61 , public IGraphEngine
63 OAHWND m_hNotifyWnd;
64 long m_lNotifyMsg;
65 LONG_PTR m_lNotifyInstData;
67 typedef struct {long m_lEventCode; LONG_PTR m_lParam1, m_lParam2;} GMSG;
68 CList<GMSG> m_msgqueue;
70 protected:
71 void ClearMessageQueue();
73 public:
74 CBaseGraph();
75 virtual ~CBaseGraph();
77 DECLARE_IUNKNOWN;
78 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
80 void NotifyEvent(long lEventCode, LONG_PTR lParam1 = 0, LONG_PTR lParam2 = 0);
82 protected:
83 // IDispatch
84 STDMETHODIMP GetTypeInfoCount(UINT* pctinfo);
85 STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo);
86 STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId);
87 STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr);
89 // IFilterGraph
90 STDMETHODIMP AddFilter(IBaseFilter* pFilter, LPCWSTR pName);
91 STDMETHODIMP RemoveFilter(IBaseFilter* pFilter);
92 STDMETHODIMP EnumFilters(IEnumFilters** ppEnum);
93 STDMETHODIMP FindFilterByName(LPCWSTR pName, IBaseFilter** ppFilter);
94 STDMETHODIMP ConnectDirect(IPin* ppinOut, IPin* ppinIn, const AM_MEDIA_TYPE* pmt);
95 STDMETHODIMP Reconnect(IPin* ppin);
96 STDMETHODIMP Disconnect(IPin* ppin);
97 STDMETHODIMP SetDefaultSyncSource();
99 // IGraphBuilder
100 STDMETHODIMP Connect(IPin* ppinOut, IPin* ppinIn);
101 STDMETHODIMP Render(IPin* ppinOut);
102 STDMETHODIMP RenderFile(LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList);
103 STDMETHODIMP AddSourceFilter(LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter);
104 STDMETHODIMP SetLogFile(DWORD_PTR hFile);
105 STDMETHODIMP Abort();
106 STDMETHODIMP ShouldOperationContinue();
108 // IFilterGraph2
109 STDMETHODIMP AddSourceFilterForMoniker(IMoniker* pMoniker, IBindCtx* pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter** ppFilter);
110 STDMETHODIMP ReconnectEx(IPin* ppin, const AM_MEDIA_TYPE* pmt);
111 STDMETHODIMP RenderEx(IPin* pPinOut, DWORD dwFlags, DWORD* pvContext);
113 // IGraphBuilder2
114 STDMETHODIMP IsPinDirection(IPin* pPin, PIN_DIRECTION dir);
115 STDMETHODIMP IsPinConnected(IPin* pPin);
116 STDMETHODIMP ConnectFilter(IBaseFilter* pBF, IPin* pPinIn);
117 STDMETHODIMP ConnectFilter(IPin* pPinOut, IBaseFilter* pBF);
118 STDMETHODIMP ConnectFilterDirect(IPin* pPinOut, IBaseFilter* pBF, const AM_MEDIA_TYPE* pmt);
119 STDMETHODIMP NukeDownstream(IUnknown* pUnk);
120 STDMETHODIMP FindInterface(REFIID iid, void** ppv, BOOL bRemove);
121 STDMETHODIMP AddToROT();
122 STDMETHODIMP RemoveFromROT();
124 // IMediaControl
125 STDMETHODIMP Run();
126 STDMETHODIMP Pause();
127 STDMETHODIMP Stop();
128 STDMETHODIMP GetState(LONG msTimeout, OAFilterState* pfs);
129 STDMETHODIMP RenderFile(BSTR strFilename);
130 STDMETHODIMP AddSourceFilter(BSTR strFilename, IDispatch** ppUnk);
131 STDMETHODIMP get_FilterCollection(IDispatch** ppUnk);
132 STDMETHODIMP get_RegFilterCollection(IDispatch** ppUnk);
133 STDMETHODIMP StopWhenReady();
135 // IMediaEvent
136 STDMETHODIMP GetEventHandle(OAEVENT* hEvent);
137 STDMETHODIMP GetEvent(long* lEventCode, LONG_PTR* lParam1, LONG_PTR* lParam2, long msTimeout);
138 STDMETHODIMP WaitForCompletion(long msTimeout, long* pEvCode);
139 STDMETHODIMP CancelDefaultHandling(long lEvCode);
140 STDMETHODIMP RestoreDefaultHandling(long lEvCode);
141 STDMETHODIMP FreeEventParams(long lEvCode, LONG_PTR lParam1, LONG_PTR lParam2);
143 // IMediaEventEx
144 STDMETHODIMP SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData);
145 STDMETHODIMP SetNotifyFlags(long lNoNotifyFlags);
146 STDMETHODIMP GetNotifyFlags(long* lplNoNotifyFlags);
148 // IMediaSeeking
149 STDMETHODIMP GetCapabilities(DWORD* pCapabilities);
150 STDMETHODIMP CheckCapabilities(DWORD* pCapabilities);
151 STDMETHODIMP IsFormatSupported(const GUID* pFormat);
152 STDMETHODIMP QueryPreferredFormat(GUID* pFormat);
153 STDMETHODIMP GetTimeFormat(GUID* pFormat);
154 STDMETHODIMP IsUsingTimeFormat(const GUID* pFormat);
155 STDMETHODIMP SetTimeFormat(const GUID* pFormat);
156 STDMETHODIMP GetDuration(LONGLONG* pDuration);
157 STDMETHODIMP GetStopPosition(LONGLONG* pStop);
158 STDMETHODIMP GetCurrentPosition(LONGLONG* pCurrent);
159 STDMETHODIMP ConvertTimeFormat(LONGLONG* pTarget, const GUID* pTargetFormat, LONGLONG Source, const GUID* pSourceFormat);
160 STDMETHODIMP SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags);
161 STDMETHODIMP GetPositions(LONGLONG* pCurrent, LONGLONG* pStop);
162 STDMETHODIMP GetAvailable(LONGLONG* pEarliest, LONGLONG* pLatest);
163 STDMETHODIMP SetRate(double dRate);
164 STDMETHODIMP GetRate(double* pdRate);
165 STDMETHODIMP GetPreroll(LONGLONG* pllPreroll);
167 // IVideoWindow
168 STDMETHODIMP put_Caption(BSTR strCaption);
169 STDMETHODIMP get_Caption(BSTR* strCaption);
170 STDMETHODIMP put_WindowStyle(long WindowStyle);
171 STDMETHODIMP get_WindowStyle(long* WindowStyle);
172 STDMETHODIMP put_WindowStyleEx(long WindowStyleEx);
173 STDMETHODIMP get_WindowStyleEx(long* WindowStyleEx);
174 STDMETHODIMP put_AutoShow(long AutoShow);
175 STDMETHODIMP get_AutoShow(long* AutoShow);
176 STDMETHODIMP put_WindowState(long WindowState);
177 STDMETHODIMP get_WindowState(long* WindowState);
178 STDMETHODIMP put_BackgroundPalette(long BackgroundPalette);
179 STDMETHODIMP get_BackgroundPalette(long* pBackgroundPalette);
180 STDMETHODIMP put_Visible(long Visible);
181 STDMETHODIMP get_Visible(long* pVisible);
182 STDMETHODIMP put_Left(long Left);
183 STDMETHODIMP get_Left(long* pLeft);
184 STDMETHODIMP put_Width(long Width);
185 STDMETHODIMP get_Width(long* pWidth);
186 STDMETHODIMP put_Top(long Top);
187 STDMETHODIMP get_Top(long* pTop);
188 STDMETHODIMP put_Height(long Height);
189 STDMETHODIMP get_Height(long* pHeight);
190 STDMETHODIMP put_Owner(OAHWND Owner);
191 STDMETHODIMP get_Owner(OAHWND* Owner);
192 STDMETHODIMP put_MessageDrain(OAHWND Drain);
193 STDMETHODIMP get_MessageDrain(OAHWND* Drain);
194 STDMETHODIMP get_BorderColor(long* Color);
195 STDMETHODIMP put_BorderColor(long Color);
196 STDMETHODIMP get_FullScreenMode(long* FullScreenMode);
197 STDMETHODIMP put_FullScreenMode(long FullScreenMode);
198 STDMETHODIMP SetWindowForeground(long Focus);
199 STDMETHODIMP NotifyOwnerMessage(OAHWND hwnd, long uMsg, LONG_PTR wParam, LONG_PTR lParam);
200 STDMETHODIMP SetWindowPosition(long Left, long Top, long Width, long Height);
201 STDMETHODIMP GetWindowPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
202 STDMETHODIMP GetMinIdealImageSize(long* pWidth, long* pHeight);
203 STDMETHODIMP GetMaxIdealImageSize(long* pWidth, long* pHeight);
204 STDMETHODIMP GetRestorePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
205 STDMETHODIMP HideCursor(long HideCursor);
206 STDMETHODIMP IsCursorHidden(long* CursorHidden);
208 // IBasicVideo
209 STDMETHODIMP get_AvgTimePerFrame(REFTIME* pAvgTimePerFrame);
210 STDMETHODIMP get_BitRate(long* pBitRate);
211 STDMETHODIMP get_BitErrorRate(long* pBitErrorRate);
212 STDMETHODIMP get_VideoWidth(long* pVideoWidth);
213 STDMETHODIMP get_VideoHeight(long* pVideoHeight);
214 STDMETHODIMP put_SourceLeft(long SourceLeft);
215 STDMETHODIMP get_SourceLeft(long* pSourceLeft);
216 STDMETHODIMP put_SourceWidth(long SourceWidth);
217 STDMETHODIMP get_SourceWidth(long* pSourceWidth);
218 STDMETHODIMP put_SourceTop(long SourceTop);
219 STDMETHODIMP get_SourceTop(long* pSourceTop);
220 STDMETHODIMP put_SourceHeight(long SourceHeight);
221 STDMETHODIMP get_SourceHeight(long* pSourceHeight);
222 STDMETHODIMP put_DestinationLeft(long DestinationLeft);
223 STDMETHODIMP get_DestinationLeft(long* pDestinationLeft);
224 STDMETHODIMP put_DestinationWidth(long DestinationWidth);
225 STDMETHODIMP get_DestinationWidth(long* pDestinationWidth);
226 STDMETHODIMP put_DestinationTop(long DestinationTop);
227 STDMETHODIMP get_DestinationTop(long* pDestinationTop);
228 STDMETHODIMP put_DestinationHeight(long DestinationHeight);
229 STDMETHODIMP get_DestinationHeight(long* pDestinationHeight);
230 STDMETHODIMP SetSourcePosition(long Left, long Top, long Width, long Height);
231 STDMETHODIMP GetSourcePosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
232 STDMETHODIMP SetDefaultSourcePosition();
233 STDMETHODIMP SetDestinationPosition(long Left, long Top, long Width, long Height);
234 STDMETHODIMP GetDestinationPosition(long* pLeft, long* pTop, long* pWidth, long* pHeight);
235 STDMETHODIMP SetDefaultDestinationPosition();
236 STDMETHODIMP GetVideoSize(long* pWidth, long* pHeight);
237 STDMETHODIMP GetVideoPaletteEntries(long StartIndex, long Entries, long* pRetrieved, long* pPalette);
238 STDMETHODIMP GetCurrentImage(long* pBufferSize, long* pDIBImage);
239 STDMETHODIMP IsUsingDefaultSource();
240 STDMETHODIMP IsUsingDefaultDestination();
242 // IBasicAudio
243 STDMETHODIMP put_Volume(long lVolume);
244 STDMETHODIMP get_Volume(long* plVolume);
245 STDMETHODIMP put_Balance(long lBalance);
246 STDMETHODIMP get_Balance(long* plBalance);
248 // IAMOpenProgress
249 STDMETHODIMP QueryProgress(LONGLONG* pllTotal, LONGLONG* pllCurrent);
250 STDMETHODIMP AbortOperation();
252 // IGraphEngine
253 STDMETHODIMP_(engine_t) GetEngine();