3056
|
1
|
2069
|
2 #include "wine/winerror.h"
|
3056
|
3 #include "wine/windef.h"
|
|
4 #include "outputpin.h"
|
|
5 #include <stdio.h>
|
|
6 #include <string.h>
|
713
|
7
|
168
|
8 /*
|
|
9 An object beyond interface IEnumMediaTypes.
|
|
10 Returned by COutputPin through call IPin::EnumMediaTypes().
|
|
11 */
|
|
12
|
3467
|
13 static int unimplemented(const char* s, void* p)
|
|
14 {
|
|
15 Debug printf("%s(%p) called (UNIMPLEMENTED)", s, p);
|
|
16 return E_NOTIMPL;
|
|
17 }
|
|
18
|
3056
|
19 typedef struct CEnumMediaTypes
|
168
|
20 {
|
3056
|
21 IEnumMediaTypes_vt* vt;
|
3467
|
22 DECLARE_IUNKNOWN();
|
168
|
23 AM_MEDIA_TYPE type;
|
3056
|
24 GUID interfaces[2];
|
|
25 } CEnumMediaTypes;
|
1545
|
26
|
168
|
27
|
1545
|
28 static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
|
|
29 /* [in] */ ULONG cMediaTypes,
|
|
30 /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes,
|
|
31 /* [out] */ ULONG *pcFetched)
|
168
|
32 {
|
3056
|
33 AM_MEDIA_TYPE* type = &((CEnumMediaTypes*)This)->type;
|
3467
|
34 Debug printf("CEnumMediaTypes::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
|
|
42 if (pcFetched)
|
|
43 *pcFetched=1;
|
|
44 ppMediaTypes[0] = (AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
|
3056
|
45 // copy structures - C can handle this...
|
|
46 **ppMediaTypes = *type;
|
1545
|
47 if (ppMediaTypes[0]->pbFormat)
|
168
|
48 {
|
|
49 ppMediaTypes[0]->pbFormat=(char *)CoTaskMemAlloc(ppMediaTypes[0]->cbFormat);
|
3056
|
50 memcpy(ppMediaTypes[0]->pbFormat, type->pbFormat, ppMediaTypes[0]->cbFormat);
|
168
|
51 }
|
1545
|
52 if (cMediaTypes == 1)
|
|
53 return 0;
|
168
|
54 return 1;
|
|
55 }
|
1545
|
56
|
|
57 /* I expect that these methods are unused. */
|
|
58 static HRESULT STDCALL CEnumMediaTypes_Skip(IEnumMediaTypes * This,
|
|
59 /* [in] */ ULONG cMediaTypes)
|
168
|
60 {
|
3467
|
61 Debug unimplemented("CEnumMediaTypes::Skip", This);
|
168
|
62 return E_NOTIMPL;
|
|
63 }
|
|
64
|
1545
|
65 static HRESULT STDCALL CEnumMediaTypes_Reset(IEnumMediaTypes * This)
|
168
|
66 {
|
3467
|
67 Debug printf("CEnumMediaTypes::Reset(%p) called\n", This);
|
168
|
68 return 0;
|
|
69 }
|
|
70
|
1545
|
71 static HRESULT STDCALL CEnumMediaTypes_Clone(IEnumMediaTypes * This,
|
|
72 /* [out] */ IEnumMediaTypes **ppEnum)
|
168
|
73 {
|
3467
|
74 Debug printf("CEnumMediaTypes::Clone(%p) called\n", This);
|
168
|
75 return E_NOTIMPL;
|
|
76 }
|
|
77
|
3056
|
78 void CEnumMediaTypes_Destroy(CEnumMediaTypes* This)
|
1545
|
79 {
|
3056
|
80 free(This->vt);
|
|
81 free(This);
|
|
82 }
|
|
83
|
|
84 // IPin->IUnknown methods
|
|
85 IMPLEMENT_IUNKNOWN(CEnumMediaTypes)
|
1545
|
86
|
3056
|
87 CEnumMediaTypes* CEnumMediaTypesCreate(const AM_MEDIA_TYPE* amt)
|
|
88 {
|
|
89 CEnumMediaTypes *This = (CEnumMediaTypes*) malloc(sizeof(CEnumMediaTypes)) ;
|
3467
|
90
|
|
91 if (!This)
|
|
92 return NULL;
|
|
93
|
|
94 This->vt = (IEnumMediaTypes_vt*) malloc(sizeof(IEnumMediaTypes_vt));
|
|
95 if (!This->vt)
|
|
96 {
|
|
97 free(This);
|
|
98 return NULL;
|
|
99 }
|
|
100
|
3056
|
101 This->refcount = 1;
|
|
102 This->type = *amt;
|
|
103
|
|
104 This->vt->QueryInterface = CEnumMediaTypes_QueryInterface;
|
|
105 This->vt->AddRef = CEnumMediaTypes_AddRef;
|
|
106 This->vt->Release = CEnumMediaTypes_Release;
|
|
107 This->vt->Next = CEnumMediaTypes_Next;
|
|
108 This->vt->Skip = CEnumMediaTypes_Skip;
|
|
109 This->vt->Reset = CEnumMediaTypes_Reset;
|
|
110 This->vt->Clone = CEnumMediaTypes_Clone;
|
|
111
|
|
112 This->interfaces[0] = IID_IUnknown;
|
|
113 This->interfaces[1] = IID_IEnumMediaTypes;
|
|
114
|
|
115 return This;
|
1545
|
116 }
|
|
117
|
|
118
|
3056
|
119 /*************
|
|
120 * COutputPin
|
|
121 *************/
|
168
|
122
|
1545
|
123
|
|
124 static HRESULT STDCALL COutputPin_QueryInterface(IUnknown* This, GUID* iid, void** ppv)
|
168
|
125 {
|
3056
|
126 COutputPin* p = (COutputPin*) This;
|
|
127
|
1545
|
128 Debug printf("COutputPin_QueryInterface(%p) called\n", This);
|
|
129 if (!ppv)
|
|
130 return E_INVALIDARG;
|
|
131
|
|
132 if (memcmp(iid, &IID_IUnknown, 16) == 0)
|
168
|
133 {
|
1545
|
134 *ppv = p;
|
|
135 p->vt->AddRef(This);
|
|
136 return 0;
|
168
|
137 }
|
1545
|
138 if (memcmp(iid, &IID_IMemInputPin, 16) == 0)
|
168
|
139 {
|
1545
|
140 *ppv = p->mempin;
|
|
141 p->mempin->vt->AddRef((IUnknown*)*ppv);
|
168
|
142 return 0;
|
|
143 }
|
|
144
|
3467
|
145 Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-"
|
713
|
146 "%02x%02x%02x%02x%02x%02x\n",
|
|
147 iid->f1, iid->f2, iid->f3,
|
|
148 (unsigned char)iid->f4[1], (unsigned char)iid->f4[0],
|
|
149 (unsigned char)iid->f4[2], (unsigned char)iid->f4[3],
|
|
150 (unsigned char)iid->f4[4], (unsigned char)iid->f4[5],
|
|
151 (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]);
|
1545
|
152 return E_NOINTERFACE;
|
168
|
153 }
|
|
154
|
|
155 // IPin methods
|
1545
|
156 static HRESULT STDCALL COutputPin_Connect(IPin * This,
|
|
157 /* [in] */ IPin *pReceivePin,
|
|
158 /* [in] */ /* const */ AM_MEDIA_TYPE *pmt)
|
168
|
159 {
|
1545
|
160 Debug printf("COutputPin_Connect() called\n");
|
168
|
161 /*
|
|
162 *pmt=((COutputPin*)This)->type;
|
|
163 if(pmt->cbFormat>0)
|
|
164 {
|
|
165 pmt->pbFormat=CoTaskMemAlloc(pmt->cbFormat);
|
|
166 memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
|
3056
|
167 }
|
168
|
168 */
|
1545
|
169 //return E_NOTIMPL;
|
|
170 return 0;// XXXXXXXXXXXXX CHECKME XXXXXXXXXXXXXXX
|
168
|
171 // if I put return 0; here, it crashes
|
|
172 }
|
|
173
|
1545
|
174 static HRESULT STDCALL COutputPin_ReceiveConnection(IPin * This,
|
|
175 /* [in] */ IPin *pConnector,
|
|
176 /* [in] */ const AM_MEDIA_TYPE *pmt)
|
168
|
177 {
|
3467
|
178 Debug printf("COutputPin_ReceiveConnection(%p) called\n", This);
|
|
179 ((COutputPin*)This)->remote = pConnector;
|
168
|
180 return 0;
|
|
181 }
|
1545
|
182
|
|
183 static HRESULT STDCALL COutputPin_Disconnect(IPin * This)
|
168
|
184 {
|
3467
|
185 Debug printf("COutputPin_Disconnect(%p) called\n", This);
|
168
|
186 return 1;
|
|
187 }
|
|
188
|
1545
|
189 static HRESULT STDCALL COutputPin_ConnectedTo(IPin * This,
|
|
190 /* [out] */ IPin **pPin)
|
|
191 {
|
3467
|
192 Debug printf("COutputPin_ConnectedTo(%p) called\n", This);
|
1545
|
193 if (!pPin)
|
|
194 return E_INVALIDARG;
|
|
195 *pPin = ((COutputPin*)This)->remote;
|
|
196 return 0;
|
|
197 }
|
168
|
198
|
1545
|
199 static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This,
|
|
200 /* [out] */ AM_MEDIA_TYPE *pmt)
|
|
201 {
|
|
202 Debug printf("CInputPin::ConnectionMediaType() called\n");
|
|
203 if (!pmt)
|
|
204 return E_INVALIDARG;
|
|
205 *pmt = ((COutputPin*)This)->type;
|
|
206 if (pmt->cbFormat>0)
|
|
207 {
|
|
208 pmt->pbFormat=(char *)CoTaskMemAlloc(pmt->cbFormat);
|
|
209 memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat);
|
|
210 }
|
|
211 return 0;
|
|
212 }
|
|
213
|
|
214 static HRESULT STDCALL COutputPin_QueryPinInfo(IPin * This,
|
|
215 /* [out] */ PIN_INFO *pInfo)
|
|
216 {
|
3467
|
217 Debug unimplemented("COutputPin_QueryPinInfo", This);
|
1545
|
218 return E_NOTIMPL;
|
|
219 }
|
|
220
|
|
221 static HRESULT STDCALL COutputPin_QueryDirection(IPin * This,
|
|
222 /* [out] */ PIN_DIRECTION *pPinDir)
|
|
223 {
|
3467
|
224 Debug printf("COutputPin_QueryDirection(%p) called\n", This);
|
1545
|
225 if (!pPinDir)
|
|
226 return E_INVALIDARG;
|
|
227 *pPinDir = PINDIR_INPUT;
|
|
228 return 0;
|
|
229 }
|
|
230
|
|
231 static HRESULT STDCALL COutputPin_QueryId(IPin * This,
|
|
232 /* [out] */ LPWSTR *Id)
|
|
233 {
|
3467
|
234 Debug unimplemented("COutputPin_QueryId", This);
|
1545
|
235 return E_NOTIMPL;
|
|
236 }
|
|
237
|
|
238 static HRESULT STDCALL COutputPin_QueryAccept(IPin * This,
|
|
239 /* [in] */ const AM_MEDIA_TYPE *pmt)
|
168
|
240 {
|
3467
|
241 Debug unimplemented("COutputPin_QueryAccept", This);
|
1545
|
242 return E_NOTIMPL;
|
|
243 }
|
|
244
|
|
245 static HRESULT STDCALL COutputPin_EnumMediaTypes(IPin * This,
|
|
246 /* [out] */ IEnumMediaTypes **ppEnum)
|
|
247 {
|
|
248 Debug printf("COutputPin_EnumMediaTypes() called\n");
|
|
249 if (!ppEnum)
|
|
250 return E_INVALIDARG;
|
3056
|
251 *ppEnum = (IEnumMediaTypes*) CEnumMediaTypesCreate(&((COutputPin*)This)->type);
|
1545
|
252 return 0;
|
|
253 }
|
|
254
|
|
255 static HRESULT STDCALL COutputPin_QueryInternalConnections(IPin * This,
|
|
256 /* [out] */ IPin **apPin,
|
|
257 /* [out][in] */ ULONG *nPin)
|
|
258 {
|
3467
|
259 Debug unimplemented("COutputPin_QueryInternalConnections", This);
|
1545
|
260 return E_NOTIMPL;
|
|
261 }
|
|
262
|
|
263 static HRESULT STDCALL COutputPin_EndOfStream(IPin * This)
|
|
264 {
|
3467
|
265 Debug unimplemented("COutputPin_EndOfStream", This);
|
1545
|
266 return E_NOTIMPL;
|
|
267 }
|
|
268
|
|
269 static HRESULT STDCALL COutputPin_BeginFlush(IPin * This)
|
|
270 {
|
3467
|
271 Debug unimplemented("COutputPin_BeginFlush", This);
|
1545
|
272 return E_NOTIMPL;
|
|
273 }
|
|
274
|
|
275 static HRESULT STDCALL COutputPin_EndFlush(IPin * This)
|
|
276 {
|
3467
|
277 Debug unimplemented("COutputPin_EndFlush", This);
|
1545
|
278 return E_NOTIMPL;
|
|
279 }
|
|
280
|
|
281 static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
|
|
282 /* [in] */ REFERENCE_TIME tStart,
|
|
283 /* [in] */ REFERENCE_TIME tStop,
|
|
284 /* [in] */ double dRate)
|
|
285 {
|
3056
|
286 Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
|
1545
|
287 tStart, tStop, dRate);
|
168
|
288 return 0;
|
|
289 }
|
|
290
|
|
291
|
|
292
|
|
293 // IMemInputPin->IUnknown methods
|
|
294
|
1545
|
295 static HRESULT STDCALL COutputPin_M_QueryInterface(IUnknown* This, GUID* iid, void** ppv)
|
168
|
296 {
|
3056
|
297 COutputPin* p = (COutputPin*)This;
|
|
298
|
|
299 Debug printf("COutputPin_M_QueryInterface(%p) called\n", This);
|
1545
|
300 if (!ppv)
|
|
301 return E_INVALIDARG;
|
|
302
|
168
|
303 if(!memcmp(iid, &IID_IUnknown, 16))
|
|
304 {
|
3467
|
305 *ppv = p;
|
1545
|
306 p->vt->AddRef(This);
|
168
|
307 return 0;
|
|
308 }
|
1545
|
309 /*if(!memcmp(iid, &IID_IPin, 16))
|
168
|
310 {
|
|
311 COutputPin* ptr=(COutputPin*)(This-1);
|
|
312 *ppv=(void*)ptr;
|
|
313 AddRef((IUnknown*)ptr);
|
|
314 return 0;
|
|
315 }*/
|
|
316 if(!memcmp(iid, &IID_IMemInputPin, 16))
|
|
317 {
|
3467
|
318 *ppv = p->mempin;
|
1545
|
319 p->mempin->vt->AddRef(This);
|
168
|
320 return 0;
|
|
321 }
|
|
322 Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-" \
|
1545
|
323 "%02x%02x%02x%02x%02x%02x\n",
|
|
324 iid->f1, iid->f2, iid->f3,
|
|
325 (unsigned char)iid->f4[1], (unsigned char)iid->f4[0],
|
|
326 (unsigned char)iid->f4[2], (unsigned char)iid->f4[3],
|
|
327 (unsigned char)iid->f4[4], (unsigned char)iid->f4[5],
|
|
328 (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]);
|
|
329 return E_NOINTERFACE;
|
168
|
330 }
|
|
331
|
|
332 // IMemInputPin methods
|
|
333
|
3056
|
334 static HRESULT STDCALL COutputPin_GetAllocator(IMemInputPin* This,
|
|
335 /* [out] */ IMemAllocator** ppAllocator)
|
168
|
336 {
|
1545
|
337 Debug printf("COutputPin_GetAllocator(%p, %p) called\n", This->vt, ppAllocator);
|
3056
|
338 *ppAllocator = (IMemAllocator*) MemAllocatorCreate();
|
168
|
339 return 0;
|
|
340 }
|
3056
|
341
|
|
342 static HRESULT STDCALL COutputPin_NotifyAllocator(IMemInputPin* This,
|
|
343 /* [in] */ IMemAllocator* pAllocator,
|
1545
|
344 /* [in] */ int bReadOnly)
|
168
|
345 {
|
1545
|
346 Debug printf("COutputPin_NotifyAllocator(%p, %p) called\n", This, pAllocator);
|
|
347 ((COutputMemPin*)This)->pAllocator = (MemAllocator*) pAllocator;
|
168
|
348 return 0;
|
|
349 }
|
|
350
|
3056
|
351 static HRESULT STDCALL COutputPin_GetAllocatorRequirements(IMemInputPin* This,
|
|
352 /* [out] */ ALLOCATOR_PROPERTIES* pProps)
|
168
|
353 {
|
3467
|
354 Debug unimplemented("COutputPin_GetAllocatorRequirements", This);
|
168
|
355 return E_NOTIMPL;
|
|
356 }
|
|
357
|
3056
|
358 static HRESULT STDCALL COutputPin_Receive(IMemInputPin* This,
|
|
359 /* [in] */ IMediaSample* pSample)
|
168
|
360 {
|
3056
|
361 COutputMemPin* mp = (COutputMemPin*)This;
|
|
362 char* pointer;
|
|
363 int len;
|
|
364
|
1545
|
365 Debug printf("COutputPin_Receive(%p) called\n", This);
|
|
366 if (!pSample)
|
|
367 return E_INVALIDARG;
|
3056
|
368 if (pSample->vt->GetPointer(pSample, (BYTE**) &pointer))
|
168
|
369 return -1;
|
3056
|
370 len = pSample->vt->GetActualDataLength(pSample);
|
1545
|
371 if (len == 0)
|
|
372 len = pSample->vt->GetSize(pSample);//for iv50
|
168
|
373 //if(me.frame_pointer)memcpy(me.frame_pointer, pointer, len);
|
1545
|
374
|
|
375 if (mp->frame_pointer)
|
|
376 *(mp->frame_pointer) = pointer;
|
|
377 if (mp->frame_size_pointer)
|
|
378 *(mp->frame_size_pointer) = len;
|
168
|
379 /*
|
|
380 FILE* file=fopen("./uncompr.bmp", "wb");
|
|
381 char head[14]={0x42, 0x4D, 0x36, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00};
|
|
382 *(int*)(&head[2])=len+0x36;
|
|
383 fwrite(head, 14, 1, file);
|
|
384 fwrite(&((VIDEOINFOHEADER*)me.type.pbFormat)->bmiHeader, sizeof(BITMAPINFOHEADER), 1, file);
|
|
385 fwrite(pointer, len, 1, file);
|
|
386 fclose(file);
|
3056
|
387 */
|
168
|
388 // pSample->vt->Release((IUnknown*)pSample);
|
3056
|
389
|
168
|
390 return 0;
|
|
391 }
|
|
392
|
1545
|
393 static HRESULT STDCALL COutputPin_ReceiveMultiple(IMemInputPin * This,
|
|
394 /* [size_is][in] */ IMediaSample **pSamples,
|
|
395 /* [in] */ long nSamples,
|
|
396 /* [out] */ long *nSamplesProcessed)
|
168
|
397 {
|
3467
|
398 Debug unimplemented("COutputPin_ReceiveMultiple", This);
|
1545
|
399 return E_NOTIMPL;
|
|
400 }
|
|
401
|
|
402 static HRESULT STDCALL COutputPin_ReceiveCanBlock(IMemInputPin * This)
|
|
403 {
|
3467
|
404 Debug unimplemented("COutputPin_ReceiveCanBlock", This);
|
168
|
405 return E_NOTIMPL;
|
|
406 }
|
|
407
|
3056
|
408 static void COutputPin_SetFramePointer(COutputPin* This, char** z)
|
|
409 {
|
|
410 This->mempin->frame_pointer = z;
|
|
411 }
|
|
412
|
|
413 static void COutputPin_SetPointer2(COutputPin* This, char* p)
|
|
414 {
|
|
415 if (This->mempin->pAllocator)
|
|
416 // fixme
|
|
417 This->mempin->pAllocator->SetPointer(This->mempin->pAllocator, p);
|
|
418 }
|
|
419
|
|
420 static void COutputPin_SetFrameSizePointer(COutputPin* This, long* z)
|
|
421 {
|
|
422 This->mempin->frame_size_pointer = z;
|
|
423 }
|
|
424
|
|
425 static void COutputPin_SetNewFormat(COutputPin* This, const AM_MEDIA_TYPE* amt)
|
|
426 {
|
|
427 This->type = *amt;
|
|
428 }
|
|
429
|
|
430 static void COutputPin_Destroy(COutputPin* This)
|
168
|
431 {
|
3467
|
432 if (This->mempin->vt)
|
|
433 free(This->mempin->vt);
|
|
434 if (This->mempin)
|
|
435 free(This->mempin);
|
|
436 if (This->vt)
|
|
437 free(This->vt);
|
3056
|
438 free(This);
|
|
439 }
|
|
440
|
|
441 static HRESULT STDCALL COutputPin_AddRef(IUnknown* This)
|
|
442 {
|
3467
|
443 Debug printf("COutputPin_AddRef(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
|
3056
|
444 ((COutputPin*)This)->refcount++;
|
|
445 return 0;
|
|
446 }
|
1545
|
447
|
3056
|
448 static HRESULT STDCALL COutputPin_Release(IUnknown* This)
|
|
449 {
|
3467
|
450 Debug printf("COutputPin_Release(%p) called (%d)\n", This, ((COutputPin*)This)->refcount);
|
|
451 if (--((COutputPin*)This)->refcount <= 0)
|
3056
|
452 COutputPin_Destroy((COutputPin*)This);
|
1545
|
453
|
3056
|
454 return 0;
|
|
455 }
|
|
456
|
|
457 static HRESULT STDCALL COutputPin_M_AddRef(IUnknown* This)
|
|
458 {
|
|
459 COutputMemPin* p = (COutputMemPin*) This;
|
3467
|
460 Debug printf("COutputPin_MAddRef(%p) called (%p, %d)\n", p, p->parent, p->parent->refcount);
|
3056
|
461 p->parent->refcount++;
|
|
462 return 0;
|
168
|
463 }
|
1545
|
464
|
3056
|
465 static HRESULT STDCALL COutputPin_M_Release(IUnknown* This)
|
|
466 {
|
|
467 COutputMemPin* p = (COutputMemPin*) This;
|
|
468 Debug printf("COutputPin_MRelease(%p) called (%p, %d)\n",
|
|
469 p, p->parent, p->parent->refcount);
|
|
470 if (--p->parent->refcount <= 0)
|
|
471 COutputPin_Destroy(p->parent);
|
|
472 return 0;
|
|
473 }
|
|
474
|
|
475 COutputPin* COutputPinCreate(const AM_MEDIA_TYPE* amt)
|
1545
|
476 {
|
3056
|
477 COutputPin* This = (COutputPin*) malloc(sizeof(COutputPin));
|
3467
|
478 IMemInputPin_vt* ivt;
|
|
479
|
|
480 if (!This)
|
|
481 return NULL;
|
|
482
|
|
483 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt));
|
|
484 This->mempin = (COutputMemPin*) malloc(sizeof(COutputMemPin));
|
|
485 ivt = (IMemInputPin_vt*) malloc(sizeof(IMemInputPin_vt));
|
|
486
|
|
487 if (!This->vt || !This->mempin || !ivt)
|
|
488 {
|
|
489 COutputPin_Destroy(This);
|
|
490 return NULL;
|
|
491 }
|
|
492
|
|
493 This->mempin->vt = ivt;
|
|
494
|
3056
|
495 This->refcount = 1;
|
|
496 This->remote = 0;
|
|
497 This->type = *amt;
|
3467
|
498
|
3056
|
499 This->vt->QueryInterface = COutputPin_QueryInterface;
|
|
500 This->vt->AddRef = COutputPin_AddRef;
|
|
501 This->vt->Release = COutputPin_Release;
|
|
502 This->vt->Connect = COutputPin_Connect;
|
|
503 This->vt->ReceiveConnection = COutputPin_ReceiveConnection;
|
|
504 This->vt->Disconnect = COutputPin_Disconnect;
|
|
505 This->vt->ConnectedTo = COutputPin_ConnectedTo;
|
|
506 This->vt->ConnectionMediaType = COutputPin_ConnectionMediaType;
|
|
507 This->vt->QueryPinInfo = COutputPin_QueryPinInfo;
|
|
508 This->vt->QueryDirection = COutputPin_QueryDirection;
|
|
509 This->vt->QueryId = COutputPin_QueryId;
|
|
510 This->vt->QueryAccept = COutputPin_QueryAccept;
|
|
511 This->vt->EnumMediaTypes = COutputPin_EnumMediaTypes;
|
|
512 This->vt->QueryInternalConnections = COutputPin_QueryInternalConnections;
|
|
513 This->vt->EndOfStream = COutputPin_EndOfStream;
|
|
514 This->vt->BeginFlush = COutputPin_BeginFlush;
|
|
515 This->vt->EndFlush = COutputPin_EndFlush;
|
|
516 This->vt->NewSegment = COutputPin_NewSegment;
|
|
517
|
|
518 This->mempin->vt->QueryInterface = COutputPin_M_QueryInterface;
|
|
519 This->mempin->vt->AddRef = COutputPin_M_AddRef;
|
|
520 This->mempin->vt->Release = COutputPin_M_Release;
|
|
521 This->mempin->vt->GetAllocator = COutputPin_GetAllocator;
|
|
522 This->mempin->vt->NotifyAllocator = COutputPin_NotifyAllocator;
|
|
523 This->mempin->vt->GetAllocatorRequirements = COutputPin_GetAllocatorRequirements;
|
|
524 This->mempin->vt->Receive = COutputPin_Receive;
|
|
525 This->mempin->vt->ReceiveMultiple = COutputPin_ReceiveMultiple;
|
|
526 This->mempin->vt->ReceiveCanBlock = COutputPin_ReceiveCanBlock;
|
|
527
|
|
528 This->mempin->frame_size_pointer = 0;
|
|
529 This->mempin->frame_pointer = 0;
|
|
530 This->mempin->pAllocator = 0;
|
3130
|
531 This->mempin->refcount = 1;
|
3056
|
532 This->mempin->parent = This;
|
|
533
|
|
534 This->SetPointer2 = COutputPin_SetPointer2;
|
|
535 This->SetFramePointer = COutputPin_SetFramePointer;
|
|
536 This->SetFrameSizePointer = COutputPin_SetFrameSizePointer;
|
|
537 This->SetNewFormat = COutputPin_SetNewFormat;
|
|
538
|
|
539 return This;
|
1545
|
540 }
|