Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MF_PD_DURATION attribute

Specifies the duration of a presentation, in 100-nanosecond units.

Data type

UINT64

Treat as a LONGLONG value.

Remarks

Media sources can set this attribute on a presentation descriptor to indicate the duration of the presentation.

This attribute is a signed value, although it is stored as a UINT64. However, the attribute should never contain a negative value.

The GUID constant for this attribute is exported from mfuuid.lib.

Examples

The following example shows how to get the presentation duration from a media source.


HRESULT GetSourceDuration(IMFMediaSource *pSource, MFTIME *pDuration)
{
    *pDuration = 0;

    IMFPresentationDescriptor *pPD = NULL;

    HRESULT hr = pSource->CreatePresentationDescriptor(&pPD);
    if (SUCCEEDED(hr))
    {
        hr = pPD->GetUINT64(MF_PD_DURATION, (UINT64*)pDuration);
        pPD->Release();
    }
    return hr;
}


Requirements

Minimum supported client

Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Mfidl.h

See also

Alphabetical List of Media Foundation Attributes
IMFAttributes::GetUINT64
IMFAttributes::SetUINT64
IMFPresentationDescriptor
Presentation Descriptor Attributes
Presentation Descriptors

 

 

Show:
© 2017 Microsoft