aboutsummaryrefslogtreecommitdiffhomepage
path: root/loader/dshow/interfaces.h
blob: 92a7718cd09784468449d5d565821065084b2669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#ifndef DS_INTERFACES_H
#define DS_INTERFACES_H

/*
 * Definition of important DirectShow interfaces.
 * Created using freely-available DirectX 8.0 SDK
 * ( http://msdn.microsoft.com )
 */

#include "iunk.h"
#include "com.h"

/*    Sh*t. MSVC++ and g++ use different methods of storing vtables.    */

typedef struct _IReferenceClock IReferenceClock;
typedef struct _IFilterGraph IFilterGraph;

typedef struct _IBaseFilter IBaseFilter;

typedef enum
{
    PINDIR_INPUT = 0,
    PINDIR_OUTPUT
} PIN_DIRECTION;

typedef struct _PinInfo
{
    IBaseFilter* pFilter;
    PIN_DIRECTION dir;
    unsigned short achName[128];
} PIN_INFO;

typedef struct _AllocatorProperties
{
    long cBuffers;
    long cbBuffer;
    long cbAlign;
    long cbPrefix;
} ALLOCATOR_PROPERTIES;

typedef struct _IEnumMediaTypes IEnumMediaTypes;
typedef struct IEnumMediaTypes_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *Next )(IEnumMediaTypes* This,
			      /* [in] */ unsigned long cMediaTypes,
			      /* [size_is][out] */ AM_MEDIA_TYPE** ppMediaTypes,
			      /* [out] */ unsigned long* pcFetched);
    HRESULT STDCALL ( *Skip )(IEnumMediaTypes* This,
			      /* [in] */ unsigned long cMediaTypes);
    HRESULT STDCALL ( *Reset )(IEnumMediaTypes* This);
    HRESULT STDCALL ( *Clone )(IEnumMediaTypes* This,
			       /* [out] */ IEnumMediaTypes** ppEnum);
} IEnumMediaTypes_vt;
struct _IEnumMediaTypes { IEnumMediaTypes_vt* vt; };



typedef struct _IPin IPin;
typedef struct IPin_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *Connect )(IPin * This,
				 /* [in] */ IPin *pReceivePin,
				 /* [in] */ /*const*/ AM_MEDIA_TYPE *pmt);
    HRESULT STDCALL ( *ReceiveConnection )(IPin * This,
					   /* [in] */ IPin *pConnector,
					   /* [in] */ const AM_MEDIA_TYPE *pmt);
    HRESULT STDCALL ( *Disconnect )(IPin * This);
    HRESULT STDCALL ( *ConnectedTo )(IPin * This, /* [out] */ IPin **pPin);
    HRESULT STDCALL ( *ConnectionMediaType )(IPin * This,
					     /* [out] */ AM_MEDIA_TYPE *pmt);
    HRESULT STDCALL ( *QueryPinInfo )(IPin * This, /* [out] */ PIN_INFO *pInfo);
    HRESULT STDCALL ( *QueryDirection )(IPin * This,
					/* [out] */ PIN_DIRECTION *pPinDir);
    HRESULT STDCALL ( *QueryId )(IPin * This, /* [out] */ unsigned short* *Id);
    HRESULT STDCALL ( *QueryAccept )(IPin * This,
				     /* [in] */ const AM_MEDIA_TYPE *pmt);
    HRESULT STDCALL ( *EnumMediaTypes )(IPin * This,
					/* [out] */ IEnumMediaTypes **ppEnum);
    HRESULT STDCALL ( *QueryInternalConnections )(IPin * This,
						  /* [out] */ IPin **apPin,
						  /* [out][in] */ unsigned long *nPin);
    HRESULT STDCALL ( *EndOfStream )(IPin * This);
    HRESULT STDCALL ( *BeginFlush )(IPin * This);
    HRESULT STDCALL ( *EndFlush )(IPin * This);
    HRESULT STDCALL ( *NewSegment )(IPin * This,
				    /* [in] */ REFERENCE_TIME tStart,
				    /* [in] */ REFERENCE_TIME tStop,
				    /* [in] */ double dRate);
} IPin_vt;
struct _IPin { IPin_vt *vt; };


