1 #ifndef DS_INTERFACES_H
2 #define DS_INTERFACES_H
5 * Definition of important DirectShow interfaces.
6 * Created using freely-available DirectX 8.0 SDK
7 * ( http://msdn.microsoft.com )
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
;
26 typedef struct _PinInfo
30 unsigned short achName
[128];
33 typedef struct _AllocatorProperties
39 } ALLOCATOR_PROPERTIES
;
41 typedef struct _IEnumMediaTypes IEnumMediaTypes
;
42 typedef struct IEnumMediaTypes_vt
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
);
56 struct _IEnumMediaTypes
{ IEnumMediaTypes_vt
* vt
; };
60 typedef struct _IPin IPin
;
61 typedef struct IPin_vt
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
);
94 struct _IPin
{ IPin_vt
*vt
; };
97 typedef struct _IEnumPins IEnumPins
;
98 typedef struct IEnumPins_vt
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
);
116 struct _IEnumPins
{ struct IEnumPins_vt
* vt
; };
119 typedef struct _IMediaSample IMediaSample
;
120 typedef struct IMediaSample_vt
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
,
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
,
148 LONG
STDCALL ( *GetActualDataLength
)(IMediaSample
* This
);
149 HRESULT
STDCALL ( *SetActualDataLength
)(IMediaSample
* This
,
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
173 HRESULT
STDCALL ( *SetMediaTime
)(IMediaSample
* This
,
174 /* [in] */ long long* pTimeStart
,
175 /* [in] */ long long* pTimeEnd
);
177 struct _IMediaSample
{ struct IMediaSample_vt
* vt
; };
181 //typedef struct _IBaseFilter IBaseFilter;
182 typedef struct IBaseFilter_vt
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);
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);
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
);
214 struct _IBaseFilter
{ struct IBaseFilter_vt
* vt
; };
218 typedef struct _IMemAllocator IMemAllocator
;
219 typedef struct IMemAllocator_vt
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
);
244 struct _IMemAllocator
{ IMemAllocator_vt
* vt
; };
248 typedef struct _IMemInputPin IMemInputPin
;
249 typedef struct IMemInputPin_vt
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
);
268 struct _IMemInputPin
{ IMemInputPin_vt
* vt
; };
271 typedef struct _IHidden IHidden
;
272 typedef struct IHidden_vt
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
);
288 struct _IHidden
{ struct IHidden_vt
* vt
; };
291 typedef struct _IHidden2 IHidden2
;
292 typedef struct IHidden2_vt
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);
305 struct _IHidden2
{ struct IHidden2_vt
* vt
; };
309 typedef struct IDivxFilterInterface
{
310 struct IDivxFilterInterface_vt
* vt
;
311 } IDivxFilterInterface
;
313 struct IDivxFilterInterface_vt
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 #endif /* DS_INTERFACES_H */