// provide EndOfStream that passes straight downstream // (there is no queued data) STDMETHODIMP CTransformInputPin::EndOfStream(void) { CAutoLock lck(&m_pTransformFilter->m_csReceive); HRESULT hr = CheckStreaming(); if(S_OK == hr) { hr = m_pTransformFilter->EndOfStream(); } return hr; }
STDMETHODIMP CVideoInputPin::EndOfSegment() { CAutoLock lck(&m_pLAVVideo->m_csReceive); HRESULT hr = CheckStreaming(); if (S_OK == hr) { hr = m_pLAVVideo->EndOfSegment(); } return hr; }
STDMETHODIMP CRenderedInputPin::EndOfStream() { HRESULT hr = CheckStreaming(); // Do EC_COMPLETE handling for rendered pins if (S_OK == hr && !m_bAtEndOfStream) { m_bAtEndOfStream = TRUE; FILTER_STATE fs; EXECUTE_ASSERT(SUCCEEDED(m_pFilter->GetState(0, &fs))); if (fs == State_Running) { DoCompleteHandling(); } } return hr; }
STDMETHODIMP AbstractTransformInputPin::Receive(IMediaSample* inSample) { CAutoLock locLock(mStreamLock); HRESULT locHR = CheckStreaming(); if (locHR == S_OK) { BYTE* locBuff = NULL; locHR = inSample->GetPointer(&locBuff); if (locHR != S_OK) { //TODO::: Do a debug dump or something here with specific error info. return locHR; } else { /* Read DirectShow timestamps */ REFERENCE_TIME pTimeStart, pTimeEnd; if (inSample->GetTime(&pTimeStart, &pTimeEnd) == NOERROR) { m_dsTimeStart = pTimeStart/10000; m_dsTimeEnd = pTimeEnd/10000; } //http://windowssdk.msdn.microsoft.com/en-us/library/ms787541.aspx //Consider using receive to validate conditions ^^^ HRESULT locResult = TransformData(locBuff, inSample->GetActualDataLength()); if (locResult == S_OK) { return S_OK; } else { return S_FALSE; } } } else { //Not streaming - Bail out. return S_FALSE; } }