typedef struct _IEnumPins IEnumPins;
typedef struct IEnumPins_vt
{
    INHERIT_IUNKNOWN();

    // retrieves a specified number of pins in the enumeration sequence..
    HRESULT STDCALL ( *Next )(IEnumPins* This,
			      /* [in] */ unsigned long cPins,
			      /* [size_is][out] */ IPin** ppPins,
			      /* [out] */ unsigned long* pcFetched);
    // skips over a specified number of pins.
    HRESULT STDCALL ( *Skip )(IEnumPins* This,
			      /* [in] */ unsigned long cPins);
    // resets the enumeration sequence to the beginning.
    HRESULT STDCALL ( *Reset )(IEnumPins* This);
    // makes a copy of the enumerator with the same enumeration state.
    HRESULT STDCALL ( *Clone )(IEnumPins* This,
			       /* [out] */ IEnumPins** ppEnum);
} IEnumPins_vt;
struct _IEnumPins { struct IEnumPins_vt* vt; };


typedef struct _IMediaSample IMediaSample;
typedef struct IMediaSample_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *GetPointer )(IMediaSample* This,
				    /* [out] */ unsigned char** ppBuffer);
    LONG    STDCALL ( *GetSize )(IMediaSample* This);
    HRESULT STDCALL ( *GetTime )(IMediaSample* This,
				 /* [out] */ REFERENCE_TIME* pTimeStart,
				 /* [out] */ REFERENCE_TIME* pTimeEnd);
    HRESULT STDCALL ( *SetTime )(IMediaSample* This,
				 /* [in] */ REFERENCE_TIME* pTimeStart,
				 /* [in] */ REFERENCE_TIME* pTimeEnd);

    // sync-point property. If true, then the beginning of this
    // sample is a sync-point. (note that if AM_MEDIA_TYPE.bTemporalCompression
    // is false then all samples are sync points). A filter can start
    // a stream at any sync point.  S_FALSE if not sync-point, S_OK if true.
    HRESULT STDCALL ( *IsSyncPoint )(IMediaSample* This);
    HRESULT STDCALL ( *SetSyncPoint )(IMediaSample* This,
				      long bIsSyncPoint);

    // preroll property.  If true, this sample is for preroll only and
    // shouldn't be displayed.
    HRESULT STDCALL ( *IsPreroll )(IMediaSample* This);
    HRESULT STDCALL ( *SetPreroll )(IMediaSample* This,
				    long bIsPreroll);

    LONG    STDCALL ( *GetActualDataLength )(IMediaSample* This);
    HRESULT STDCALL ( *SetActualDataLength )(IMediaSample* This,
					     long __MIDL_0010);

    // these allow for limited format changes in band - if no format change
    // has been made when you receive a sample GetMediaType will return S_FALSE
    HRESULT STDCALL ( *GetMediaType )(IMediaSample* This,
				      AM_MEDIA_TYPE** ppMediaType);
    HRESULT STDCALL ( *SetMediaType )(IMediaSample* This,
				      AM_MEDIA_TYPE* pMediaType);

    // returns S_OK if there is a discontinuity in the data (this frame is
    // not a continuation of the previous stream of data
    // - there has been a seek or some dropped samples).
    HRESULT STDCALL ( *IsDiscontinuity )(IMediaSample* This);
    HRESULT STDCALL ( *SetDiscontinuity )(IMediaSample* This,
					  long bDiscontinuity);

    // get the media times for this sample
    HRESULT STDCALL ( *GetMediaTime )(IMediaSample* This,
				      /* [out] */ long long* pTimeStart,
				      /* [out] */ long long* pTimeEnd);
    // Set the media times for this sample
    // pTimeStart==pTimeEnd==NULL will invalidate the media time stamps in
    // this sample
    HRESULT STDCALL ( *SetMediaTime )(IMediaSample* This,
				      /* [in] */ long long* pTimeStart,
				      /* [in] */ long long* pTimeEnd);
} IMediaSample_vt;
struct _IMediaSample { struct IMediaSample_vt* vt; };



