Mercurial > mplayer.hg
annotate loader/dshow/outputpin.c @ 22251:f2f62540bd0d
smil over realrtsp
author | rtogni |
---|---|
date | Sun, 18 Feb 2007 22:57:47 +0000 |
parents | 0421ee482f38 |
children | 3d1b23cf3d08 |
rev | line source |
---|---|
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9964
diff
changeset
|
1 /* |
18783 | 2 * Modified for use with MPlayer, detailed changelog at |
3 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9964
diff
changeset
|
4 * $Id$ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
9964
diff
changeset
|
5 */ |
3056 | 6 |
2069 | 7 #include "wine/winerror.h" |
3056 | 8 #include "wine/windef.h" |
9 #include "outputpin.h" | |
10 #include <stdio.h> | |
11 #include <string.h> | |
7386 | 12 #include <stdlib.h> |
713 | 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 | |
22014 | 20 /** |
21 An object beyond interface IEnumMediaTypes. | |
22 Returned by COutputPin through call IPin::EnumMediaTypes(). | |
23 */ | |
3056 | 24 typedef struct CEnumMediaTypes |
168 | 25 { |
3056 | 26 IEnumMediaTypes_vt* vt; |
3467 | 27 DECLARE_IUNKNOWN(); |
168 | 28 AM_MEDIA_TYPE type; |
3056 | 29 GUID interfaces[2]; |
30 } CEnumMediaTypes; | |
1545 | 31 |
22014 | 32 /** |
33 IMemOutput interface implementation | |
34 */ | |
7386 | 35 struct _COutputMemPin |
36 { | |
37 IMemInputPin_vt* vt; | |
38 DECLARE_IUNKNOWN(); | |
39 char** frame_pointer; | |
40 long* frame_size_pointer; | |
41 MemAllocator* pAllocator; | |
42 COutputPin* parent; | |
43 }; | |
168 | 44 |
22014 | 45 /** |
46 * \brief IEnumMediaTypes:Next (retrives a specified number of media types ) | |
47 * | |
48 * \param[in] This pointer to CEnumMediaTypes object | |
49 * \param[in] cMediaTypes number of media types to retrive | |
50 * \param[out] ppMediaTypes array of AM_MEDIA_TYPE structure pointers of size cMediaTypes | |
51 * \param[out] pcFetched address of variables that receives number of returned media types | |
52 * | |
53 * \return S_OK - success | |
54 * \return S_FALSE - did not return as meny structures as requested | |
55 * \return E_INVALIDARG Invalid argument | |
56 * \return E_POINTER Null pointer | |
57 * \return VFW_E_ENUM_OUT_OF_SYNC - pin's state has changed and is now inconsistent with enumerator | |
58 * | |
59 */ | |
1545 | 60 static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This, |
61 /* [in] */ ULONG cMediaTypes, | |
62 /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes, | |
63 /* [out] */ ULONG *pcFetched) | |
168 | 64 { |
3056 | 65 AM_MEDIA_TYPE* type = &((CEnumMediaTypes*)This)->type; |
3467 | 66 Debug printf("CEnumMediaTypes::Next(%p) called\n", This); |
1545 | 67 if (!ppMediaTypes) |
68 return E_INVALIDARG; | |
69 if (!pcFetched && (cMediaTypes!=1)) | |
70 return E_INVALIDARG; | |
71 if (cMediaTypes <= 0) | |
72 return 0; | |
73 | |
74 if (pcFetched) | |
75 *pcFetched=1; | |
18878 | 76 ppMediaTypes[0] = malloc(sizeof(AM_MEDIA_TYPE)); |
3056 | 77 // copy structures - C can handle this... |
78 **ppMediaTypes = *type; | |
1545 | 79 if (ppMediaTypes[0]->pbFormat) |
168 | 80 { |
18878 | 81 ppMediaTypes[0]->pbFormat=malloc(ppMediaTypes[0]->cbFormat); |
3056 | 82 memcpy(ppMediaTypes[0]->pbFormat, type->pbFormat, ppMediaTypes[0]->cbFormat); |
168 | 83 } |
1545 | 84 if (cMediaTypes == 1) |
85 return 0; | |
168 | 86 return 1; |
87 } | |
1545 | 88 |
89 /* I expect that these methods are unused. */ | |
22014 | 90 |
91 /** | |
92 * \brief IEnumMediaTypes::Skip (skips over a specified number of media types) | |
93 * | |
94 * \param[in] This pointer to CEnumMEdiaTypes object | |
95 * \param[in] cMediaTypes number of media types to skip | |
96 * | |
97 * \return S_OK - success | |
98 * \return S_FALSE - skipped past the end of the sequence | |
99 * \return VFW_E_ENUM_OUT_OF_SYNC - pin's state has changed and is now inconsistent with enumerator | |
100 * | |
101 */ | |
1545 | 102 static HRESULT STDCALL CEnumMediaTypes_Skip(IEnumMediaTypes * This, |
103 /* [in] */ ULONG cMediaTypes) | |
168 | 104 { |
7386 | 105 return output_unimplemented("CEnumMediaTypes::Skip", This); |
168 | 106 } |
107 | |
22014 | 108 /** |
109 * \brief IEnumMediaTypes::Reset (resets enumeration sequence to beginning) | |
110 * | |
111 * \param[in] This pointer to CEnumMEdiaTypes object | |
112 * | |
113 * \return S_OK - success | |
114 * | |
115 */ | |
1545 | 116 static HRESULT STDCALL CEnumMediaTypes_Reset(IEnumMediaTypes * This) |
168 | 117 { |
3467 | 118 Debug printf("CEnumMediaTypes::Reset(%p) called\n", This); |
168 | 119 return 0; |
120 } | |
121 | |
22014 | 122 /** |
123 * \brief IEnumMediaTypes::Clone (makes a copy of enumerator, returned object | |
124 * starts at the same position as original) | |
125 * | |
126 * \param[in] This pointer to CEnumMEdiaTypes object | |
127 * \param[out] ppEnum address of variable that receives pointer to IEnumMediaTypes interface | |
128 * | |
129 * \return S_OK - success | |
130 * \return E_OUTOFMEMRY - Insufficient memory | |
131 * \return E_POINTER - Null pointer | |
132 * \return VFW_E_ENUM_OUT_OF_SYNC - pin's state has changed and is now inconsistent with enumerator | |
133 * | |
134 */ | |
1545 | 135 static HRESULT STDCALL CEnumMediaTypes_Clone(IEnumMediaTypes * This, |
136 /* [out] */ IEnumMediaTypes **ppEnum) | |
168 | 137 { |
3467 | 138 Debug printf("CEnumMediaTypes::Clone(%p) called\n", This); |
168 | 139 return E_NOTIMPL; |
140 } | |
141 | |
22014 | 142 /** |
143 * \brief CEnumMediaTypes destructor | |
144 * | |
145 * \param[in] This pointer to CEnumMediaTypes object | |
146 * | |
147 */ | |
8292 | 148 static void CEnumMediaTypes_Destroy(CEnumMediaTypes* This) |
1545 | 149 { |
3056 | 150 free(This->vt); |
151 free(This); | |
152 } | |
153 | |
22014 | 154 // IEnumMediaTypes->IUnknown methods |
3056 | 155 IMPLEMENT_IUNKNOWN(CEnumMediaTypes) |
1545 | 156 |
22014 | 157 /** |
158 * \brief CEnumMediaTypes constructor | |
159 * | |
160 * \param[in] amt media type for enumerating | |
161 * | |
162 * \return pointer to CEnumMEdiaTypes object or NULL if error occured | |
163 * | |
164 */ | |
8292 | 165 static CEnumMediaTypes* CEnumMediaTypesCreate(const AM_MEDIA_TYPE* amt) |
3056 | 166 { |
167 CEnumMediaTypes *This = (CEnumMediaTypes*) malloc(sizeof(CEnumMediaTypes)) ; | |
3467 | 168 |
169 if (!This) | |
170 return NULL; | |
171 | |
172 This->vt = (IEnumMediaTypes_vt*) malloc(sizeof(IEnumMediaTypes_vt)); | |
173 if (!This->vt) | |
174 { | |
175 free(This); | |
176 return NULL; | |
177 } | |
178 | |
3056 | 179 This->refcount = 1; |
180 This->type = *amt; | |
181 | |
182 This->vt->QueryInterface = CEnumMediaTypes_QueryInterface; | |
183 This->vt->AddRef = CEnumMediaTypes_AddRef; | |
184 This->vt->Release = CEnumMediaTypes_Release; | |
185 This->vt->Next = CEnumMediaTypes_Next; | |
186 This->vt->Skip = CEnumMediaTypes_Skip; | |
187 This->vt->Reset = CEnumMediaTypes_Reset; | |
188 This->vt->Clone = CEnumMediaTypes_Clone; | |
189 | |
190 This->interfaces[0] = IID_IUnknown; | |
191 This->interfaces[1] = IID_IEnumMediaTypes; | |
192 | |
193 return This; | |
1545 | 194 } |
195 | |
196 | |
3056 | 197 /************* |
198 * COutputPin | |
22014 | 199 * |
200 * WARNING: | |
201 * This is implementation of INPUT pin in DirectShow's terms | |
202 * | |
3056 | 203 *************/ |
168 | 204 |
1545 | 205 |
22014 | 206 /** |
207 * | |
208 * \brief IUnknown::QueryInterface (query object for interface) | |
209 * \param[in] This pointer to IUnknown interface | |
210 * \param[in] iid GUID of requested interface | |
211 * \param[out] ppv receives pointer to interface | |
212 * | |
213 * \return S_OK - success (and *ppv contains valid pointer) | |
214 * \return E_NOINTERFACE - interface not found (and *ppv was set NULL) | |
215 * | |
216 * \note | |
217 * Make sure to call Release on received interface when you are done | |
218 * | |
219 */ | |
7386 | 220 static HRESULT STDCALL COutputPin_QueryInterface(IUnknown* This, const GUID* iid, void** ppv) |
168 | 221 { |
3056 | 222 COutputPin* p = (COutputPin*) This; |
223 | |
1545 | 224 Debug printf("COutputPin_QueryInterface(%p) called\n", This); |
225 if (!ppv) | |
226 return E_INVALIDARG; | |
227 | |
228 if (memcmp(iid, &IID_IUnknown, 16) == 0) | |
168 | 229 { |
1545 | 230 *ppv = p; |
231 p->vt->AddRef(This); | |
232 return 0; | |
168 | 233 } |
1545 | 234 if (memcmp(iid, &IID_IMemInputPin, 16) == 0) |
168 | 235 { |
1545 | 236 *ppv = p->mempin; |
237 p->mempin->vt->AddRef((IUnknown*)*ppv); | |
168 | 238 return 0; |
239 } | |
240 | |
3467 | 241 Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-" |
713 | 242 "%02x%02x%02x%02x%02x%02x\n", |
243 iid->f1, iid->f2, iid->f3, | |
244 (unsigned char)iid->f4[1], (unsigned char)iid->f4[0], | |
245 (unsigned char)iid->f4[2], (unsigned char)iid->f4[3], | |
246 (unsigned char)iid->f4[4], (unsigned char)iid->f4[5], | |
247 (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]); | |
1545 | 248 return E_NOINTERFACE; |
168 | 249 } |
250 | |
251 // IPin methods | |
22014 | 252 |
253 /** | |
254 * \brief IPin::Connect (connects pin to another pin) | |
255 * | |
256 * \param[in] This pointer to IPin interface | |
257 * \param[in] pReceivePin pointer to IPin interface of remote pin | |
258 * \param[in] pmt suggested media type for link. Can be NULL (any media type) | |
259 * | |
260 * \return S_OK - success. | |
261 * \return VFW_E_ALREADY_CONNECTED - pin already connected | |
262 * \return VFW_E_NOT_STOPPED - filter is active | |
263 * \return VFW_E_TYPE_NOT_ACCEPT - type is not acceptable | |
264 * \return Apropriate error code otherwise. | |
265 * | |
266 */ | |
1545 | 267 static HRESULT STDCALL COutputPin_Connect(IPin * This, |
268 /* [in] */ IPin *pReceivePin, | |
269 /* [in] */ /* const */ AM_MEDIA_TYPE *pmt) | |
168 | 270 { |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
271 Debug printf("COutputPin_Connect(%p) called\n",This); |
168 | 272 /* |
273 *pmt=((COutputPin*)This)->type; | |
274 if(pmt->cbFormat>0) | |
275 { | |
9964 | 276 pmt->pbFormat=malloc(pmt->cbFormat); |
168 | 277 memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat); |
3056 | 278 } |
168 | 279 */ |
1545 | 280 //return E_NOTIMPL; |
281 return 0;// XXXXXXXXXXXXX CHECKME XXXXXXXXXXXXXXX | |
168 | 282 // if I put return 0; here, it crashes |
283 } | |
284 | |
22014 | 285 /** |
286 * \brief IPin::ReceiveConnection (accepts a connection from another pin) | |
287 * | |
288 * \param[in] This pointer to IPin interface | |
289 * \param[in] pConnector connecting pin's IPin interface | |
290 * \param[in] pmt suggested media type for connection | |
291 * | |
292 * \return S_OK - success | |
293 * \return E_POINTER - Null pointer | |
294 * \return VFW_E_ALREADY_CONNECTED - pin already connected | |
295 * \return VFW_E_NOT_STOPPED - filter is active | |
296 * \return VFW_E_TYPE_NOT_ACCEPT - type is not acceptable | |
297 * | |
298 * \note | |
299 * When returning S_OK method should also do the following: | |
300 * - store media type and return the same type in IPin::ConnectionMediaType | |
301 * - store pConnector and return it in IPin::ConnectedTo | |
302 * | |
303 */ | |
1545 | 304 static HRESULT STDCALL COutputPin_ReceiveConnection(IPin * This, |
305 /* [in] */ IPin *pConnector, | |
306 /* [in] */ const AM_MEDIA_TYPE *pmt) | |
168 | 307 { |
3467 | 308 Debug printf("COutputPin_ReceiveConnection(%p) called\n", This); |
309 ((COutputPin*)This)->remote = pConnector; | |
168 | 310 return 0; |
311 } | |
1545 | 312 |
22014 | 313 /** |
314 * \brief IPin::Disconnect (accepts a connection from another pin) | |
315 * | |
316 * \param[in] This pointer to IPin interface | |
317 * | |
318 * \return S_OK - success | |
319 * \return S_FALSE - pin was not connected | |
320 * \return VFW_E_NOT_STOPPED - filter is active | |
321 * | |
322 * \note | |
323 * To break connection you have to also call Disconnect on other pin | |
324 */ | |
1545 | 325 static HRESULT STDCALL COutputPin_Disconnect(IPin * This) |
168 | 326 { |
3467 | 327 Debug printf("COutputPin_Disconnect(%p) called\n", This); |
168 | 328 return 1; |
329 } | |
330 | |
22014 | 331 /** |
332 * \brief IPin::ConnectedTo (retrieves pointer to the connected pin, if such exist) | |
333 * | |
334 * \param[in] This pointer to IPin interface | |
335 * \param[out] pPin pointer to remote pin's IPin interface | |
336 * | |
337 * \return S_OK - success | |
338 * \return E_POINTER - Null pointer | |
339 * \return VFW_E_NOT_CONNECTED - pin is not connected | |
340 * | |
341 * \note | |
342 * Caller must call Release on received IPin, when done | |
343 */ | |
1545 | 344 static HRESULT STDCALL COutputPin_ConnectedTo(IPin * This, |
345 /* [out] */ IPin **pPin) | |
346 { | |
3467 | 347 Debug printf("COutputPin_ConnectedTo(%p) called\n", This); |
1545 | 348 if (!pPin) |
349 return E_INVALIDARG; | |
350 *pPin = ((COutputPin*)This)->remote; | |
351 return 0; | |
352 } | |
168 | 353 |
22014 | 354 /** |
355 * \brief IPin::ConnectionMediaType (retrieves media type for connection, if such exist) | |
356 * | |
357 * \param[in] This pointer to IPin interface | |
358 * \param[out] pmt pointer to AM_MEDIA_TYPE, that receives connection media type | |
359 * | |
360 * \return S_OK - success | |
361 * \return E_POINTER - Null pointer | |
362 * \return VFW_E_NOT_CONNECTED - pin is not connected | |
363 * | |
364 */ | |
1545 | 365 static HRESULT STDCALL COutputPin_ConnectionMediaType(IPin * This, |
366 /* [out] */ AM_MEDIA_TYPE *pmt) | |
367 { | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
368 Debug printf("COutputPin_ConnectionMediaType(%p) called\n",This); |
1545 | 369 if (!pmt) |
370 return E_INVALIDARG; | |
371 *pmt = ((COutputPin*)This)->type; | |
372 if (pmt->cbFormat>0) | |
373 { | |
18878 | 374 pmt->pbFormat=malloc(pmt->cbFormat); |
1545 | 375 memcpy(pmt->pbFormat, ((COutputPin*)This)->type.pbFormat, pmt->cbFormat); |
376 } | |
377 return 0; | |
378 } | |
379 | |
22014 | 380 /** |
381 * \brief IPin::QueryPinInfo (retrieves information about the pin) | |
382 * | |
383 * \param[in] This pointer to IPin interface | |
384 * \param[out] pInfo pointer to PIN_INFO structure, that receives pin info | |
385 * | |
386 * \return S_OK - success | |
387 * \return E_POINTER - Null pointer | |
388 * | |
389 * \note | |
390 * If pInfo->pFilter is not NULL, then caller must call Release on pInfo->pFilter when done | |
391 * | |
392 */ | |
1545 | 393 static HRESULT STDCALL COutputPin_QueryPinInfo(IPin * This, |
394 /* [out] */ PIN_INFO *pInfo) | |
395 { | |
7386 | 396 return output_unimplemented("COutputPin_QueryPinInfo", This); |
1545 | 397 } |
398 | |
22014 | 399 /** |
400 * \brief IPin::QueryDirection (retrieves pin direction) | |
401 * | |
402 * \param[in] This pointer to IPin interface | |
403 * \param[out] pPinDir pointer to variable, that receives pin direction (PINDIR_INPUT,PINDIR_OUTPUT) | |
404 * | |
405 * \return S_OK - success | |
406 * \return E_POINTER - Null pointer | |
407 * | |
408 */ | |
1545 | 409 static HRESULT STDCALL COutputPin_QueryDirection(IPin * This, |
410 /* [out] */ PIN_DIRECTION *pPinDir) | |
411 { | |
3467 | 412 Debug printf("COutputPin_QueryDirection(%p) called\n", This); |
1545 | 413 if (!pPinDir) |
414 return E_INVALIDARG; | |
415 *pPinDir = PINDIR_INPUT; | |
416 return 0; | |
417 } | |
418 | |
22014 | 419 /** |
420 * \brief IPin::QueryId (retrieves pin identificator) | |
421 * | |
422 * \param[in] This pointer to IPin interface | |
423 * \param[out] Id adress of variable, that receives string with pin's Id. | |
424 * | |
425 * \return S_OK - success | |
426 * \return E_OUTOFMEMORY - Insufficient memory | |
427 * \return E_POINTER - Null pointer | |
428 * | |
429 * \note | |
430 * Pin's Id is not the same as pin's name | |
431 * | |
432 */ | |
1545 | 433 static HRESULT STDCALL COutputPin_QueryId(IPin * This, |
434 /* [out] */ LPWSTR *Id) | |
435 { | |
7386 | 436 return output_unimplemented("COutputPin_QueryId", This); |
1545 | 437 } |
438 | |
22014 | 439 /** |
440 * \brief IPin::QueryAccept (determines can media type be accepted or not) | |
441 * | |
442 * \param[in] This pointer to IPin interface | |
443 * \param[in] pmt Media type to check | |
444 * | |
445 * \return S_OK - success | |
446 * \return S_FALSE - pin rejects media type | |
447 * | |
448 */ | |
1545 | 449 static HRESULT STDCALL COutputPin_QueryAccept(IPin * This, |
450 /* [in] */ const AM_MEDIA_TYPE *pmt) | |
168 | 451 { |
7386 | 452 return output_unimplemented("COutputPin_QueryAccept", This); |
1545 | 453 } |
454 | |
22014 | 455 /** |
456 * \brief IPin::EnumMediaTypes (enumerates the pin's preferred media types) | |
457 * | |
458 * \param[in] This pointer to IPin interface | |
459 * \param[out] ppEnum adress of variable that receives pointer to IEnumMEdiaTypes interface | |
460 * | |
461 * \return S_OK - success | |
462 * \return E_OUTOFMEMORY - Insufficient memory | |
463 * \return E_POINTER - Null pointer | |
464 * | |
465 * \note | |
466 * Caller must call Release on received interface when done | |
467 * | |
468 */ | |
1545 | 469 static HRESULT STDCALL COutputPin_EnumMediaTypes(IPin * This, |
470 /* [out] */ IEnumMediaTypes **ppEnum) | |
471 { | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
472 Debug printf("COutputPin_EnumMediaTypes(%p) called\n",This); |
1545 | 473 if (!ppEnum) |
474 return E_INVALIDARG; | |
3056 | 475 *ppEnum = (IEnumMediaTypes*) CEnumMediaTypesCreate(&((COutputPin*)This)->type); |
1545 | 476 return 0; |
477 } | |
478 | |
22014 | 479 /** |
480 * \brief IPin::QueryInternalConnections (retries pin's internal connections) | |
481 * | |
482 * \param[in] This pointer to IPin interface | |
483 * \param[out] apPin Array that receives pins, internally connected to this | |
484 * \param[in,out] nPint Size of an array | |
485 * | |
486 * \return S_OK - success | |
487 * \return S_FALSE - pin rejects media type | |
488 * \return E_NOTIMPL - not implemented | |
489 * | |
490 */ | |
1545 | 491 static HRESULT STDCALL COutputPin_QueryInternalConnections(IPin * This, |
492 /* [out] */ IPin **apPin, | |
493 /* [out][in] */ ULONG *nPin) | |
494 { | |
7386 | 495 return output_unimplemented("COutputPin_QueryInternalConnections", This); |
1545 | 496 } |
497 | |
22014 | 498 /** |
499 * \brief IPin::EndOfStream (notifies pin, that no data is expected, until new run command) | |
500 * | |
501 * \param[in] This pointer to IPin interface | |
502 * | |
503 * \return S_OK - success | |
504 * \return E_UNEXPECTED - The pin is output pin | |
505 * | |
506 * \note | |
507 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, | |
508 * IMemAllocator::GetBuffer runs in different (streaming) thread then other | |
509 * methods (application thread). | |
510 * IMemoryInputPin::NewSegment runs either in streaming or application thread. | |
511 * Developer must use critical sections for thread-safing work. | |
512 * | |
513 */ | |
1545 | 514 static HRESULT STDCALL COutputPin_EndOfStream(IPin * This) |
515 { | |
7386 | 516 return output_unimplemented("COutputPin_EndOfStream", This); |
1545 | 517 } |
518 | |
22014 | 519 /** |
520 * \brief IPin::BeginFlush (begins a flush operation) | |
521 * | |
522 * \param[in] This pointer to IPin interface | |
523 * | |
524 * \return S_OK - success | |
525 * \return E_UNEXPECTED - The pin is output pin | |
526 * | |
527 */ | |
1545 | 528 static HRESULT STDCALL COutputPin_BeginFlush(IPin * This) |
529 { | |
7386 | 530 return output_unimplemented("COutputPin_BeginFlush", This); |
1545 | 531 } |
532 | |
22014 | 533 /** |
22015 | 534 * \brief IPin::EndFlush (ends a flush operation) |
22014 | 535 * |
536 * \param[in] This pointer to IPin interface | |
537 * | |
538 * \return S_OK - success | |
539 * \return E_UNEXPECTED - The pin is output pin | |
540 * | |
541 */ | |
1545 | 542 static HRESULT STDCALL COutputPin_EndFlush(IPin * This) |
543 { | |
7386 | 544 return output_unimplemented("COutputPin_EndFlush", This); |
1545 | 545 } |
546 | |
22014 | 547 /** |
22015 | 548 * \brief IPin::NewSegment (media sample received after this call grouped as segment with common |
22014 | 549 * start,stop time and rate) |
550 * | |
551 * \param[in] This pointer to IPin interface | |
552 * \param[in] tStart start time of new segment | |
553 * \param[in] tStop end time of new segment | |
554 * \param[in] dRate rate at wich segment should be processed | |
555 * | |
556 * \return S_OK - success | |
557 * \return E_UNEXPECTED - The pin is output pin | |
558 * | |
559 */ | |
1545 | 560 static HRESULT STDCALL COutputPin_NewSegment(IPin * This, |
561 /* [in] */ REFERENCE_TIME tStart, | |
562 /* [in] */ REFERENCE_TIME tStop, | |
563 /* [in] */ double dRate) | |
564 { | |
3056 | 565 Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n", |
1545 | 566 tStart, tStop, dRate); |
168 | 567 return 0; |
568 } | |
569 | |
570 | |
571 | |
572 // IMemInputPin->IUnknown methods | |
573 | |
22014 | 574 /** |
575 * \brief IUnknown::QueryInterface (query object for interface) | |
576 * | |
577 * \param[in] This pointer to IUnknown interface | |
578 * \param[in] iid GUID of requested interface | |
579 * \param[out] ppv receives pointer to interface | |
580 * | |
581 * \return S_OK - success (and *ppv contains valid pointer) | |
582 * \return E_NOINTERFACE - interface not found (and *ppv was set NULL) | |
583 * | |
584 * \note | |
585 * Make sure to call Release on received interface when you are done | |
586 * | |
587 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
588 static HRESULT STDCALL COutputMemPin_QueryInterface(IUnknown* This, const GUID* iid, void** ppv) |
168 | 589 { |
3056 | 590 COutputPin* p = (COutputPin*)This; |
591 | |
22017 | 592 Debug printf("COutputMemPin_QueryInterface(%p) called\n", This); |
1545 | 593 if (!ppv) |
594 return E_INVALIDARG; | |
595 | |
168 | 596 if(!memcmp(iid, &IID_IUnknown, 16)) |
597 { | |
3467 | 598 *ppv = p; |
1545 | 599 p->vt->AddRef(This); |
168 | 600 return 0; |
601 } | |
1545 | 602 /*if(!memcmp(iid, &IID_IPin, 16)) |
168 | 603 { |
604 COutputPin* ptr=(COutputPin*)(This-1); | |
605 *ppv=(void*)ptr; | |
606 AddRef((IUnknown*)ptr); | |
607 return 0; | |
608 }*/ | |
609 if(!memcmp(iid, &IID_IMemInputPin, 16)) | |
610 { | |
3467 | 611 *ppv = p->mempin; |
1545 | 612 p->mempin->vt->AddRef(This); |
168 | 613 return 0; |
614 } | |
615 Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-" \ | |
1545 | 616 "%02x%02x%02x%02x%02x%02x\n", |
617 iid->f1, iid->f2, iid->f3, | |
618 (unsigned char)iid->f4[1], (unsigned char)iid->f4[0], | |
619 (unsigned char)iid->f4[2], (unsigned char)iid->f4[3], | |
620 (unsigned char)iid->f4[4], (unsigned char)iid->f4[5], | |
621 (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]); | |
622 return E_NOINTERFACE; | |
168 | 623 } |
624 | |
625 // IMemInputPin methods | |
626 | |
22014 | 627 /** |
628 * \brief IMemInputPin::GetAllocator (retrives memory allocator, proposed by pin) | |
629 * | |
630 * \param[in] This pointer to IMemInputPin interface | |
631 * \param[out] ppAllocator address of variable that receives allocator's IMemAllocator interface | |
632 * | |
633 * \return S_OK - success | |
634 * \return VFW_E_NO_ALLOCATOR - No allocator | |
635 * | |
636 * \note | |
637 * Make sure to call Release on received interface when you are done | |
638 * | |
639 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
640 static HRESULT STDCALL COutputMemPin_GetAllocator(IMemInputPin* This, |
3056 | 641 /* [out] */ IMemAllocator** ppAllocator) |
168 | 642 { |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
643 Debug printf("COutputMemPin_GetAllocator(%p, %p) called\n", This->vt, ppAllocator); |
3056 | 644 *ppAllocator = (IMemAllocator*) MemAllocatorCreate(); |
168 | 645 return 0; |
646 } | |
3056 | 647 |
22014 | 648 /** |
649 * | |
650 * \brief IMemInputPin::NotifyAllocator (specifies an allocator for the connection) | |
651 * | |
652 * \param[in] This pointer to IMemInputPin interface | |
653 * \param[in] pAllocator allocator's IMemAllocator interface | |
654 * \param[in] bReadOnly specifies whether samples from allocator are readonly | |
655 * | |
656 * \return S_OK - success | |
657 * \return Apropriate error code otherwise | |
658 * | |
659 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
660 static HRESULT STDCALL COutputMemPin_NotifyAllocator(IMemInputPin* This, |
3056 | 661 /* [in] */ IMemAllocator* pAllocator, |
1545 | 662 /* [in] */ int bReadOnly) |
168 | 663 { |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
664 Debug printf("COutputMemPin_NotifyAllocator(%p, %p) called\n", This, pAllocator); |
1545 | 665 ((COutputMemPin*)This)->pAllocator = (MemAllocator*) pAllocator; |
168 | 666 return 0; |
667 } | |
668 | |
22014 | 669 /** |
670 * \brief IMemInputPin::GetAllocatorRequirements (retrieves allocator properties requested by | |
671 * input pin) | |
672 * | |
673 * \param[in] This pointer to IMemInputPin interface | |
674 * \param[out] pProps pointer to a structure that receives allocator properties | |
675 * | |
676 * \return S_OK - success | |
677 * \return E_NOTIMPL - Not implemented | |
678 * \return E_POINTER - Null pointer | |
679 * | |
680 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
681 static HRESULT STDCALL COutputMemPin_GetAllocatorRequirements(IMemInputPin* This, |
3056 | 682 /* [out] */ ALLOCATOR_PROPERTIES* pProps) |
168 | 683 { |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
684 return output_unimplemented("COutputMemPin_GetAllocatorRequirements", This); |
168 | 685 } |
686 | |
22014 | 687 /** |
688 * \brief IMemInputPin::Receive (receives the next media sample int thre stream) | |
689 * | |
690 * \param[in] This pointer to IMemInputPin interface | |
691 * \param[in] pSample pointer to sample's IMediaSample interface | |
692 * | |
693 * \return S_OK - success | |
694 * \return S_FALSE - The sample was rejected | |
695 * \return E_POINTER - Null pointer | |
696 * \return VFW_E_INVALIDMEDIATYPE - invalid media type | |
697 * \return VFW_E_RUNTIME_ERROR - run-time error occured | |
698 * \return VFW_E_WRONG_STATE - pin is stopped | |
699 * | |
700 * \remarks | |
701 * Method san do on of the following: | |
702 * - reject sample | |
703 * - accept sample and process it in another thread | |
704 * - accept sample and process it before returning | |
705 * | |
706 * In second case method should increase reference count for sample (through AddRef) | |
707 * In the last case method might block indefinitely. If this might | |
708 * happen IMemInpuPin::ReceiveCAnBlock returns S_OK | |
709 * | |
710 * \note | |
711 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, | |
712 * IMemAllocator::GetBuffer runs in different (streaming) thread then other | |
713 * methods (application thread). | |
714 * IMemoryInputPin::NewSegment runs either in streaming or application thread. | |
715 * Developer must use critical sections for thread-safing work. | |
716 * | |
717 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
718 static HRESULT STDCALL COutputMemPin_Receive(IMemInputPin* This, |
3056 | 719 /* [in] */ IMediaSample* pSample) |
168 | 720 { |
3056 | 721 COutputMemPin* mp = (COutputMemPin*)This; |
722 char* pointer; | |
723 int len; | |
724 | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
725 Debug printf("COutputMemPin_Receive(%p) called\n", This); |
1545 | 726 if (!pSample) |
727 return E_INVALIDARG; | |
3056 | 728 if (pSample->vt->GetPointer(pSample, (BYTE**) &pointer)) |
168 | 729 return -1; |
3056 | 730 len = pSample->vt->GetActualDataLength(pSample); |
1545 | 731 if (len == 0) |
732 len = pSample->vt->GetSize(pSample);//for iv50 | |
168 | 733 //if(me.frame_pointer)memcpy(me.frame_pointer, pointer, len); |
1545 | 734 |
735 if (mp->frame_pointer) | |
736 *(mp->frame_pointer) = pointer; | |
737 if (mp->frame_size_pointer) | |
738 *(mp->frame_size_pointer) = len; | |
168 | 739 /* |
740 FILE* file=fopen("./uncompr.bmp", "wb"); | |
741 char head[14]={0x42, 0x4D, 0x36, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00}; | |
742 *(int*)(&head[2])=len+0x36; | |
743 fwrite(head, 14, 1, file); | |
744 fwrite(&((VIDEOINFOHEADER*)me.type.pbFormat)->bmiHeader, sizeof(BITMAPINFOHEADER), 1, file); | |
745 fwrite(pointer, len, 1, file); | |
746 fclose(file); | |
3056 | 747 */ |
168 | 748 // pSample->vt->Release((IUnknown*)pSample); |
3056 | 749 |
168 | 750 return 0; |
751 } | |
752 | |
22014 | 753 /** |
754 * \brief IMemInputPin::ReceiveMultiple (receives multiple samples in the stream) | |
755 * | |
756 * \param[in] This pointer to IMemInputPin interface | |
757 * \param[in] pSamples pointer to array with samples | |
758 * \param[in] nSamples number of samples in array | |
759 * \param[out] nSamplesProcessed number of processed samples | |
760 * | |
761 * \return S_OK - success | |
762 * \return S_FALSE - The sample was rejected | |
763 * \return E_POINTER - Null pointer | |
764 * \return VFW_E_INVALIDMEDIATYPE - invalid media type | |
765 * \return VFW_E_RUNTIME_ERROR - run-time error occured | |
766 * \return VFW_E_WRONG_STATE - pin is stopped | |
767 * | |
768 * \remarks | |
769 * This method behaves like IMemInputPin::Receive but for array of samples | |
770 * | |
771 * \note | |
772 * IMemoryInputPin::Receive,IMemoryInputPin::ReceiveMultiple, IMemoryInputPin::EndOfStream, | |
773 * IMemAllocator::GetBuffer runs in different (streaming) thread then other | |
774 * methods (application thread). | |
775 * IMemoryInputPin::NewSegment runs either in streaming or application thread. | |
776 * Developer must use critical sections for thread-safing work. | |
777 * | |
778 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
779 static HRESULT STDCALL COutputMemPin_ReceiveMultiple(IMemInputPin * This, |
1545 | 780 /* [size_is][in] */ IMediaSample **pSamples, |
781 /* [in] */ long nSamples, | |
782 /* [out] */ long *nSamplesProcessed) | |
168 | 783 { |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
784 return output_unimplemented("COutputMemPin_ReceiveMultiple", This); |
1545 | 785 } |
786 | |
22014 | 787 /** |
788 * \brief IMemInputPin::ReceiveCanBlock (determines whether IMemInputPin:::Receive might block) | |
789 * | |
790 * \param[in] This pointer to IMemInputPin interface | |
791 * | |
792 * \return S_OK - the pin might block | |
793 * \return S_FALSE - the pin will not block | |
794 * | |
795 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
796 static HRESULT STDCALL COutputMemPin_ReceiveCanBlock(IMemInputPin * This) |
1545 | 797 { |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
798 return output_unimplemented("COutputMemPin_ReceiveCanBlock", This); |
168 | 799 } |
800 | |
22014 | 801 /** |
802 * \brief COutputPin::SetFramePointer (sets internal frame pointer to an external buffer) | |
803 * | |
804 * \param[in] This pointer to COutputPin class | |
805 * \param[in] z new pointer | |
806 * | |
807 */ | |
3056 | 808 static void COutputPin_SetFramePointer(COutputPin* This, char** z) |
809 { | |
810 This->mempin->frame_pointer = z; | |
811 } | |
812 | |
22014 | 813 /** |
814 * \brief COutputPin::SetFramePointer2 (sets allocator's pointer to an external buffer) | |
815 * | |
816 * \param[in] This pointer to COutputPin class | |
817 * \param[in] z new pointer | |
818 * | |
819 */ | |
3056 | 820 static void COutputPin_SetPointer2(COutputPin* This, char* p) |
821 { | |
822 if (This->mempin->pAllocator) | |
823 // fixme | |
824 This->mempin->pAllocator->SetPointer(This->mempin->pAllocator, p); | |
825 } | |
826 | |
22014 | 827 /** |
828 * \brief COutputPin::SetFrameSizePointer (sets pointer to variable that receives frame size) | |
829 * | |
830 * \param[in] This pointer to COutputPin class | |
831 * \param[in] z new pointer | |
832 * | |
833 */ | |
3056 | 834 static void COutputPin_SetFrameSizePointer(COutputPin* This, long* z) |
835 { | |
836 This->mempin->frame_size_pointer = z; | |
837 } | |
838 | |
22014 | 839 /** |
840 * \brief COutputPin::SetNewFormat(sets new media format for the pin) | |
841 * | |
842 * \param[in] This pointer to COutputPin class | |
843 * \param[in] amt new media format | |
844 * | |
845 */ | |
3056 | 846 static void COutputPin_SetNewFormat(COutputPin* This, const AM_MEDIA_TYPE* amt) |
847 { | |
848 This->type = *amt; | |
849 } | |
850 | |
22014 | 851 /** |
852 * \brief COutputPin destructor | |
853 * | |
854 * \param[in] This pointer to COutputPin class | |
855 * | |
856 */ | |
3056 | 857 static void COutputPin_Destroy(COutputPin* This) |
168 | 858 { |
3467 | 859 if (This->mempin->vt) |
860 free(This->mempin->vt); | |
861 if (This->mempin) | |
862 free(This->mempin); | |
863 if (This->vt) | |
864 free(This->vt); | |
3056 | 865 free(This); |
866 } | |
867 | |
22014 | 868 /** |
869 * \brief IUnknown::AddRef (increases reference counter for interface) | |
870 * | |
871 * \param[in] This pointer to IUnknown class | |
872 * | |
873 * \return new value of reference counter | |
874 * | |
875 * \remarks | |
876 * Return value should be used only for debug purposes | |
877 * | |
878 */ | |
3056 | 879 static HRESULT STDCALL COutputPin_AddRef(IUnknown* This) |
880 { | |
3467 | 881 Debug printf("COutputPin_AddRef(%p) called (%d)\n", This, ((COutputPin*)This)->refcount); |
3056 | 882 ((COutputPin*)This)->refcount++; |
883 return 0; | |
884 } | |
1545 | 885 |
22014 | 886 /** |
887 * \brief IUnknown::Release (desreases reference counter for interface) | |
888 * | |
889 * \param[in] This pointer to IUnknown class | |
890 * | |
891 * \return new value of reference counter | |
892 * | |
893 * \remarks | |
894 * When reference counter reaches zero calls destructor | |
895 * Return value should be used only for debug purposes | |
896 * | |
897 */ | |
3056 | 898 static HRESULT STDCALL COutputPin_Release(IUnknown* This) |
899 { | |
3467 | 900 Debug printf("COutputPin_Release(%p) called (%d)\n", This, ((COutputPin*)This)->refcount); |
901 if (--((COutputPin*)This)->refcount <= 0) | |
3056 | 902 COutputPin_Destroy((COutputPin*)This); |
1545 | 903 |
3056 | 904 return 0; |
905 } | |
906 | |
22014 | 907 /** |
908 * \brief IUnknown::AddRef (increases reference counter for interface) | |
909 * | |
910 * \param[in] This pointer to IUnknown class | |
911 * | |
912 * \return new value of reference counter | |
913 * | |
914 * \remarks | |
915 * Return value should be used only for debug purposes | |
916 * | |
917 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
918 static HRESULT STDCALL COutputMemPin_AddRef(IUnknown* This) |
3056 | 919 { |
920 COutputMemPin* p = (COutputMemPin*) This; | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
921 Debug printf("COutputMemPin_AddRef(%p) called (%p, %d)\n", p, p->parent, p->parent->refcount); |
3056 | 922 p->parent->refcount++; |
923 return 0; | |
168 | 924 } |
1545 | 925 |
22014 | 926 /** |
927 * \brief IUnknown::Release (desreases reference counter for interface) | |
928 * | |
929 * \param[in] This pointer to IUnknown class | |
930 * | |
931 * \return new value of reference counter | |
932 * | |
933 * \remarks | |
934 * When reference counter reaches zero calls destructor | |
935 * Return value should be used only for debug purposes | |
936 * | |
937 */ | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
938 static HRESULT STDCALL COutputMemPin_Release(IUnknown* This) |
3056 | 939 { |
940 COutputMemPin* p = (COutputMemPin*) This; | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
941 Debug printf("COutputMemPin_Release(%p) called (%p, %d)\n", |
3056 | 942 p, p->parent, p->parent->refcount); |
943 if (--p->parent->refcount <= 0) | |
944 COutputPin_Destroy(p->parent); | |
945 return 0; | |
946 } | |
947 | |
22014 | 948 /** |
949 * \brief COutputPin constructor | |
950 * | |
951 * \param[in] amt media type for pin | |
952 * | |
953 * \return pointer to COutputPin if success | |
954 * \return NULL if error occured | |
955 * | |
956 */ | |
3056 | 957 COutputPin* COutputPinCreate(const AM_MEDIA_TYPE* amt) |
1545 | 958 { |
3056 | 959 COutputPin* This = (COutputPin*) malloc(sizeof(COutputPin)); |
3467 | 960 IMemInputPin_vt* ivt; |
961 | |
962 if (!This) | |
963 return NULL; | |
964 | |
965 This->vt = (IPin_vt*) malloc(sizeof(IPin_vt)); | |
966 This->mempin = (COutputMemPin*) malloc(sizeof(COutputMemPin)); | |
967 ivt = (IMemInputPin_vt*) malloc(sizeof(IMemInputPin_vt)); | |
968 | |
969 if (!This->vt || !This->mempin || !ivt) | |
970 { | |
971 COutputPin_Destroy(This); | |
972 return NULL; | |
973 } | |
974 | |
975 This->mempin->vt = ivt; | |
976 | |
3056 | 977 This->refcount = 1; |
978 This->remote = 0; | |
979 This->type = *amt; | |
3467 | 980 |
3056 | 981 This->vt->QueryInterface = COutputPin_QueryInterface; |
982 This->vt->AddRef = COutputPin_AddRef; | |
983 This->vt->Release = COutputPin_Release; | |
984 This->vt->Connect = COutputPin_Connect; | |
985 This->vt->ReceiveConnection = COutputPin_ReceiveConnection; | |
986 This->vt->Disconnect = COutputPin_Disconnect; | |
987 This->vt->ConnectedTo = COutputPin_ConnectedTo; | |
988 This->vt->ConnectionMediaType = COutputPin_ConnectionMediaType; | |
989 This->vt->QueryPinInfo = COutputPin_QueryPinInfo; | |
990 This->vt->QueryDirection = COutputPin_QueryDirection; | |
991 This->vt->QueryId = COutputPin_QueryId; | |
992 This->vt->QueryAccept = COutputPin_QueryAccept; | |
993 This->vt->EnumMediaTypes = COutputPin_EnumMediaTypes; | |
994 This->vt->QueryInternalConnections = COutputPin_QueryInternalConnections; | |
995 This->vt->EndOfStream = COutputPin_EndOfStream; | |
996 This->vt->BeginFlush = COutputPin_BeginFlush; | |
997 This->vt->EndFlush = COutputPin_EndFlush; | |
998 This->vt->NewSegment = COutputPin_NewSegment; | |
999 | |
22016
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1000 This->mempin->vt->QueryInterface = COutputMemPin_QueryInterface; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1001 This->mempin->vt->AddRef = COutputMemPin_AddRef; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1002 This->mempin->vt->Release = COutputMemPin_Release; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1003 This->mempin->vt->GetAllocator = COutputMemPin_GetAllocator; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1004 This->mempin->vt->NotifyAllocator = COutputMemPin_NotifyAllocator; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1005 This->mempin->vt->GetAllocatorRequirements = COutputMemPin_GetAllocatorRequirements; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1006 This->mempin->vt->Receive = COutputMemPin_Receive; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1007 This->mempin->vt->ReceiveMultiple = COutputMemPin_ReceiveMultiple; |
4479e6a1a140
Changing debug messages and renaming method names according to their
voroshil
parents:
22015
diff
changeset
|
1008 This->mempin->vt->ReceiveCanBlock = COutputMemPin_ReceiveCanBlock; |
3056 | 1009 |
1010 This->mempin->frame_size_pointer = 0; | |
1011 This->mempin->frame_pointer = 0; | |
1012 This->mempin->pAllocator = 0; | |
3130 | 1013 This->mempin->refcount = 1; |
3056 | 1014 This->mempin->parent = This; |
1015 | |
1016 This->SetPointer2 = COutputPin_SetPointer2; | |
1017 This->SetFramePointer = COutputPin_SetFramePointer; | |
1018 This->SetFrameSizePointer = COutputPin_SetFrameSizePointer; | |
1019 This->SetNewFormat = COutputPin_SetNewFormat; | |
1020 | |
1021 return This; | |
1545 | 1022 } |