Direct Show : "Mp3 Decoder DMO" filter fails to return any input pins
-
Hi, The code below fails to get any input pins for the filter "Mp3 Decoder DMO". The class ID for the specific filter is
{94297043-BD82-4DFD-B0DE-8177739C6D20}
. Specifically, it fails at the very firstwhile
condition. I getS_FALSE
which means "Did not retrieve as many pins as requested." Does it play any role that this specific filter is DMO (Direct Media Object) filter ? If this is the case, is there nay other way to get the input pins ? In my graphedit it connects and works just fine , but under my code it fails. Any recommendations ?IPin* Graph::GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, UCHAR PinCounter) {
BOOL bFound = FALSE;
IEnumPins *pEnum;
IPin *pPin;
HRESULT hr =S_OK;
UCHAR localPinCounter = 0;hr = pFilter->EnumPins(&pEnum); if (SUCCEEDED(hr)) { while(pEnum->Next(1, &pPin, 0) == S\_OK) { PIN\_DIRECTION PinDirThis; pPin->QueryDirection(&PinDirThis); if (bFound = ( (PinDir == PinDirThis) && (PinCounter == localPinCounter) ) ) break; pPin->Release(); localPinCounter++; } pEnum->Release(); } else { return 0; }
Regards,
sdancer75