//typedef struct _IBaseFilter IBaseFilter;
typedef struct IBaseFilter_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *GetClassID )(IBaseFilter * This,
				    /* [out] */ CLSID *pClassID);
    HRESULT STDCALL ( *Stop )(IBaseFilter * This);
    HRESULT STDCALL ( *Pause )(IBaseFilter * This);
    HRESULT STDCALL ( *Run )(IBaseFilter * This,
			     REFERENCE_TIME tStart);
    HRESULT STDCALL ( *GetState )(IBaseFilter * This,
				  /* [in] */ unsigned long dwMilliSecsTimeout,
				  ///* [out] */ FILTER_STATE *State);
				  void* State);
    HRESULT STDCALL ( *SetSyncSource )(IBaseFilter* This,
				       /* [in] */ IReferenceClock *pClock);
    HRESULT STDCALL ( *GetSyncSource )(IBaseFilter* This,
				       /* [out] */ IReferenceClock **pClock);
    HRESULT STDCALL ( *EnumPins )(IBaseFilter* This,
				  /* [out] */ IEnumPins **ppEnum);
    HRESULT STDCALL ( *FindPin )(IBaseFilter* This,
				 /* [string][in] */ const unsigned short* Id,
				 /* [out] */ IPin** ppPin);
    HRESULT STDCALL ( *QueryFilterInfo )(IBaseFilter* This,
					 // /* [out] */ FILTER_INFO *pInfo);
					 void* pInfo);
    HRESULT STDCALL ( *JoinFilterGraph )(IBaseFilter* This,
					 /* [in] */ IFilterGraph* pGraph,
					 /* [string][in] */ const unsigned short* pName);
    HRESULT STDCALL ( *QueryVendorInfo )(IBaseFilter* This,
					 /* [string][out] */ unsigned short** pVendorInfo);
} IBaseFilter_vt;
struct _IBaseFilter { struct IBaseFilter_vt* vt; };



typedef struct _IMemAllocator IMemAllocator;
typedef struct IMemAllocator_vt
{
    INHERIT_IUNKNOWN();

    // specifies the number of buffers to allocate and the size of each buffer.
    HRESULT STDCALL ( *SetProperties )(IMemAllocator* This,
				       /* [in] */ ALLOCATOR_PROPERTIES *pRequest,
				       /* [out] */ ALLOCATOR_PROPERTIES *pActual);
    // retrieves the number of buffers that the allocator will create, and the buffer properties.
    HRESULT STDCALL ( *GetProperties )(IMemAllocator* This,
				       /* [out] */ ALLOCATOR_PROPERTIES *pProps);
    // allocates the buffer memory.
    HRESULT STDCALL ( *Commit )(IMemAllocator* This);
    // releases the memory for the buffers.
    HRESULT STDCALL ( *Decommit )(IMemAllocator* This);
    // retrieves a media sample that contains an empty buffer.
    HRESULT STDCALL ( *GetBuffer )(IMemAllocator* This,
				   /* [out] */ IMediaSample** ppBuffer,
				   /* [in] */ REFERENCE_TIME* pStartTime,
				   /* [in] */ REFERENCE_TIME* pEndTime,
				   /* [in] */ unsigned long dwFlags);
    // releases a media sample.
    HRESULT STDCALL ( *ReleaseBuffer )(IMemAllocator* This,
				       /* [in] */ IMediaSample* pBuffer);
} IMemAllocator_vt;
struct _IMemAllocator { IMemAllocator_vt* vt; };



typedef struct _IMemInputPin IMemInputPin;
typedef struct IMemInputPin_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *GetAllocator )(IMemInputPin * This,
				      /* [out] */ IMemAllocator **ppAllocator);
    HRESULT STDCALL ( *NotifyAllocator )(IMemInputPin * This,
					 /* [in] */ IMemAllocator *pAllocator,
					 /* [in] */ int bReadOnly);
    HRESULT STDCALL ( *GetAllocatorRequirements )(IMemInputPin * This,
						  /* [out] */ ALLOCATOR_PROPERTIES *pProps);
    HRESULT STDCALL ( *Receive )(IMemInputPin * This,
				 /* [in] */ IMediaSample *pSample);
    HRESULT STDCALL ( *ReceiveMultiple )(IMemInputPin * This,
					 /* [size_is][in] */ IMediaSample **pSamples,
					 /* [in] */ long nSamples,
					 /* [out] */ long *nSamplesProcessed);
    HRESULT STDCALL ( *ReceiveCanBlock )(IMemInputPin * This);
} IMemInputPin_vt;
struct _IMemInputPin { IMemInputPin_vt* vt; };


