IPin::NewSegment

 
Microsoft DirectShow 9.0

IPin::NewSegment

The NewSegment method notifies the pin that media samples received after this call are grouped as a segment, with a common start time, stop time, and rate.

Applications should not call this method. This method is called by other filters.

Syntax

  HRESULT NewSegment(
  REFERENCE_TIME tStart,
  REFERENCE_TIME tStop,
  double dRate
);

Parameters

tStart

Start time of the segment, relative to the original source, in 100-nanosecond units.

tStop

End time of the segment, relative to the original source, in 100-nanosecond units.

dRate

Rate at which this segment should be processed, as a percentage of the original rate.

Return Value

Returns S_OK if successful, or an HRESULT value indicating the cause of the error.

Remarks

A source filter (or parser filter) calls this method at the start of each new stream and after each seek operation. It calls the method on the input pin of the downstream filter, after delivering the previous batch of data and before calling IMemInputPin::Receive with any new data. The downstream filter propagates the NewSegment call downstream.

Filters can use segment information to process samples. For example, with some formats it is impossible to reconstruct a delta frame without the next key frame. Therefore, if the stop time occurs on a delta frame, the source filter must send some additional frames. The decoder filter determines the final frame based on the segment information. The segment rate is used to render continuous data sources, such as audio data. For example, the audio renderer uses the sampling rate and the segment rate to render the audio data correctly.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also