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