ao_pulse: support native mute control
[mplayer.git] / loader / dshow / interfaces.h
blobaf9544ada5f426176e43b2dbfbb17f47dfb2f415
1 #ifndef MPLAYER_INTERFACES_H
2 #define MPLAYER_INTERFACES_H
4 /*
5 * Definition of important DirectShow interfaces.
6 * Created using freely-available DirectX 8.0 SDK
7 * ( http://msdn.microsoft.com )
8 */
10 #include "iunk.h"
11 #include "loader/com.h"
13 /* Sh*t. MSVC++ and g++ use different methods of storing vtables. */
15 typedef struct IReferenceClock IReferenceClock;
16 typedef struct IFilterGraph IFilterGraph;
18 typedef struct IBaseFilter IBaseFilter;
20 typedef enum
22 PINDIR_INPUT = 0,
23 PINDIR_OUTPUT
24 } PIN_DIRECTION;
26 typedef struct PinInfo
28 IBaseFilter* pFilter;
29 PIN_DIRECTION dir;
30 unsigned short achName[128];
31 } PIN_INFO;
33 typedef struct AllocatorProperties
35 long cBuffers;
36 long cbBuffer;
37 long cbAlign;
38 long cbPrefix;
39 } ALLOCATOR_PROPERTIES;
41 typedef struct IEnumMediaTypes IEnumMediaTypes;
42 typedef struct IEnumMediaTypes_vt
44 INHERIT_IUNKNOWN();
46 HRESULT STDCALL ( *Next )(IEnumMediaTypes* This,
47 /* [in] */ unsigned long cMediaTypes,
48 /* [size_is][out] */ AM_MEDIA_TYPE** ppMediaTypes,
49 /* [out] */ unsigned long* pcFetched);
50 HRESULT STDCALL ( *Skip )(IEnumMediaTypes* This,
51 /* [in] */ unsigned long cMediaTypes);
52 HRESULT STDCALL ( *Reset )(IEnumMediaTypes* This);
53 HRESULT STDCALL ( *Clone )(IEnumMediaTypes* This,
54 /* [out] */ IEnumMediaTypes** ppEnum);
55 } IEnumMediaTypes_vt;
56 struct IEnumMediaTypes { IEnumMediaTypes_vt* vt; };
60 typedef struct IPin IPin;
61 typedef struct IPin_vt
63 INHERIT_IUNKNOWN();
65 HRESULT STDCALL ( *Connect )(IPin * This,
66 /* [in] */ IPin *pReceivePin,
67 /* [in] */ /*const*/ AM_MEDIA_TYPE *pmt);
68 HRESULT STDCALL ( *ReceiveConnection )(IPin * This,
69 /* [in] */ IPin *pConnector,
70 /* [in] */ const AM_MEDIA_TYPE *pmt);
71 HRESULT STDCALL ( *Disconnect )(IPin * This);
72 HRESULT STDCALL ( *ConnectedTo )(IPin * This, /* [out] */ IPin **pPin);
73 HRESULT STDCALL ( *ConnectionMediaType )(IPin * This,
74 /* [out] */ AM_MEDIA_TYPE *pmt);
75 HRESULT STDCALL ( *QueryPinInfo )(IPin * This, /* [out] */ PIN_INFO *pInfo);
76 HRESULT STDCALL ( *QueryDirection )(IPin * This,
77 /* [out] */ PIN_DIRECTION *pPinDir);
78 HRESULT STDCALL ( *QueryId )(IPin * This, /* [out] */ unsigned short* *Id);
79 HRESULT STDCALL ( *QueryAccept )(IPin * This,
80 /* [in] */ const AM_MEDIA_TYPE *pmt);
81 HRESULT STDCALL ( *EnumMediaTypes )(IPin * This,
82 /* [out] */ IEnumMediaTypes **ppEnum);
83 HRESULT STDCALL ( *QueryInternalConnections )(IPin * This,
84 /* [out] */ IPin **apPin,
85 /* [out][in] */ unsigned long *nPin);
86 HRESULT STDCALL ( *EndOfStream )(IPin * This);
87 HRESULT STDCALL ( *BeginFlush )(IPin * This);
88 HRESULT STDCALL ( *EndFlush )(IPin * This);
89 HRESULT STDCALL ( *NewSegment )(IPin * This,
90 /* [in] */ REFERENCE_TIME tStart,
91 /* [in] */ REFERENCE_TIME tStop,
92 /* [in] */ double dRate);
93 } IPin_vt;
94 struct IPin { IPin_vt *vt; };
97 typedef struct IEnumPins IEnumPins;
98 typedef struct IEnumPins_vt
100 INHERIT_IUNKNOWN();
102 // retrieves a specified number of pins in the enumeration sequence..
103 HRESULT STDCALL ( *Next )(IEnumPins* This,
104 /* [in] */ unsigned long cPins,
105 /* [size_is][out] */ IPin** ppPins,
106 /* [out] */ unsigned long* pcFetched);
107 // skips over a specified number of pins.
108 HRESULT STDCALL ( *Skip )(IEnumPins* This,
109 /* [in] */ unsigned long cPins);
110 // resets the enumeration sequence to the beginning.
111 HRESULT STDCALL ( *Reset )(IEnumPins* This);
112 // makes a copy of the enumerator with the same enumeration state.
113 HRESULT STDCALL ( *Clone )(IEnumPins* This,
114 /* [out] */ IEnumPins** ppEnum);
115 } IEnumPins_vt;
116 struct IEnumPins { struct IEnumPins_vt* vt; };
119 typedef struct IMediaSample IMediaSample;
120 typedef struct IMediaSample_vt
122 INHERIT_IUNKNOWN();
124 HRESULT STDCALL ( *GetPointer )(IMediaSample* This,
125 /* [out] */ unsigned char** ppBuffer);
126 LONG STDCALL ( *GetSize )(IMediaSample* This);
127 HRESULT STDCALL ( *GetTime )(IMediaSample* This,
128 /* [out] */ REFERENCE_TIME* pTimeStart,
129 /* [out] */ REFERENCE_TIME* pTimeEnd);
130 HRESULT STDCALL ( *SetTime )(IMediaSample* This,
131 /* [in] */ REFERENCE_TIME* pTimeStart,
132 /* [in] */ REFERENCE_TIME* pTimeEnd);
134 // sync-point property. If true, then the beginning of this
135 // sample is a sync-point. (note that if AM_MEDIA_TYPE.bTemporalCompression
136 // is false then all samples are sync points). A filter can start
137 // a stream at any sync point. S_FALSE if not sync-point, S_OK if true.
138 HRESULT STDCALL ( *IsSyncPoint )(IMediaSample* This);
139 HRESULT STDCALL ( *SetSyncPoint )(IMediaSample* This,
140 long bIsSyncPoint);
142 // preroll property. If true, this sample is for preroll only and
143 // shouldn't be displayed.
144 HRESULT STDCALL ( *IsPreroll )(IMediaSample* This);
145 HRESULT STDCALL ( *SetPreroll )(IMediaSample* This,
146 long bIsPreroll);
148 LONG STDCALL ( *GetActualDataLength )(IMediaSample* This);
149 HRESULT STDCALL ( *SetActualDataLength )(IMediaSample* This,
150 long __MIDL_0010);
152 // these allow for limited format changes in band - if no format change
153 // has been made when you receive a sample GetMediaType will return S_FALSE
154 HRESULT STDCALL ( *GetMediaType )(IMediaSample* This,
155 AM_MEDIA_TYPE** ppMediaType);
156 HRESULT STDCALL ( *SetMediaType )(IMediaSample* This,
157 AM_MEDIA_TYPE* pMediaType);
159 // returns S_OK if there is a discontinuity in the data (this frame is
160 // not a continuation of the previous stream of data
161 // - there has been a seek or some dropped samples).
162 HRESULT STDCALL ( *IsDiscontinuity )(IMediaSample* This);
163 HRESULT STDCALL ( *SetDiscontinuity )(IMediaSample* This,
164 long bDiscontinuity);
166 // get the media times for this sample
167 HRESULT STDCALL ( *GetMediaTime )(IMediaSample* This,
168 /* [out] */ long long* pTimeStart,
169 /* [out] */ long long* pTimeEnd);
170 // Set the media times for this sample
171 // pTimeStart==pTimeEnd==NULL will invalidate the media time stamps in
172 // this sample
173 HRESULT STDCALL ( *SetMediaTime )(IMediaSample* This,
174 /* [in] */ long long* pTimeStart,
175 /* [in] */ long long* pTimeEnd);
176 } IMediaSample_vt;
177 struct IMediaSample { struct IMediaSample_vt* vt; };
181 //typedef struct IBaseFilter IBaseFilter;
182 typedef struct IBaseFilter_vt
184 INHERIT_IUNKNOWN();
186 HRESULT STDCALL ( *GetClassID )(IBaseFilter * This,
187 /* [out] */ CLSID *pClassID);
188 HRESULT STDCALL ( *Stop )(IBaseFilter * This);
189 HRESULT STDCALL ( *Pause )(IBaseFilter * This);
190 HRESULT STDCALL ( *Run )(IBaseFilter * This,
191 REFERENCE_TIME tStart);
192 HRESULT STDCALL ( *GetState )(IBaseFilter * This,
193 /* [in] */ unsigned long dwMilliSecsTimeout,
194 ///* [out] */ FILTER_STATE *State);
195 void* State);
196 HRESULT STDCALL ( *SetSyncSource )(IBaseFilter* This,
197 /* [in] */ IReferenceClock *pClock);
198 HRESULT STDCALL ( *GetSyncSource )(IBaseFilter* This,
199 /* [out] */ IReferenceClock **pClock);
200 HRESULT STDCALL ( *EnumPins )(IBaseFilter* This,
201 /* [out] */ IEnumPins **ppEnum);
202 HRESULT STDCALL ( *FindPin )(IBaseFilter* This,
203 /* [string][in] */ const unsigned short* Id,
204 /* [out] */ IPin** ppPin);
205 HRESULT STDCALL ( *QueryFilterInfo )(IBaseFilter* This,
206 // /* [out] */ FILTER_INFO *pInfo);
207 void* pInfo);
208 HRESULT STDCALL ( *JoinFilterGraph )(IBaseFilter* This,
209 /* [in] */ IFilterGraph* pGraph,
210 /* [string][in] */ const unsigned short* pName);
211 HRESULT STDCALL ( *QueryVendorInfo )(IBaseFilter* This,
212 /* [string][out] */ unsigned short** pVendorInfo);
213 } IBaseFilter_vt;
214 struct IBaseFilter { struct IBaseFilter_vt* vt; };
218 typedef struct IMemAllocator IMemAllocator;
219 typedef struct IMemAllocator_vt
221 INHERIT_IUNKNOWN();
223 // specifies the number of buffers to allocate and the size of each buffer.
224 HRESULT STDCALL ( *SetProperties )(IMemAllocator* This,
225 /* [in] */ ALLOCATOR_PROPERTIES *pRequest,
226 /* [out] */ ALLOCATOR_PROPERTIES *pActual);
227 // retrieves the number of buffers that the allocator will create, and the buffer properties.
228 HRESULT STDCALL ( *GetProperties )(IMemAllocator* This,
229 /* [out] */ ALLOCATOR_PROPERTIES *pProps);
230 // allocates the buffer memory.
231 HRESULT STDCALL ( *Commit )(IMemAllocator* This);
232 // releases the memory for the buffers.
233 HRESULT STDCALL ( *Decommit )(IMemAllocator* This);
234 // retrieves a media sample that contains an empty buffer.
235 HRESULT STDCALL ( *GetBuffer )(IMemAllocator* This,
236 /* [out] */ IMediaSample** ppBuffer,
237 /* [in] */ REFERENCE_TIME* pStartTime,
238 /* [in] */ REFERENCE_TIME* pEndTime,
239 /* [in] */ unsigned long dwFlags);
240 // releases a media sample.
241 HRESULT STDCALL ( *ReleaseBuffer )(IMemAllocator* This,
242 /* [in] */ IMediaSample* pBuffer);
243 } IMemAllocator_vt;
244 struct IMemAllocator { IMemAllocator_vt* vt; };
248 typedef struct IMemInputPin IMemInputPin;
249 typedef struct IMemInputPin_vt
251 INHERIT_IUNKNOWN();
253 HRESULT STDCALL ( *GetAllocator )(IMemInputPin * This,
254 /* [out] */ IMemAllocator **ppAllocator);
255 HRESULT STDCALL ( *NotifyAllocator )(IMemInputPin * This,
256 /* [in] */ IMemAllocator *pAllocator,
257 /* [in] */ int bReadOnly);
258 HRESULT STDCALL ( *GetAllocatorRequirements )(IMemInputPin * This,
259 /* [out] */ ALLOCATOR_PROPERTIES *pProps);
260 HRESULT STDCALL ( *Receive )(IMemInputPin * This,
261 /* [in] */ IMediaSample *pSample);
262 HRESULT STDCALL ( *ReceiveMultiple )(IMemInputPin * This,
263 /* [size_is][in] */ IMediaSample **pSamples,
264 /* [in] */ long nSamples,
265 /* [out] */ long *nSamplesProcessed);
266 HRESULT STDCALL ( *ReceiveCanBlock )(IMemInputPin * This);
267 } IMemInputPin_vt;
268 struct IMemInputPin { IMemInputPin_vt* vt; };
271 typedef struct IHidden IHidden;
272 typedef struct IHidden_vt
274 INHERIT_IUNKNOWN();
276 HRESULT STDCALL ( *GetSmth )(IHidden* This, int* pv);
277 HRESULT STDCALL ( *SetSmth )(IHidden* This, int v1, int v2);
278 HRESULT STDCALL ( *GetSmth2 )(IHidden* This, int* pv);
279 HRESULT STDCALL ( *SetSmth2 )(IHidden* This, int v1, int v2);
280 HRESULT STDCALL ( *GetSmth3 )(IHidden* This, int* pv);
281 HRESULT STDCALL ( *SetSmth3 )(IHidden* This, int v1, int v2);
282 HRESULT STDCALL ( *GetSmth4 )(IHidden* This, int* pv);
283 HRESULT STDCALL ( *SetSmth4 )(IHidden* This, int v1, int v2);
284 HRESULT STDCALL ( *GetSmth5 )(IHidden* This, int* pv);
285 HRESULT STDCALL ( *SetSmth5 )(IHidden* This, int v1, int v2);
286 HRESULT STDCALL ( *GetSmth6 )(IHidden* This, int* pv);
287 } IHidden_vt;
288 struct IHidden { struct IHidden_vt* vt; };
291 typedef struct IHidden2 IHidden2;
292 typedef struct IHidden2_vt
294 INHERIT_IUNKNOWN();
296 HRESULT STDCALL ( *unk1 )(void);
297 HRESULT STDCALL ( *unk2 )(void);
298 HRESULT STDCALL ( *unk3 )(void);
299 HRESULT STDCALL ( *DecodeGet )(IHidden2* This, int* region);
300 HRESULT STDCALL ( *unk5 )(void);
301 HRESULT STDCALL ( *DecodeSet )(IHidden2* This, int* region);
302 HRESULT STDCALL ( *unk7 )(void);
303 HRESULT STDCALL ( *unk8 )(void);
304 } IHidden2_vt;
305 struct IHidden2 { struct IHidden2_vt* vt; };
308 // fixme
309 typedef struct IDivxFilterInterface {
310 struct IDivxFilterInterface_vt* vt;
311 } IDivxFilterInterface;
313 struct IDivxFilterInterface_vt
315 INHERIT_IUNKNOWN();
317 HRESULT STDCALL ( *get_PPLevel )(IDivxFilterInterface* This, int* PPLevel); // current postprocessing level
318 HRESULT STDCALL ( *put_PPLevel )(IDivxFilterInterface* This, int PPLevel); // new postprocessing level
319 HRESULT STDCALL ( *put_DefaultPPLevel )(IDivxFilterInterface* This);
320 HRESULT STDCALL ( *put_MaxDelayAllowed )(IDivxFilterInterface* This, int maxdelayallowed);
321 HRESULT STDCALL ( *put_Brightness )(IDivxFilterInterface* This, int brightness);
322 HRESULT STDCALL ( *put_Contrast )(IDivxFilterInterface* This, int contrast);
323 HRESULT STDCALL ( *put_Saturation )(IDivxFilterInterface* This, int saturation);
324 HRESULT STDCALL ( *get_MaxDelayAllowed )(IDivxFilterInterface* This, int* maxdelayallowed);
325 HRESULT STDCALL ( *get_Brightness)(IDivxFilterInterface* This, int* brightness);
326 HRESULT STDCALL ( *get_Contrast)(IDivxFilterInterface* This, int* contrast);
327 HRESULT STDCALL ( *get_Saturation )(IDivxFilterInterface* This, int* saturation);
328 HRESULT STDCALL ( *put_AspectRatio )(IDivxFilterInterface* This, int x, IDivxFilterInterface* Thisit, int y);
329 HRESULT STDCALL ( *get_AspectRatio )(IDivxFilterInterface* This, int* x, IDivxFilterInterface* Thisit, int* y);
332 typedef struct IEnumFilters IEnumFilters;
334 typedef struct IFilterGraph_vt
336 INHERIT_IUNKNOWN();
338 HRESULT STDCALL ( *AddFilter )(IFilterGraph* This,
339 /* [in] */ IBaseFilter* pFilter,
340 /* [string][in] */ unsigned short* pName);
341 HRESULT STDCALL ( *RemoveFilter )(IFilterGraph* This,
342 /* [in] */ IBaseFilter* pFilter);
343 HRESULT STDCALL ( *EnumFilters )(IFilterGraph* This,
344 /* [out] */ IEnumFilters** ppEnum);
345 HRESULT STDCALL ( *FindFilterByName )(IFilterGraph* This,
346 /* [string][in] */ unsigned short* pName,
347 /* [out] */ IBaseFilter** ppFilter);
348 HRESULT STDCALL ( *ConnectDirect )(IFilterGraph* This,
349 /* [in] */ IPin* ppinOut,
350 /* [in] */ IPin* ppinIn,
351 /* [in] */ const AM_MEDIA_TYPE* pmt);
352 HRESULT STDCALL ( *Reconnect )(IFilterGraph* This,
353 /* [in] */ IPin* ppin);
354 HRESULT STDCALL ( *Disconnect )(IFilterGraph* This,
355 /* [in] */ IPin* ppin);
356 HRESULT STDCALL ( *SetDefaultSyncSource )(IFilterGraph* This);
357 } IFilterGraph_vt;
358 struct IFilterGraph { IFilterGraph_vt *vt; };
360 #endif /*MPLAYER_INTERFACES_H */