Share via


CBaseStreamControl::CheckStreamState

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Retrieves a stream's current state.

Syntax

enum StreamControlState CheckStreamState( 
  IMediaSample* pSample
);

Parameters

Return Value

Returns a StreamControlState enumeration 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.
}

Requirements

Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later