Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
What should I use instead of CreatePosPassThru for multiple input pins?
C++
STDMETHODIMP CTransformerOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
{
    CheckPointer(ppv,E_POINTER);
    ValidateReadWritePtr(ppv,sizeof(PVOID));
    *ppv = NULL;
    if (riid == IID_IMediaPosition || riid == IID_IMediaSeeking) {
        // we should have an input pin by now
        if (m_pPosition == NULL) {
            HRESULT hr = CreatePosPassThru(
                             GetOwner(),
                             FALSE,
                             (IPin *)m_pAudioTransformerFilter->m_Arrinputpin[0],
                             &m_pPosition);
            if (FAILED(hr)) {
                return hr;
            }
        }
        return m_pPosition->QueryInterface(riid, ppv);
    } else {
        return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
    }
}


CreatePosPassThru: Creates a COM object that supports IMediaSeeking and IMediaPosition for single-input pin renderers and transform filters.
C++
STDAPI CreatePosPassThru(
LPUNKNOWN pAgg,
BOOL bRenderer,
IPin *pPin,
IUnknown **ppPassThru);

When I had one input pin, everything was fine.
I have transformer filter with multiple inputs.

(Update)
It is actual.
Posted
Updated 13-Jan-11 2:24am
v3

1 solution

I have upgraded CreatePosPassThru, CSeekingPassThru and got CreatePosPassThruMultiple, CSeekingPassThruMultiple.
I just call all the functions for all pins and instead of IPin * use IPin ** and pins_size.

Now i am going to test this.
It seems to me, that it works.
 
Share this answer
 
Comments
[no name] 13-Jan-11 8:23am    
Does not work. Is there any existent function?
[no name] 18-Oct-11 3:23am    
One should use CreatePosPassThru for each input pin in filter and return interface on first input pin.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900