Share via


CBaseStreamControl::CheckStreamState (Windows Embedded CE 6.0)

1/6/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
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

See Also

Reference

CBaseStreamControl Class