168
|
1 #include "inputpin.h"
|
2069
|
2 #include "wine/winerror.h"
|
1545
|
3 #include <string.h>
|
168
|
4 #include <stdio.h>
|
|
5 #include <stdlib.h>
|
1545
|
6
|
3056
|
7 static int unimplemented(const char* s, void* p)
|
1545
|
8 {
|
3056
|
9 Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
|
|
10 return E_NOTIMPL;
|
|
11 }
|
1545
|
12
|
3056
|
13 /***********
|
|
14 * EnumPins
|
|
15 ***********/
|
168
|
16
|
3056
|
17 typedef struct
|
168
|
18 {
|
3056
|
19 IEnumPins_vt* vt;
|
168
|
20 IPin* pin1;
|
|
21 IPin* pin2;
|
|
22 int counter;
|
3056
|
23 GUID interfaces[2];
|
|
24 DECLARE_IUNKNOWN();
|
|
25 } CEnumPins;
|
1545
|
26
|
3056
|
27 static long STDCALL CEnumPins_Next(IEnumPins* This,
|
|
28 /* [in] */ unsigned long cMediaTypes,
|
3130
|
29 /* [size_is][out] */ IPin** ppMediaTypes,
|
|
30 /* [out] */ unsigned long* pcFetched)
|
168
|
31 {
|
3056
|
32 CEnumPins* pin = (CEnumPins*)This;
|
168
|
33
|
3056
|
34 Debug printf("CEnumPins_Next(%p) called\n", This);
|
1545
|
35 if (!ppMediaTypes)
|
|
36 return E_INVALIDARG;
|
|
37 if (!pcFetched && (cMediaTypes!=1))
|
|
38 return E_INVALIDARG;
|
|
39 if (cMediaTypes<=0)
|
|
40 return 0;
|
|
41
|
3056
|
42 //lcounter = ((CEnumPins*)This)->counter;
|
|
43 //lpin1 = ((CEnumPins*)This)->pin1;
|
|
44 //lpin2 = ((CEnumPins*)This)->pin2;
|
|
45 if (((pin->counter == 2) && pin->pin2)
|
|
46 || ((pin->counter == 1) && !pin->pin2))
|
168
|
47 {
|
1545
|
48 if (pcFetched)
|
|
49 *pcFetched=0;
|
168
|
50 return 1;
|
|
51 }
|
1545
|
52
|
|
53 if (pcFetched)
|
|
54 *pcFetched=1;
|
3056
|
55 if (pin->counter==0)
|
168
|
56 {
|
3056
|
57 *ppMediaTypes = pin->pin1;
|
|
58 pin->pin1->vt->AddRef((IUnknown*)pin->pin1);
|
168
|
59 }
|
|
60 else
|
|
61 {
|
3056
|
62 *ppMediaTypes = pin->pin2;
|
|
63 pin->pin2->vt->AddRef((IUnknown*)pin->pin2);
|
168
|
64 }
|
3056
|
65 pin->counter++;
|
1545
|
66 if (cMediaTypes == 1)
|
|
67 return 0;
|
168
|
68 return 1;
|
|
69 }
|
|
70
|
3056
|
71 static long STDCALL CEnumPins_Skip(IEnumPins* This,
|
|
72 /* [in] */ unsigned long cMediaTypes)
|
168
|
73 {
|
3056
|
74 Debug unimplemented("CEnumPins_Skip", This);
|
168
|
75 return E_NOTIMPL;
|
|
76 }
|
|
77
|
3056
|
78 static long STDCALL CEnumPins_Reset(IEnumPins* This)
|
168
|
79 {
|
3056
|
80 Debug printf("CEnumPins_Reset(%p) called\n", This);
|
|
81 ((CEnumPins*)This)->counter = 0;
|
168
|
82 return 0;
|
|
83 }
|
|
84
|
3056
|
85 static long STDCALL CEnumPins_Clone(IEnumPins* This,
|
|
86 /* [out] */ IEnumPins** ppEnum)
|
168
|
87 {
|
3056
|
88 Debug unimplemented("CEnumPins_Clone", This);
|
168
|
89 return E_NOTIMPL;
|
|
90 }
|
1545
|
91
|
3056
|
92 static void CEnumPins_Destroy(CEnumPins* This)
|
168
|
93 {
|
3056
|
94 free(This->vt);
|
|
95 free(This);
|
168
|
96 }
|
|
97
|
3056
|
98 IMPLEMENT_IUNKNOWN(CEnumPins)
|
|
99
|
|
100 static CEnumPins* CEnumPinsCreate(IPin* p, IPin* pp)
|
168
|
101 {
|
3056
|
102 CEnumPins* This = (CEnumPins*) malloc(sizeof(CEnumPins));
|
|
103
|
|
104 This->pin1 = p;
|
|
105 This->pin2 = pp;
|
|
106 This->counter = 0;
|
|
107 This->refcount = 1;
|
|
108
|
|
109 This->vt = (IEnumPins_vt*) malloc(sizeof(IEnumPins_vt));
|
|
110 This->vt->QueryInterface = CEnumPins_QueryInterface;
|
|
111 This->vt->AddRef = CEnumPins_AddRef;
|
|
112 This->vt->Release = CEnumPins_Release;
|
|
113 This->vt->Next = CEnumPins_Next;
|
|
114 This->vt->Skip = CEnumPins_Skip;
|
|
115 This->vt->Reset = CEnumPins_Reset;
|
|
116 This->vt->Clone = CEnumPins_Clone;
|
|
117
|
|
118 This->interfaces[0] = IID_IUnknown;
|
|
119 This->interfaces[1] = IID_IEnumPins;
|
|
120
|
|
121 return This;
|
|
122 }
|
|
123
|
|
124
|
|
125
|
|
126 /***********
|
|
127 * InputPin
|
|
128 ***********/
|
|
129
|
3130
|
130 static long STDCALL CInputPin_Connect(IPin* This,
|
|
131 /* [in] */ IPin* pReceivePin,
|
|
132 /* [in] */ AM_MEDIA_TYPE* pmt)
|
3056
|
133 {
|
|
134 Debug unimplemented("CInputPin_Connect", This);
|
168
|
135 return E_NOTIMPL;
|
|
136 }
|
|
137
|
3056
|
138 static long STDCALL CInputPin_ReceiveConnection(IPin* This,
|
|
139 /* [in] */ IPin* pConnector,
|
|
140 /* [in] */ const AM_MEDIA_TYPE *pmt)
|
168
|
141 {
|
3056
|
142 Debug unimplemented("CInputPin_ReceiveConnection", This);
|
168
|
143 return E_NOTIMPL;
|
|
144 }
|
1545
|
145
|
3056
|
146 static long STDCALL CInputPin_Disconnect(IPin* This)
|
168
|
147 {
|
3056
|
148 Debug unimplemented("CInputPin_Disconnect", This);
|
168
|
149 return E_NOTIMPL;
|
|
150 }
|
|
151
|
3056
|
152 static long STDCALL CInputPin_ConnectedTo(IPin* This,
|
|
153 /* [out] */ IPin** pPin)
|
168
|
154 {
|
3056
|
155 Debug unimplemented("CInputPin_ConnectedTo", This);
|
168
|
156 return E_NOTIMPL;
|
|
157 }
|
|
158
|
3056
|
159 static long STDCALL CInputPin_ConnectionMediaType(IPin* This,
|
|
160 /* [out] */ AM_MEDIA_TYPE *pmt)
|
168
|
161 {
|
3056
|
162 Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This);
|
|
163 if (!pmt)
|
|
164 return E_INVALIDARG;
|
168
|
165 *pmt=((CInputPin*)This)->type;
|
3056
|
166 if (pmt->cbFormat > 0)
|
168
|
167 {
|
|
168 pmt->pbFormat=(char *)CoTaskMemAlloc(pmt->cbFormat);
|
|
169 memcpy(pmt->pbFormat, ((CInputPin*)This)->type.pbFormat, pmt->cbFormat);
|
1545
|
170 }
|
168
|
171 return 0;
|
|
172 }
|
|
173
|
3056
|
174 static long STDCALL CInputPin_QueryPinInfo(IPin* This,
|
|
175 /* [out] */ PIN_INFO *pInfo)
|
168
|
176 {
|
1545
|
177 CBaseFilter* lparent=((CInputPin*)This)->parent;
|
3056
|
178 Debug printf("CInputPin_QueryPinInfo(%p) called\n", This);
|
|
179 pInfo->dir = PINDIR_OUTPUT;
|
|
180 pInfo->pFilter = (IBaseFilter*) lparent;
|
1545
|
181 lparent->vt->AddRef((IUnknown*)lparent);
|
3056
|
182 pInfo->achName[0] = 0;
|
|
183 return 0;
|
|
184 }
|
|
185
|
|
186 static long STDCALL CInputPin_QueryDirection(IPin* This,
|
|
187 /* [out] */ PIN_DIRECTION *pPinDir)
|
|
188 {
|
|
189 *pPinDir = PINDIR_OUTPUT;
|
|
190 Debug printf("CInputPin_QueryDirection(%p) called\n", This);
|
168
|
191 return 0;
|
|
192 }
|
|
193
|
3056
|
194 static long STDCALL CInputPin_QueryId(IPin* This,
|
|
195 /* [out] */ unsigned short* *Id)
|
168
|
196 {
|
3056
|
197 Debug unimplemented("CInputPin_QueryId", This);
|
|
198 return E_NOTIMPL;
|
168
|
199 }
|
|
200
|
3056
|
201 static long STDCALL CInputPin_QueryAccept(IPin* This,
|
3130
|
202 /* [in] */ const AM_MEDIA_TYPE* pmt)
|
168
|
203 {
|
3056
|
204 Debug unimplemented("CInputPin_QueryAccept", This);
|
168
|
205 return E_NOTIMPL;
|
|
206 }
|
|
207
|
3056
|
208 static long STDCALL CInputPin_EnumMediaTypes(IPin* This,
|
3130
|
209 /* [out] */ IEnumMediaTypes** ppEnum)
|
168
|
210 {
|
3056
|
211 Debug unimplemented("CInputPin_EnumMediaTypes", This);
|
|
212 return E_NOTIMPL;
|
|
213 }
|
|
214
|
|
215 static long STDCALL CInputPin_QueryInternalConnections(IPin* This,
|
3130
|
216 /* [out] */ IPin** apPin,
|
3056
|
217 /* [out][in] */ unsigned long *nPin)
|
|
218 {
|
|
219 Debug unimplemented("CInputPin_QueryInternalConnections", This);
|
|
220 return E_NOTIMPL;
|
|
221 }
|
|
222
|
|
223 static long STDCALL CInputPin_EndOfStream(IPin * This)
|
|
224 {
|
|
225 Debug unimplemented("CInputPin_EndOfStream", This);
|
168
|
226 return E_NOTIMPL;
|
|
227 }
|
|
228
|
|
229
|
3056
|
230 static long STDCALL CInputPin_BeginFlush(IPin * This)
|
168
|
231 {
|
3056
|
232 Debug unimplemented("CInputPin_BeginFlush", This);
|
168
|
233 return E_NOTIMPL;
|
|
234 }
|
|
235
|
|
236
|
3130
|
237 static long STDCALL CInputPin_EndFlush(IPin* This)
|
168
|
238 {
|
3056
|
239 Debug unimplemented("CInputPin_EndFlush", This);
|
168
|
240 return E_NOTIMPL;
|
|
241 }
|
|
242
|
3130
|
243 static long STDCALL CInputPin_NewSegment(IPin* This,
|
3056
|
244 /* [in] */ REFERENCE_TIME tStart,
|
|
245 /* [in] */ REFERENCE_TIME tStop,
|
|
246 /* [in] */ double dRate)
|
168
|
247 {
|
3056
|
248 Debug unimplemented("CInputPin_NewSegment", This);
|
168
|
249 return E_NOTIMPL;
|
1545
|
250 }
|
168
|
251
|
3056
|
252 static void CInputPin_Destroy(CInputPin* This)
|
168
|
253 {
|
3056
|
254 free(This->vt);
|
|
255 free(This);
|
1545
|
256 }
|
|
257
|
3056
|
258 IMPLEMENT_IUNKNOWN(CInputPin)
|
|
259
|
|
260 CInputPin* CInputPinCreate(CBaseFilter* p, const AM_MEDIA_TYPE* amt)
|
168
|
261 {
|
3056
|
262 CInputPin* This = (CInputPin*) malloc(sizeof(CInputPin));
|
|
263
|
|
264 This->parent = p;
|
|
265 This->refcount = 1;
|
|
266 This->type = *amt;
|
|
267
|
|
268 This->vt= (IPin_vt*) malloc(sizeof(IPin_vt));
|
|
269 This->vt->QueryInterface = CInputPin_QueryInterface;
|
|
270 This->vt->AddRef = CInputPin_AddRef;
|
|
271 This->vt->Release = CInputPin_Release;
|
|
272 This->vt->Connect = CInputPin_Connect;
|
|
273 This->vt->ReceiveConnection = CInputPin_ReceiveConnection;
|
|
274 This->vt->Disconnect = CInputPin_Disconnect;
|
|
275 This->vt->ConnectedTo = CInputPin_ConnectedTo;
|
|
276 This->vt->ConnectionMediaType = CInputPin_ConnectionMediaType;
|
|
277 This->vt->QueryPinInfo = CInputPin_QueryPinInfo;
|
|
278 This->vt->QueryDirection = CInputPin_QueryDirection;
|
|
279 This->vt->QueryId = CInputPin_QueryId;
|
|
280 This->vt->QueryAccept = CInputPin_QueryAccept;
|
|
281 This->vt->EnumMediaTypes = CInputPin_EnumMediaTypes;
|
|
282 This->vt->QueryInternalConnections = CInputPin_QueryInternalConnections;
|
|
283 This->vt->EndOfStream = CInputPin_EndOfStream;
|
|
284 This->vt->BeginFlush = CInputPin_BeginFlush;
|
|
285 This->vt->EndFlush = CInputPin_EndFlush;
|
|
286 This->vt->NewSegment = CInputPin_NewSegment;
|
|
287
|
|
288 This->interfaces[0]=IID_IUnknown;
|
|
289
|
|
290 return This;
|
1545
|
291 }
|
168
|
292
|
3056
|
293
|
|
294 /*************
|
|
295 * BaseFilter
|
|
296 *************/
|
|
297
|
|
298 static long STDCALL CBaseFilter_GetClassID(IBaseFilter * This,
|
|
299 /* [out] */ CLSID *pClassID)
|
168
|
300 {
|
3056
|
301 Debug unimplemented("CBaseFilter_GetClassID", This);
|
168
|
302 return E_NOTIMPL;
|
1545
|
303 }
|
168
|
304
|
3056
|
305 static long STDCALL CBaseFilter_Stop(IBaseFilter* This)
|
168
|
306 {
|
3056
|
307 Debug unimplemented("CBaseFilter_Stop", This);
|
168
|
308 return E_NOTIMPL;
|
1545
|
309 }
|
168
|
310
|
3056
|
311 static long STDCALL CBaseFilter_Pause(IBaseFilter* This)
|
168
|
312 {
|
3056
|
313 Debug unimplemented("CBaseFilter_Pause", This);
|
|
314 return E_NOTIMPL;
|
|
315 }
|
|
316
|
|
317 static long STDCALL CBaseFilter_Run(IBaseFilter* This, REFERENCE_TIME tStart)
|
|
318 {
|
|
319 Debug unimplemented("CBaseFilter_Run", This);
|
168
|
320 return E_NOTIMPL;
|
1545
|
321 }
|
168
|
322
|
3056
|
323 static long STDCALL CBaseFilter_GetState(IBaseFilter* This,
|
|
324 /* [in] */ unsigned long dwMilliSecsTimeout,
|
|
325 // /* [out] */ FILTER_STATE *State)
|
|
326 void* State)
|
168
|
327 {
|
3056
|
328 Debug unimplemented("CBaseFilter_GetState", This);
|
|
329 return E_NOTIMPL;
|
1545
|
330 }
|
168
|
331
|
3056
|
332 static long STDCALL CBaseFilter_SetSyncSource(IBaseFilter* This,
|
|
333 /* [in] */ IReferenceClock *pClock)
|
|
334 {
|
|
335 Debug unimplemented("CBaseFilter_SetSyncSource", This);
|
|
336 return E_NOTIMPL;
|
|
337 }
|
1545
|
338
|
3056
|
339 static long STDCALL CBaseFilter_GetSyncSource(IBaseFilter* This,
|
|
340 /* [out] */ IReferenceClock **pClock)
|
168
|
341 {
|
3056
|
342 Debug unimplemented("CBaseFilter_GetSyncSource", This);
|
168
|
343 return E_NOTIMPL;
|
1545
|
344 }
|
168
|
345
|
1545
|
346
|
3056
|
347 static long STDCALL CBaseFilter_EnumPins(IBaseFilter* This,
|
|
348 /* [out] */ IEnumPins **ppEnum)
|
|
349 {
|
|
350 Debug printf("CBaseFilter_EnumPins(%p) called\n", This);
|
|
351 *ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter*)This)->pin, ((CBaseFilter*)This)->unused_pin);
|
|
352 return 0;
|
|
353 }
|
|
354
|
|
355 static long STDCALL CBaseFilter_FindPin(IBaseFilter* This,
|
|
356 /* [string][in] */ const unsigned short* Id,
|
|
357 /* [out] */ IPin **ppPin)
|
168
|
358 {
|
3056
|
359 Debug unimplemented("CBaseFilter_FindPin\n", This);
|
|
360 return E_NOTIMPL;
|
|
361 }
|
|
362
|
3130
|
363 static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter* This,
|
3056
|
364 // /* [out] */ FILTER_INFO *pInfo)
|
|
365 void* pInfo)
|
|
366 {
|
|
367 Debug unimplemented("CBaseFilter_QueryFilterInfo", This);
|
|
368 return E_NOTIMPL;
|
|
369 }
|
|
370
|
3130
|
371 static long STDCALL CBaseFilter_JoinFilterGraph(IBaseFilter* This,
|
|
372 /* [in] */ IFilterGraph* pGraph,
|
3056
|
373 /* [string][in] */ const unsigned short* pName)
|
|
374 {
|
|
375 Debug unimplemented("CBaseFilter_JoinFilterGraph", This);
|
|
376 return E_NOTIMPL;
|
|
377 }
|
|
378
|
3130
|
379 static long STDCALL CBaseFilter_QueryVendorInfo(IBaseFilter* This,
|
|
380 /* [string][out] */ unsigned short** pVendorInfo)
|
3056
|
381 {
|
|
382 Debug unimplemented("CBaseFilter_QueryVendorInfo", This);
|
168
|
383 return E_NOTIMPL;
|
1545
|
384 }
|
168
|
385
|
3056
|
386 static IPin* CBaseFilter_GetPin(CBaseFilter* This)
|
|
387 {
|
|
388 return This->pin;
|
|
389 }
|
1545
|
390
|
3056
|
391 static IPin* CBaseFilter_GetUnusedPin(CBaseFilter* This)
|
168
|
392 {
|
3056
|
393 return This->unused_pin;
|
|
394 }
|
|
395
|
|
396 static void CBaseFilter_Destroy(CBaseFilter* This)
|
|
397 {
|
|
398 free(This->vt);
|
|
399 This->pin->vt->Release((IUnknown*)This->pin);
|
|
400 This->unused_pin->vt->Release((IUnknown*)This->unused_pin);
|
|
401 free(This);
|
1545
|
402 }
|
168
|
403
|
3056
|
404 IMPLEMENT_IUNKNOWN(CBaseFilter)
|
1545
|
405
|
3056
|
406 CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* type, CBaseFilter2* parent)
|
168
|
407 {
|
3056
|
408 CBaseFilter* This = (CBaseFilter*) malloc(sizeof(CBaseFilter));
|
|
409 This->refcount = 1;
|
|
410
|
|
411 This->pin = (IPin*) CInputPinCreate(This, type);
|
|
412 This->unused_pin = (IPin*) CRemotePinCreate(This, parent->GetPin(parent));
|
|
413
|
|
414 This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
|
|
415 This->vt->QueryInterface = CBaseFilter_QueryInterface;
|
|
416 This->vt->AddRef = CBaseFilter_AddRef;
|
|
417 This->vt->Release = CBaseFilter_Release;
|
|
418 This->vt->GetClassID = CBaseFilter_GetClassID;
|
|
419 This->vt->Stop = CBaseFilter_Stop;
|
|
420 This->vt->Pause = CBaseFilter_Pause;
|
|
421 This->vt->Run = CBaseFilter_Run;
|
|
422 This->vt->GetState = CBaseFilter_GetState;
|
|
423 This->vt->SetSyncSource = CBaseFilter_SetSyncSource;
|
|
424 This->vt->GetSyncSource = CBaseFilter_GetSyncSource;
|
|
425 This->vt->EnumPins = CBaseFilter_EnumPins;
|
|
426 This->vt->FindPin = CBaseFilter_FindPin;
|
|
427 This->vt->QueryFilterInfo = CBaseFilter_QueryFilterInfo;
|
|
428 This->vt->JoinFilterGraph = CBaseFilter_JoinFilterGraph;
|
|
429 This->vt->QueryVendorInfo = CBaseFilter_QueryVendorInfo;
|
|
430
|
|
431 This->interfaces[0] = IID_IUnknown;
|
|
432 This->interfaces[1] = IID_IBaseFilter;
|
|
433
|
|
434 This->GetPin = CBaseFilter_GetPin;
|
|
435 This->GetUnusedPin = CBaseFilter_GetUnusedPin;
|
|
436
|
|
437 return This;
|
1545
|
438 }
|
168
|
439
|
|
440
|
3056
|
441 /**************
|
|
442 * BaseFilter2
|
|
443 **************/
|
168
|
444
|
|
445
|
3130
|
446 static long STDCALL CBaseFilter2_GetClassID(IBaseFilter* This,
|
|
447 /* [out] */ CLSID* pClassID)
|
168
|
448 {
|
3056
|
449 Debug unimplemented("CBaseFilter2_GetClassID", This);
|
168
|
450 return E_NOTIMPL;
|
1545
|
451 }
|
168
|
452
|
3130
|
453 static long STDCALL CBaseFilter2_Stop(IBaseFilter* This)
|
168
|
454 {
|
3056
|
455 Debug unimplemented("CBaseFilter2_Stop", This);
|
168
|
456 return E_NOTIMPL;
|
1545
|
457 }
|
168
|
458
|
3130
|
459 static long STDCALL CBaseFilter2_Pause(IBaseFilter* This)
|
168
|
460 {
|
3056
|
461 Debug unimplemented("CBaseFilter2_Pause", This);
|
168
|
462 return E_NOTIMPL;
|
1545
|
463 }
|
|
464
|
3130
|
465 static long STDCALL CBaseFilter2_Run(IBaseFilter* This, REFERENCE_TIME tStart)
|
168
|
466 {
|
3056
|
467 Debug unimplemented("CBaseFilter2_Run", This);
|
168
|
468 return E_NOTIMPL;
|
1545
|
469 }
|
168
|
470
|
1545
|
471
|
3056
|
472 static long STDCALL CBaseFilter2_GetState(IBaseFilter* This,
|
|
473 /* [in] */ unsigned long dwMilliSecsTimeout,
|
|
474 // /* [out] */ FILTER_STATE *State)
|
|
475 void* State)
|
|
476 {
|
|
477 Debug unimplemented("CBaseFilter2_GetState", This);
|
|
478 return E_NOTIMPL;
|
|
479 }
|
|
480
|
|
481 static long STDCALL CBaseFilter2_SetSyncSource(IBaseFilter* This,
|
|
482 /* [in] */ IReferenceClock* pClock)
|
|
483 {
|
|
484 Debug unimplemented("CBaseFilter2_SetSyncSource", This);
|
|
485 return E_NOTIMPL;
|
|
486 }
|
|
487
|
|
488 static long STDCALL CBaseFilter2_GetSyncSource(IBaseFilter* This,
|
|
489 /* [out] */ IReferenceClock** pClock)
|
|
490 {
|
|
491 Debug unimplemented("CBaseFilter2_GetSyncSource", This);
|
|
492 return E_NOTIMPL;
|
|
493 }
|
|
494
|
|
495 static long STDCALL CBaseFilter2_EnumPins(IBaseFilter* This,
|
|
496 /* [out] */ IEnumPins** ppEnum)
|
168
|
497 {
|
3056
|
498 Debug printf("CBaseFilter2_EnumPins(%p) called\n", This);
|
|
499 *ppEnum = (IEnumPins*) CEnumPinsCreate(((CBaseFilter2*)This)->pin, 0);
|
|
500 return 0;
|
|
501 }
|
|
502
|
|
503 static long STDCALL CBaseFilter2_FindPin(IBaseFilter* This,
|
|
504 /* [string][in] */ const unsigned short* Id,
|
|
505 /* [out] */ IPin** ppPin)
|
|
506 {
|
|
507 Debug unimplemented("CBaseFilter2_FindPin", This);
|
|
508 return E_NOTIMPL;
|
|
509 }
|
|
510
|
|
511 static long STDCALL CBaseFilter2_QueryFilterInfo(IBaseFilter* This,
|
|
512 // /* [out] */ FILTER_INFO *pInfo)
|
|
513 void* pInfo)
|
|
514 {
|
|
515 Debug unimplemented("CBaseFilter2_QueryFilterInfo", This);
|
|
516 return E_NOTIMPL;
|
|
517 }
|
|
518
|
|
519 static long STDCALL CBaseFilter2_JoinFilterGraph(IBaseFilter* This,
|
|
520 /* [in] */ IFilterGraph* pGraph,
|
|
521 /* [string][in] */
|
|
522 const unsigned short* pName)
|
|
523 {
|
|
524 Debug unimplemented("CBaseFilter2_JoinFilterGraph", This);
|
168
|
525 return E_NOTIMPL;
|
1545
|
526 }
|
168
|
527
|
3056
|
528 static long STDCALL CBaseFilter2_QueryVendorInfo(IBaseFilter* This,
|
|
529 /* [string][out] */
|
|
530 unsigned short** pVendorInfo)
|
168
|
531 {
|
3056
|
532 Debug unimplemented("CBaseFilter2_QueryVendorInfo", This);
|
168
|
533 return E_NOTIMPL;
|
1545
|
534 }
|
168
|
535
|
3056
|
536 static IPin* CBaseFilter2_GetPin(CBaseFilter2* This)
|
|
537 {
|
|
538 return This->pin;
|
|
539 }
|
1545
|
540
|
3056
|
541 static void CBaseFilter2_Destroy(CBaseFilter2* This)
|
168
|
542 {
|
3130
|
543 Debug printf("CBaseFilter2_Destroy(%p) called\n", This);
|
3056
|
544 This->pin->vt->Release((IUnknown*) This->pin);
|
|
545 free(This->vt);
|
|
546 free(This);
|
1545
|
547 }
|
168
|
548
|
3056
|
549 IMPLEMENT_IUNKNOWN(CBaseFilter2)
|
1545
|
550
|
3056
|
551 static GUID CBaseFilter2_interf1 =
|
|
552 {0x76c61a30, 0xebe1, 0x11cf, {0x89, 0xf9, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb}};
|
|
553 static GUID CBaseFilter2_interf2 =
|
|
554 {0xaae7e4e2, 0x6388, 0x11d1, {0x8d, 0x93, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2}};
|
|
555 static GUID CBaseFilter2_interf3 =
|
|
556 {0x02ef04dd, 0x7580, 0x11d1, {0xbe, 0xce, 0x00, 0xc0, 0x4f, 0xb6, 0xe9, 0x37}};
|
|
557
|
|
558 CBaseFilter2* CBaseFilter2Create()
|
168
|
559 {
|
3056
|
560 CBaseFilter2* This = (CBaseFilter2*) malloc(sizeof(CBaseFilter2));
|
|
561
|
|
562 This->refcount = 1;
|
|
563 This->pin = (IPin*) CRemotePin2Create(This);
|
|
564
|
|
565 This->vt = (IBaseFilter_vt*) malloc(sizeof(IBaseFilter_vt));
|
|
566 memset(This->vt, 0, sizeof(IBaseFilter_vt));
|
|
567 This->vt->QueryInterface = CBaseFilter2_QueryInterface;
|
|
568 This->vt->AddRef = CBaseFilter2_AddRef;
|
|
569 This->vt->Release = CBaseFilter2_Release;
|
|
570 This->vt->GetClassID = CBaseFilter2_GetClassID;
|
|
571 This->vt->Stop = CBaseFilter2_Stop;
|
|
572 This->vt->Pause = CBaseFilter2_Pause;
|
|
573 This->vt->Run = CBaseFilter2_Run;
|
|
574 This->vt->GetState = CBaseFilter2_GetState;
|
|
575 This->vt->SetSyncSource = CBaseFilter2_SetSyncSource;
|
|
576 This->vt->GetSyncSource = CBaseFilter2_GetSyncSource;
|
|
577 This->vt->EnumPins = CBaseFilter2_EnumPins;
|
|
578 This->vt->FindPin = CBaseFilter2_FindPin;
|
|
579 This->vt->QueryFilterInfo = CBaseFilter2_QueryFilterInfo;
|
|
580 This->vt->JoinFilterGraph = CBaseFilter2_JoinFilterGraph;
|
|
581 This->vt->QueryVendorInfo = CBaseFilter2_QueryVendorInfo;
|
|
582
|
|
583 This->GetPin = CBaseFilter2_GetPin;
|
|
584
|
|
585 This->interfaces[0] = IID_IUnknown;
|
|
586 This->interfaces[1] = IID_IBaseFilter;
|
|
587 This->interfaces[2] = CBaseFilter2_interf1;
|
|
588 This->interfaces[3] = CBaseFilter2_interf2;
|
|
589 This->interfaces[4] = CBaseFilter2_interf3;
|
|
590
|
|
591 return This;
|
1545
|
592 }
|
168
|
593
|
1545
|
594
|
3056
|
595 /*************
|
|
596 * CRemotePin
|
|
597 *************/
|
1545
|
598
|
168
|
599
|
3056
|
600 static long STDCALL CRemotePin_ConnectedTo(IPin* This, /* [out] */ IPin** pPin)
|
168
|
601 {
|
3056
|
602 Debug printf("CRemotePin_ConnectedTo(%p) called\n", This);
|
1545
|
603 if (!pPin)
|
|
604 return E_INVALIDARG;
|
3056
|
605 *pPin = ((CRemotePin*)This)->remote_pin;
|
1545
|
606 (*pPin)->vt->AddRef((IUnknown*)(*pPin));
|
|
607 return 0;
|
|
608 }
|
168
|
609
|
3056
|
610 static long STDCALL CRemotePin_QueryDirection(IPin* This,
|
3130
|
611 /* [out] */ PIN_DIRECTION* pPinDir)
|
1545
|
612 {
|
3056
|
613 Debug printf("CRemotePin_QueryDirection(%p) called\n", This);
|
1545
|
614 if (!pPinDir)
|
|
615 return E_INVALIDARG;
|
|
616 *pPinDir=PINDIR_INPUT;
|
|
617 return 0;
|
|
618 }
|
|
619
|
|
620 static long STDCALL CRemotePin_ConnectionMediaType(IPin* This, /* [out] */ AM_MEDIA_TYPE* pmt)
|
168
|
621 {
|
3056
|
622 Debug unimplemented("CRemotePin_ConnectionMediaType", This);
|
168
|
623 return E_NOTIMPL;
|
|
624 }
|
|
625
|
1545
|
626 static long STDCALL CRemotePin_QueryPinInfo(IPin* This, /* [out] */ PIN_INFO* pInfo)
|
168
|
627 {
|
1545
|
628 CBaseFilter* lparent = ((CRemotePin*)This)->parent;
|
3056
|
629 Debug printf("CRemotePin_QueryPinInfo(%p) called\n", This);
|
|
630 pInfo->dir= PINDIR_INPUT;
|
|
631 pInfo->pFilter = (IBaseFilter*) lparent;
|
1545
|
632 lparent->vt->AddRef((IUnknown*)lparent);
|
|
633 pInfo->achName[0]=0;
|
|
634 return 0;
|
|
635 }
|
|
636
|
3056
|
637 static void CRemotePin_Destroy(CRemotePin* This)
|
|
638 {
|
|
639 Debug printf("CRemotePin_Destroy(%p) called\n", This);
|
|
640 free(This->vt);
|
|
641 free(This);
|
|
642 }
|
|
643
|
|
644 IMPLEMENT_IUNKNOWN(CRemotePin)
|
|
645
|
|
646 CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin)
|
|
647 {
|
|
648 CRemotePin* This = (CRemotePin*) malloc(sizeof(CRemotePin));
|
|
649 Debug printf("CRemotePinCreate() called -> %p\n", This);
|
|
650
|
|
651 This->parent = pt;
|
|
652 This->remote_pin = rpin;
|
|
653 This->refcount = 1;
|
|
654
|
|
655 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
|
|
656 memset(This->vt, 0, sizeof(IPin_vt));
|
|
657 This->vt->QueryInterface = CRemotePin_QueryInterface;
|
|
658 This->vt->AddRef = CRemotePin_AddRef;
|
|
659 This->vt->Release = CRemotePin_Release;
|
|
660 This->vt->QueryDirection = CRemotePin_QueryDirection;
|
|
661 This->vt->ConnectedTo = CRemotePin_ConnectedTo;
|
|
662 This->vt->ConnectionMediaType = CRemotePin_ConnectionMediaType;
|
|
663 This->vt->QueryPinInfo = CRemotePin_QueryPinInfo;
|
|
664
|
|
665 This->interfaces[0] = IID_IUnknown;
|
|
666
|
|
667 return This;
|
|
668 }
|
|
669
|
|
670
|
|
671 /*************
|
3130
|
672 * CRemotePin2
|
3056
|
673 *************/
|
|
674
|
1545
|
675
|
3130
|
676 static long STDCALL CRemotePin2_QueryPinInfo(IPin* This,
|
|
677 /* [out] */ PIN_INFO* pInfo)
|
1545
|
678 {
|
|
679 CBaseFilter2* lparent=((CRemotePin2*)This)->parent;
|
3056
|
680 Debug printf("CRemotePin2_QueryPinInfo(%p) called\n", This);
|
1545
|
681 pInfo->pFilter=(IBaseFilter*)lparent;
|
|
682 lparent->vt->AddRef((IUnknown*)lparent);
|
|
683 pInfo->dir=PINDIR_OUTPUT;
|
168
|
684 pInfo->achName[0]=0;
|
|
685 return 0;
|
|
686 }
|
1545
|
687
|
3130
|
688 // FIXME - not being released!
|
3056
|
689 static void CRemotePin2_Destroy(CRemotePin2* This)
|
1545
|
690 {
|
3056
|
691 Debug printf("CRemotePin2_Destroy(%p) called\n", This);
|
|
692 free(This->vt);
|
|
693 free(This);
|
1545
|
694 }
|
|
695
|
3056
|
696 IMPLEMENT_IUNKNOWN(CRemotePin2)
|
|
697
|
|
698 CRemotePin2* CRemotePin2Create(CBaseFilter2* p)
|
1545
|
699 {
|
3056
|
700 CRemotePin2* This = (CRemotePin2*) malloc(sizeof(CRemotePin2));
|
|
701 Debug printf("CRemotePin2Create() called -> %p\n", This);
|
|
702
|
|
703 This->parent = p;
|
|
704 This->refcount = 1;
|
|
705
|
|
706 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
|
|
707 memset(This->vt, 0, sizeof(IPin_vt));
|
|
708 This->vt->QueryInterface = CRemotePin2_QueryInterface;
|
|
709 This->vt->AddRef = CRemotePin2_AddRef;
|
|
710 This->vt->Release = CRemotePin2_Release;
|
|
711 This->vt->QueryPinInfo = CRemotePin2_QueryPinInfo;
|
|
712
|
|
713 This->interfaces[0] = IID_IUnknown;
|
|
714
|
|
715 return This;
|
1545
|
716 }
|