This method returns the media stream's duration.

HRESULT GetDuration(
  STREAM_TIME* pDuration


  • pDuration
    [out] Pointer to a STREAM_TIME value that will contain the media duration.

Return Values

Returns one of the following values.

Value Description
E_POINTER The value of pDuration is invalid.
MS_E_WRITESTREAM The media stream is writable and therefore has no duration.
S_FALSE Stream contains live data or this method could not determine the duration. On return, this method sets pDuration to zero.
S_OK Stream contains recorded media. On return, pDuration contains duration of media.


DirectShow applications and DirectShow filters have different include file and link library requirements. See Setting Up the Build Environment for more information.

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.

See Also

IMultiMediaStream Interface

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.