Compartilhar via


CVideoTransformFilter::ShouldSkipFrame

 
Microsoft DirectShow 9.0

CVideoTransformFilter::ShouldSkipFrame

The ShouldSkipFrame method determines whether the filter should drop a specified sample.

Syntax

  BOOL ShouldSkipFrame(
    IMediaSample *pIn
);

Parameters

pIn

Pointer to the IMediaSample interface of the sample.

Return Value

Returns TRUE if the filter should drop this sample, or TRUE if the filter should process this sample.

Remarks

This method returns TRUE if the following conditions are met:

  • The sample has time stamps.
  • The average decoding time is at least 25% of the frame duration.
  • The renderer is currently at least one frame late, as reported through quality messages.
  • Skipping to the next key frame would not cause the frame to arrive more than one frame early.

For purposes of this calculation, the filter records the following information as it processes data:

  • The average decoding time over the past 20 frames (m_itrAvgDecode)
  • The number of frames since the last key frame (m_nFramesSinceKeyFrame)
  • An estimate of how many frames there are between key frames (m_nKeyFramePeriod)

Once the filter drops a frame, it continues to drop frames until it reaches the next key frame. If this method returns TRUE, it also sends an EC_QUALITY_CHANGE event to the Filter Graph Manager.

Requirements

**  Header:** Declared in Vtrans.h; include Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also