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