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