Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

MFCreateSequencerSegmentOffset function

Creates a PROPVARIANT that can be used to seek within a sequencer source presentation.

Syntax


HRESULT MFCreateSequencerSegmentOffset(
  _In_   MFSequencerElementId dwId,
  _In_   MFTIME hnsOffset,
  _Out_  PROPVARIANT *pvarSegmentOffset
);

Parameters

dwId [in]

Sequencer element identifier. This value specifies the segment in which to begin playback. The element identifier is returned in the IMFSequencerSource::AppendTopology method.

hnsOffset [in]

Starting position within the segment, in 100-nanosecond units.

pvarSegmentOffset [out]

Pointer to a PROPVARIANT. The method fills in the PROPVARIANT with the information needed for performing a seek operation. The caller must free the PROPVARIANT by calling PropVariantClear.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The PROPVARIANT returned in pvarSegmentOffset can be used for the pvarStartPosition parameter in the IMFMediaSession::Start method. Use the time format GUID MF_TIME_FORMAT_SEGMENT_OFFSET.

Examples


// Skips to the specified segment in the sequencer source

HRESULT CPlaylist::SkipTo(DWORD index)
{
    if (index >= m_count)
    {
        return E_INVALIDARG;
    }

    MFSequencerElementId ID = m_segments[index].SegmentID;

    PROPVARIANT var;

    HRESULT hr = MFCreateSequencerSegmentOffset(ID, NULL, &var);
    
    if (SUCCEEDED(hr))
    {
        hr = m_pSession->Start(&MF_TIME_FORMAT_SEGMENT_OFFSET, &var);
        PropVariantClear(&var);
    }
    return hr;
}


Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mfidl.h

Library

Mf.lib

DLL

Mf.dll

See also

Media Foundation Functions
Using the Sequencer Source
Sequencer Source
MFTIME

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.