Hi,
MF_PD_DURATION attribute specifies the duration of a presentation, in 100-nanosecond units.
Note:
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;
}
Thanks.