Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Retrieves a stream's current state.
enum StreamControlState CheckStreamState( IMediaSample * pSample );
Parameters
Return Values
Returns a StreamControlStateenumeration type.
Remarks
Your filter calls this member function when your pin receives a sample that it is about to forward. The first sample you forward after throwing one or more away should be marked as a discontinuity.
The following example shows what you should include if your filter inherits from CBaseStreamControl.
//Pin has been given a sample to pass on, pSample //m_fLastSampleDiscarded is initialized to TRUE when streaming starts int iStreamState = CheckStreamState(pSample); if (iStreamState == STREAM_FLOWING) { if (m_fLastSampleDiscarded) pSample->SetDiscontinuity(TRUE); m_fLastSampleDiscarded = FALSE; //now deliver it or put it o a queue to be delivered, or whatever. } else { m_fLastSampleDiscarded = TRUE; //next one is discontinuity //Do NOT deliver this sample. Just throw it away. }