typedef struct _IHidden IHidden;
typedef struct IHidden_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *GetSmth )(IHidden* This, int* pv);
    HRESULT STDCALL ( *SetSmth )(IHidden* This, int v1, int v2);
    HRESULT STDCALL ( *GetSmth2 )(IHidden* This, int* pv);
    HRESULT STDCALL ( *SetSmth2 )(IHidden* This, int v1, int v2);
    HRESULT STDCALL ( *GetSmth3 )(IHidden* This, int* pv);
    HRESULT STDCALL ( *SetSmth3 )(IHidden* This, int v1, int v2);
    HRESULT STDCALL ( *GetSmth4 )(IHidden* This, int* pv);
    HRESULT STDCALL ( *SetSmth4 )(IHidden* This, int v1, int v2);
    HRESULT STDCALL ( *GetSmth5 )(IHidden* This, int* pv);
    HRESULT STDCALL ( *SetSmth5 )(IHidden* This, int v1, int v2);
    HRESULT STDCALL ( *GetSmth6 )(IHidden* This, int* pv);
} IHidden_vt;
struct _IHidden { struct IHidden_vt* vt; };


typedef struct _IHidden2 IHidden2;
typedef struct IHidden2_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *unk1 )(void);
    HRESULT STDCALL ( *unk2 )(void);
    HRESULT STDCALL ( *unk3 )(void);
    HRESULT STDCALL ( *DecodeGet )(IHidden2* This, int* region);
    HRESULT STDCALL ( *unk5 )(void);
    HRESULT STDCALL ( *DecodeSet )(IHidden2* This, int* region);
    HRESULT STDCALL ( *unk7 )(void);
    HRESULT STDCALL ( *unk8 )(void);
} IHidden2_vt;
struct _IHidden2 { struct IHidden2_vt* vt; };


// fixme
typedef struct IDivxFilterInterface {
    struct IDivxFilterInterface_vt* vt;
} IDivxFilterInterface;

struct IDivxFilterInterface_vt
{
    INHERIT_IUNKNOWN();

    HRESULT STDCALL ( *get_PPLevel )(IDivxFilterInterface* This, int* PPLevel); // current postprocessing level
    HRESULT STDCALL ( *put_PPLevel )(IDivxFilterInterface* This, int PPLevel); // new postprocessing level
    HRESULT STDCALL ( *put_DefaultPPLevel )(IDivxFilterInterface* This);
    HRESULT STDCALL ( *put_MaxDelayAllowed )(IDivxFilterInterface* This, int maxdelayallowed);
    HRESULT STDCALL ( *put_Brightness )(IDivxFilterInterface* This,  int brightness);
    HRESULT STDCALL ( *put_Contrast )(IDivxFilterInterface* This,  int contrast);
    HRESULT STDCALL ( *put_Saturation )(IDivxFilterInterface* This, int saturation);
    HRESULT STDCALL ( *get_MaxDelayAllowed )(IDivxFilterInterface* This,  int* maxdelayallowed);
    HRESULT STDCALL ( *get_Brightness)(IDivxFilterInterface* This, int* brightness);
    HRESULT STDCALL ( *get_Contrast)(IDivxFilterInterface* This, int* contrast);
    HRESULT STDCALL ( *get_Saturation )(IDivxFilterInterface* This, int* saturation);
    HRESULT STDCALL ( *put_AspectRatio )(IDivxFilterInterface* This, int x, IDivxFilterInterface* Thisit, int y);
    HRESULT STDCALL ( *get_AspectRatio )(IDivxFilterInterface* This, int* x, IDivxFilterInterface* Thisit, int* y);
};

#endif  /* DS_INTERFACES_H */