Partager via


IStreamSample::GetSampleTimes (Windows Embedded CE 6.0)

1/6/2010

This method retrieves the current sample's start and end times. If the sample is updating, this method returns the times after the update completes.

Syntax

HRESULT GetSampleTimes(
  STREAM_TIME* pStartTime,
  STREAM_TIME* pEndTime,
  STREAM_TIME* pCurrentTime
);

Parameters

  • pStartTime
    [out] Pointer to a STREAM_TIME value that will contain the sample's start time.
  • pEndTime
    [out] Pointer to a STREAM_TIME value that will contain the sample's end time.
  • pCurrentTime
    [out] Pointer to a STREAM_TIME value that will contain the media stream's current media time.

Return Value

Returns S_OK if successful or E_POINTER if one of the parameters is invalid.

Remarks

For streams that have a clock, the start and end times will be relative to the stream's current time. If the stream does not have a clock, the times are media-relative and the current time will be zero.

The pCurrentTime parameter enables you to conveniently track the media stream's current time, so you do not have to call IMultiMediaStream::GetTime.

Unlike GetTime, however, this method returns S_OK if the stream does not have a clock; GetTime returns S_FALSE.

The value assigned to pCurrentTime is the same as the value produced by the following code fragment.

pSample->GetMediaStream(&pMediaStream);
pMediaStream->GetMultiMediaStream(&pMultiMediaStream);
pMediaStream->Release();
pMultiMediaStream->GetTime(&pCurrentTime);
pMultiMediaStream->Release();

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

IStreamSample Interface