comparison loader/dshow/inputpin.c @ 3056:213b35f84cf3

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