CMediaSample.SetMediaTime method

The SetMediaTime method sets the media times for this sample. This method implements the IMediaSample::SetMediaTime method.

Syntax


HRESULT SetMediaTime(
   LONGLONG *pStart,
   LONGLONG *pEnd
);

Parameters

pStart

Pointer to the media start time, or NULL.

pEnd

Pointer to the media stop time, or NULL.

Return value

Returns S_OK.

Remarks

The media stop time must be greater than the media start time. Use NULL to invalidate the media times.

The pEnd parameter specifies an absolute media time, but the CMediaSample::m_MediaEnd member variable is calculated as an offset from pStart. In other words, m_MediaEnd = *pTimeEnd– *pTimeStart.

For information about media times, see Time and Clocks in DirectShow.

Requirements

Header

Amfilter.h (include Streams.h)

Library

Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CMediaSample Class

 

 

Show: