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