2 * Parser (Base for parsers and splitters)
4 * Copyright 2003 Robert Shearman
5 * Copyright 2004-2005 Christian Costa
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "quartz_private.h"
23 #include "control_private.h"
29 #include "wine/unicode.h"
30 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
39 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
40 static const IMediaSeekingVtbl Parser_Seeking_Vtbl;
41 static const IPinVtbl Parser_OutputPin_Vtbl;
42 static const IPinVtbl Parser_InputPin_Vtbl;
44 static HRESULT Parser_OutputPin_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt);
45 static HRESULT Parser_ChangeCurrent(IBaseFilter *iface);
46 static HRESULT Parser_ChangeStop(IBaseFilter *iface);
47 static HRESULT Parser_ChangeRate(IBaseFilter *iface);
49 static inline ParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
51 return (ParserImpl *)((char*)iface - FIELD_OFFSET(ParserImpl, mediaSeeking.lpVtbl));
55 HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, const CLSID* pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect, PFN_CLEANUP fnCleanup, PFN_DISCONNECT fnDisconnect, REQUESTPROC fnRequest, STOPPROCESSPROC fnDone, CHANGEPROC stop, CHANGEPROC current, CHANGEPROC rate)
60 /* pTransformFilter is already allocated */
61 pParser->clsid = *pClsid;
62 pParser->lpVtbl = Parser_Vtbl;
63 pParser->refCount = 1;
64 InitializeCriticalSection(&pParser->csFilter);
65 pParser->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ParserImpl.csFilter");
66 pParser->state = State_Stopped;
67 pParser->pClock = NULL;
68 pParser->fnDisconnect = fnDisconnect;
69 ZeroMemory(&pParser->filterInfo, sizeof(FILTER_INFO));
70 pParser->lastpinchange = GetTickCount();
72 pParser->cStreams = 0;
73 pParser->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
75 /* construct input pin */
76 piInput.dir = PINDIR_INPUT;
77 piInput.pFilter = (IBaseFilter *)pParser;
78 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
81 current = Parser_ChangeCurrent;
84 stop = Parser_ChangeStop;
87 rate = Parser_ChangeRate;
89 MediaSeekingImpl_Init((IBaseFilter*)pParser, stop, current, rate, &pParser->mediaSeeking, &pParser->csFilter);
90 pParser->mediaSeeking.lpVtbl = &Parser_Seeking_Vtbl;
92 hr = PullPin_Construct(&Parser_InputPin_Vtbl, &piInput, fnProcessSample, (LPVOID)pParser, fnQueryAccept, fnCleanup, fnRequest, fnDone, &pParser->csFilter, (IPin **)&pParser->pInputPin);
96 pParser->ppPins[0] = (IPin *)pParser->pInputPin;
97 pParser->pInputPin->fnPreConnect = fnPreConnect;
101 CoTaskMemFree(pParser->ppPins);
102 pParser->csFilter.DebugInfo->Spare[0] = 0;
103 DeleteCriticalSection(&pParser->csFilter);
104 CoTaskMemFree(pParser);
110 HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
112 ParserImpl *This = (ParserImpl *)iface;
113 TRACE("(%s, %p)\n", qzdebugstr_guid(riid), ppv);
117 if (IsEqualIID(riid, &IID_IUnknown))
119 else if (IsEqualIID(riid, &IID_IPersist))
121 else if (IsEqualIID(riid, &IID_IMediaFilter))
123 else if (IsEqualIID(riid, &IID_IBaseFilter))
125 else if (IsEqualIID(riid, &IID_IMediaSeeking))
126 *ppv = (LPVOID)&This->mediaSeeking;
130 IUnknown_AddRef((IUnknown *)(*ppv));
134 if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
135 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
137 return E_NOINTERFACE;
140 ULONG WINAPI Parser_AddRef(IBaseFilter * iface)
142 ParserImpl *This = (ParserImpl *)iface;
143 ULONG refCount = InterlockedIncrement(&This->refCount);
145 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
150 void Parser_Destroy(ParserImpl *This)
152 IPin *connected = NULL;
155 assert(!This->refCount);
156 PullPin_WaitForStateChange(This->pInputPin, INFINITE);
159 IReferenceClock_Release(This->pClock);
161 /* Don't need to clean up output pins, freeing input pin will do that */
162 IPin_ConnectedTo((IPin *)This->pInputPin, &connected);
165 assert(IPin_Disconnect(connected) == S_OK);
166 IPin_Release(connected);
167 assert(IPin_Disconnect((IPin *)This->pInputPin) == S_OK);
169 pinref = IPin_Release((IPin *)This->pInputPin);
172 /* Valgrind could find this, if I kill it here */
173 ERR("pinref should be null, is %u, destroying anyway\n", pinref);
174 assert((LONG)pinref > 0);
177 pinref = IPin_Release((IPin *)This->pInputPin);
180 CoTaskMemFree(This->ppPins);
183 This->csFilter.DebugInfo->Spare[0] = 0;
184 DeleteCriticalSection(&This->csFilter);
186 TRACE("Destroying parser\n");
190 ULONG WINAPI Parser_Release(IBaseFilter * iface)
192 ParserImpl *This = (ParserImpl *)iface;
193 ULONG refCount = InterlockedDecrement(&This->refCount);
195 TRACE("(%p)->() Release from %d\n", This, refCount + 1);
198 Parser_Destroy(This);
203 /** IPersist methods **/
205 HRESULT WINAPI Parser_GetClassID(IBaseFilter * iface, CLSID * pClsid)
207 ParserImpl *This = (ParserImpl *)iface;
209 TRACE("(%p)\n", pClsid);
211 *pClsid = This->clsid;
216 /** IMediaFilter methods **/
218 HRESULT WINAPI Parser_Stop(IBaseFilter * iface)
220 ParserImpl *This = (ParserImpl *)iface;
221 PullPin *pin = (PullPin *)This->ppPins[0];
226 EnterCriticalSection(&pin->thread_lock);
228 IAsyncReader_BeginFlush(This->pInputPin->pReader);
229 EnterCriticalSection(&This->csFilter);
231 if (This->state == State_Stopped)
233 LeaveCriticalSection(&This->csFilter);
234 LeaveCriticalSection(&pin->thread_lock);
238 This->state = State_Stopped;
240 for (i = 1; i < (This->cStreams + 1); i++)
242 OutputPin_DecommitAllocator((OutputPin *)This->ppPins[i]);
245 LeaveCriticalSection(&This->csFilter);
247 PullPin_PauseProcessing(This->pInputPin);
248 PullPin_WaitForStateChange(This->pInputPin, INFINITE);
249 IAsyncReader_EndFlush(This->pInputPin->pReader);
251 LeaveCriticalSection(&pin->thread_lock);
255 HRESULT WINAPI Parser_Pause(IBaseFilter * iface)
258 ParserImpl *This = (ParserImpl *)iface;
259 PullPin *pin = (PullPin *)This->ppPins[0];
263 EnterCriticalSection(&pin->thread_lock);
264 EnterCriticalSection(&This->csFilter);
266 if (This->state == State_Paused)
268 LeaveCriticalSection(&This->csFilter);
269 LeaveCriticalSection(&pin->thread_lock);
273 if (This->state == State_Stopped)
275 LeaveCriticalSection(&This->csFilter);
276 hr = IBaseFilter_Run(iface, -1);
277 EnterCriticalSection(&This->csFilter);
280 This->state = State_Paused;
282 LeaveCriticalSection(&This->csFilter);
283 LeaveCriticalSection(&pin->thread_lock);
288 HRESULT WINAPI Parser_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
291 ParserImpl *This = (ParserImpl *)iface;
292 PullPin *pin = (PullPin *)This->ppPins[0];
296 TRACE("(%s)\n", wine_dbgstr_longlong(tStart));
298 EnterCriticalSection(&pin->thread_lock);
299 EnterCriticalSection(&This->csFilter);
301 if (This->state == State_Running || This->state == State_Paused)
303 This->state = State_Running;
304 LeaveCriticalSection(&This->csFilter);
305 LeaveCriticalSection(&pin->thread_lock);
309 This->rtStreamStart = tStart;
311 for (i = 1; i < (This->cStreams + 1); i++)
313 hr = OutputPin_CommitAllocator((OutputPin *)This->ppPins[i]);
320 LeaveCriticalSection(&This->csFilter);
321 hr = PullPin_StartProcessing(This->pInputPin);
322 EnterCriticalSection(&This->csFilter);
326 This->state = State_Running;
328 LeaveCriticalSection(&This->csFilter);
329 LeaveCriticalSection(&pin->thread_lock);
334 HRESULT WINAPI Parser_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
336 ParserImpl *This = (ParserImpl *)iface;
337 PullPin *pin = (PullPin *)This->ppPins[0];
340 TRACE("(%d, %p)\n", dwMilliSecsTimeout, pState);
342 EnterCriticalSection(&pin->thread_lock);
343 EnterCriticalSection(&This->csFilter);
345 *pState = This->state;
347 LeaveCriticalSection(&This->csFilter);
349 if (This->pInputPin && (PullPin_WaitForStateChange(This->pInputPin, dwMilliSecsTimeout) == S_FALSE))
350 hr = VFW_S_STATE_INTERMEDIATE;
351 LeaveCriticalSection(&pin->thread_lock);
356 HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
358 ParserImpl *This = (ParserImpl *)iface;
359 PullPin *pin = (PullPin *)This->ppPins[0];
361 TRACE("(%p)\n", pClock);
363 EnterCriticalSection(&pin->thread_lock);
364 EnterCriticalSection(&This->csFilter);
367 IReferenceClock_Release(This->pClock);
368 This->pClock = pClock;
370 IReferenceClock_AddRef(This->pClock);
372 LeaveCriticalSection(&This->csFilter);
373 LeaveCriticalSection(&pin->thread_lock);
378 HRESULT WINAPI Parser_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
380 ParserImpl *This = (ParserImpl *)iface;
382 TRACE("(%p)\n", ppClock);
384 EnterCriticalSection(&This->csFilter);
386 *ppClock = This->pClock;
388 IReferenceClock_AddRef(This->pClock);
390 LeaveCriticalSection(&This->csFilter);
395 /** IBaseFilter implementation **/
398 static HRESULT Parser_GetPin(IBaseFilter *iface, ULONG pos, IPin **pin, DWORD *lastsynctick)
400 ParserImpl *This = (ParserImpl *)iface;
402 *lastsynctick = This->lastpinchange;
404 TRACE("Asking for pos %x\n", pos);
406 /* Input pin also has a pin, hence the > and not >= */
407 if (pos > This->cStreams)
410 *pin = This->ppPins[pos];
415 HRESULT WINAPI Parser_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
417 ParserImpl *This = (ParserImpl *)iface;
419 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
421 return IEnumPinsImpl_Construct(ppEnum, Parser_GetPin, iface);
424 HRESULT WINAPI Parser_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
426 FIXME("(%p)->(%s,%p)\n", iface, debugstr_w(Id), ppPin);
428 /* FIXME: critical section */
433 HRESULT WINAPI Parser_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
435 ParserImpl *This = (ParserImpl *)iface;
437 TRACE("(%p)\n", pInfo);
439 strcpyW(pInfo->achName, This->filterInfo.achName);
440 pInfo->pGraph = This->filterInfo.pGraph;
443 IFilterGraph_AddRef(pInfo->pGraph);
448 HRESULT WINAPI Parser_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
451 ParserImpl *This = (ParserImpl *)iface;
453 TRACE("(%p, %s)\n", pGraph, debugstr_w(pName));
455 EnterCriticalSection(&This->csFilter);
458 strcpyW(This->filterInfo.achName, pName);
460 *This->filterInfo.achName = '\0';
461 This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
463 LeaveCriticalSection(&This->csFilter);
468 HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
470 TRACE("(%p)\n", pVendorInfo);
474 HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt)
479 ppOldPins = This->ppPins;
481 This->ppPins = CoTaskMemAlloc((This->cStreams + 2) * sizeof(IPin *));
482 memcpy(This->ppPins, ppOldPins, (This->cStreams + 1) * sizeof(IPin *));
484 hr = OutputPin_Construct(&Parser_OutputPin_Vtbl, sizeof(Parser_OutputPin), piOutput, props, NULL, Parser_OutputPin_QueryAccept, &This->csFilter, This->ppPins + (This->cStreams + 1));
488 IPin *pPin = This->ppPins[This->cStreams + 1];
489 Parser_OutputPin *pin = (Parser_OutputPin *)pPin;
490 pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
491 CopyMediaType(pin->pmt, amt);
492 pin->dwSamplesProcessed = 0;
494 pin->pin.pin.pUserData = (LPVOID)This->ppPins[This->cStreams + 1];
495 pin->pin.pin.pinInfo.pFilter = (LPVOID)This;
496 pin->pin.custom_allocator = 1;
498 This->lastpinchange = GetTickCount();
499 CoTaskMemFree(ppOldPins);
503 CoTaskMemFree(This->ppPins);
504 This->ppPins = ppOldPins;
505 ERR("Failed with error %x\n", hr);
511 static HRESULT Parser_RemoveOutputPins(ParserImpl * This)
513 /* NOTE: should be in critical section when calling this function */
516 IPin ** ppOldPins = This->ppPins;
518 TRACE("(%p)\n", This);
520 /* reduce the pin array down to 1 (just our input pin) */
521 This->ppPins = CoTaskMemAlloc(sizeof(IPin *) * 1);
522 memcpy(This->ppPins, ppOldPins, sizeof(IPin *) * 1);
524 for (i = 0; i < This->cStreams; i++)
526 hr = OutputPin_DeliverDisconnect((OutputPin *)ppOldPins[i + 1]);
527 TRACE("Disconnect: %08x\n", hr);
528 IPin_Release(ppOldPins[i + 1]);
531 This->lastpinchange = GetTickCount();
533 CoTaskMemFree(ppOldPins);
538 static HRESULT Parser_ChangeCurrent(IBaseFilter *iface)
540 FIXME("(%p) filter hasn't implemented current position change!\n", iface);
544 static HRESULT Parser_ChangeStop(IBaseFilter *iface)
546 FIXME("(%p) filter hasn't implemented stop position change!\n", iface);
550 static HRESULT Parser_ChangeRate(IBaseFilter *iface)
552 FIXME("(%p) filter hasn't implemented rate change!\n", iface);
557 static HRESULT WINAPI Parser_Seeking_QueryInterface(IMediaSeeking * iface, REFIID riid, LPVOID * ppv)
559 ParserImpl *This = impl_from_IMediaSeeking(iface);
561 return IUnknown_QueryInterface((IUnknown *)This, riid, ppv);
564 static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking * iface)
566 ParserImpl *This = impl_from_IMediaSeeking(iface);
568 return IUnknown_AddRef((IUnknown *)This);
571 static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking * iface)
573 ParserImpl *This = impl_from_IMediaSeeking(iface);
575 return IUnknown_Release((IUnknown *)This);
578 static const IMediaSeekingVtbl Parser_Seeking_Vtbl =
580 Parser_Seeking_QueryInterface,
581 Parser_Seeking_AddRef,
582 Parser_Seeking_Release,
583 MediaSeekingImpl_GetCapabilities,
584 MediaSeekingImpl_CheckCapabilities,
585 MediaSeekingImpl_IsFormatSupported,
586 MediaSeekingImpl_QueryPreferredFormat,
587 MediaSeekingImpl_GetTimeFormat,
588 MediaSeekingImpl_IsUsingTimeFormat,
589 MediaSeekingImpl_SetTimeFormat,
590 MediaSeekingImpl_GetDuration,
591 MediaSeekingImpl_GetStopPosition,
592 MediaSeekingImpl_GetCurrentPosition,
593 MediaSeekingImpl_ConvertTimeFormat,
594 MediaSeekingImpl_SetPositions,
595 MediaSeekingImpl_GetPositions,
596 MediaSeekingImpl_GetAvailable,
597 MediaSeekingImpl_SetRate,
598 MediaSeekingImpl_GetRate,
599 MediaSeekingImpl_GetPreroll
602 static HRESULT WINAPI Parser_OutputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv)
604 Parser_OutputPin *This = (Parser_OutputPin *)iface;
606 TRACE("(%s, %p)\n", qzdebugstr_guid(riid), ppv);
610 if (IsEqualIID(riid, &IID_IUnknown))
611 *ppv = (LPVOID)iface;
612 else if (IsEqualIID(riid, &IID_IPin))
613 *ppv = (LPVOID)iface;
614 else if (IsEqualIID(riid, &IID_IMediaSeeking))
616 return IBaseFilter_QueryInterface(This->pin.pin.pinInfo.pFilter, &IID_IMediaSeeking, ppv);
621 IUnknown_AddRef((IUnknown *)(*ppv));
625 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
627 return E_NOINTERFACE;
630 static ULONG WINAPI Parser_OutputPin_Release(IPin * iface)
632 Parser_OutputPin *This = (Parser_OutputPin *)iface;
633 ULONG refCount = InterlockedDecrement(&This->pin.pin.refCount);
635 TRACE("(%p)->() Release from %d\n", iface, refCount + 1);
639 FreeMediaType(This->pmt);
640 CoTaskMemFree(This->pmt);
641 FreeMediaType(&This->pin.pin.mtCurrent);
648 static HRESULT WINAPI Parser_OutputPin_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum)
650 ENUMMEDIADETAILS emd;
651 Parser_OutputPin *This = (Parser_OutputPin *)iface;
653 TRACE("(%p)\n", ppEnum);
655 /* override this method to allow enumeration of your types */
657 emd.pMediaTypes = This->pmt;
659 return IEnumMediaTypesImpl_Construct(&emd, ppEnum);
662 static HRESULT WINAPI Parser_OutputPin_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
664 Parser_OutputPin *This = (Parser_OutputPin *)iface;
665 ParserImpl *parser = (ParserImpl *)This->pin.pin.pinInfo.pFilter;
667 /* Set the allocator to our input pin's */
668 EnterCriticalSection(This->pin.pin.pCritSec);
669 This->pin.alloc = parser->pInputPin->pAlloc;
670 LeaveCriticalSection(This->pin.pin.pCritSec);
672 return OutputPin_Connect(iface, pReceivePin, pmt);
675 static HRESULT Parser_OutputPin_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
677 Parser_OutputPin *This = (Parser_OutputPin *)iface;
680 dump_AM_MEDIA_TYPE(pmt);
682 return (memcmp(This->pmt, pmt, sizeof(AM_MEDIA_TYPE)) == 0);
685 static const IPinVtbl Parser_OutputPin_Vtbl =
687 Parser_OutputPin_QueryInterface,
689 Parser_OutputPin_Release,
690 Parser_OutputPin_Connect,
691 OutputPin_ReceiveConnection,
692 OutputPin_Disconnect,
693 IPinImpl_ConnectedTo,
694 IPinImpl_ConnectionMediaType,
695 IPinImpl_QueryPinInfo,
696 IPinImpl_QueryDirection,
698 IPinImpl_QueryAccept,
699 Parser_OutputPin_EnumMediaTypes,
700 IPinImpl_QueryInternalConnections,
701 OutputPin_EndOfStream,
702 OutputPin_BeginFlush,
707 static HRESULT WINAPI Parser_PullPin_Disconnect(IPin * iface)
710 PullPin *This = (PullPin *)iface;
714 EnterCriticalSection(&This->thread_lock);
715 EnterCriticalSection(This->pin.pCritSec);
717 if (This->pin.pConnectedTo)
720 ParserImpl *Parser = (ParserImpl *)This->pin.pinInfo.pFilter;
722 LeaveCriticalSection(This->pin.pCritSec);
723 hr = IBaseFilter_GetState(This->pin.pinInfo.pFilter, INFINITE, &state);
724 EnterCriticalSection(This->pin.pCritSec);
726 if (SUCCEEDED(hr) && (state == State_Stopped) && SUCCEEDED(Parser->fnDisconnect(Parser)))
728 LeaveCriticalSection(This->pin.pCritSec);
729 PullPin_Disconnect(iface);
730 EnterCriticalSection(This->pin.pCritSec);
731 hr = Parser_RemoveOutputPins((ParserImpl *)This->pin.pinInfo.pFilter);
734 hr = VFW_E_NOT_STOPPED;
739 LeaveCriticalSection(This->pin.pCritSec);
740 LeaveCriticalSection(&This->thread_lock);
745 HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
751 hr = PullPin_ReceiveConnection(iface, pReceivePin, pmt);
754 IPinImpl *This = (IPinImpl *)iface;
756 EnterCriticalSection(This->pCritSec);
757 Parser_RemoveOutputPins((ParserImpl *)This->pinInfo.pFilter);
758 LeaveCriticalSection(This->pCritSec);
764 static const IPinVtbl Parser_InputPin_Vtbl =
766 PullPin_QueryInterface,
770 Parser_PullPin_ReceiveConnection,
771 Parser_PullPin_Disconnect,
772 IPinImpl_ConnectedTo,
773 IPinImpl_ConnectionMediaType,
774 IPinImpl_QueryPinInfo,
775 IPinImpl_QueryDirection,
777 IPinImpl_QueryAccept,
778 IPinImpl_EnumMediaTypes,
779 IPinImpl_QueryInternalConnections,