www.pudn.com > VirtualVCR-src-v2.6.9.zip > InputPin.cpp


 
 
 
#include "InputPin.h" 
 
/* 
HRESULT CInputPin::CheckMediaType( const CMediaType *pmt ) 
{ 
	//CNullInPlace *pNull = (CNullInPlace *) m_pTIPFilter; 
//MessageBox(NULL, "Check input type", "Message Box", MB_OK|MB_ICONINFORMATION|MB_TASKMODAL); 
#ifdef DEBUG 
    DisplayType(TEXT("Input type proposed"),pmt); 
#endif 
 
    if (pNull->m_mtPreferred.IsValid() == FALSE) 
    { 
        if( pNull->m_pOutput->IsConnected() ) { 
 
            //  We used to check here if the subtype of the proposed type 
            //  matched the subtype of the type on the output pin 
            //  but this broke as follows: 
            // 
            //  Renderering the output pin of a CODEC we picked up 
            //  2 NULLIPs already in the graph: 
            // 
            //  Subtypes      Y41P       Y41P       RGB565 
            //  Filters  CODEC---->NULLIP---->NULLIP------>RENDERER 
            // 
            //  Each NULLIP has scheduled a reconnect at this point 
            //  and the reconnect on the first connection happens 
            //  first: 
            // 
            //  Subtypes                 Y41P       RGB565 
            //  Filters  CODEC     NULLIP---->NULLIP------>RENDERER 
            // 
            //  In trying to (re)connect the CODEC to the first NULLIP 
            //  we first propose (say) Y41P and the first NULLIP 
            //  checks that Y41P is the same as its output type 
            //  so the call gets passed to the QueryAccept of 
            //  the second NULLIP.  The second NULLIP rejected the 
            //  call because the subtype on its output pin is not 
            //  RGB565.  In a similar way the first NULLIP 
            //  rejected Y41P. 
            // 
            //  By removing this optimization (checking the 
            //  subtype before passing the call on) we avoided 
            //  the problem. 
 
            return pNull->m_pOutput->GetConnected()->QueryAccept( pmt ); 
        } 
        return S_OK; 
    } 
    else 
        if (*pmt == pNull->m_mtPreferred) 
            return S_OK  ; 
        else 
            return VFW_E_TYPE_NOT_ACCEPTED; 
 
 
	return S_OK; 
} 
*/