CVideoTransformFilter.ShouldSkipFrame method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

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 FALSE 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

Requirement Value
Header
Vtrans.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CVideoTransformFilter Class