IMultiFileReader Interface

The IMultiFileReader interface is implemented by the Microsoft® MultiFile reader filter. Applications that need to stream multiple files or file segments with identical media types with minimal delay between files use this interface.

The interface supports two notifications:

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IMultiFileReader methodDescription
SetFile Implements sequenced playback of a set of file segments.

IMultiFileReader::SetFile

IMultiFileReader Interface

Implements sequenced playback of a set of file segments by waiting for the end of source data notification before calling it again, and also by switching immediately to a new file.

Syntax

HRESULT SetFile(
    LPCWSTR lpszFile,
    LONGLONG llOffset,
    LONGLONG llLength,
    LONGLONG rtOffset,
    HWND hwndNotify,
    UINT uiMsgNotify,
    WPARAM wParam,
    HANDLE hEvent,
    DWORD dwFlags
    );

Parameters

lpszFile
[in] Pointer to the file to use.
llOffset
[in] Start offset in file.
llLength
[in] Length, in bytes, of file segment to play. Zero means play the rest of the file starting at llOffset.
rtOffset
[in] Offset time to be applied to the start time of the file for fine tuning. For example, if rtOffset was 10000 (1 millisecond), then the time stamps used for the movie would be delayed by 1 millisecond.
hwndNotify
[in] Window to send notification messages to (can be NULL).
uiMsgNotify
[in] Window message to use for PostMessage notifications. Ignored if hwndNotify is NULL.
wParam
[in] Microsoft® Windows® wParam parameter in PostMessage notifications. Ignored if hwndNotify is NULL.
hEvent
[in] Event handle to signal when all data has been read. Can be NULL.
dwFlags
[in] Flags that specify how to mark the file. Can be one or both of the following values.
AM_MULTIFILE_READER_SEAMLESS
Don't set discontinuity flag on sample at file join.
AM_MULTIFILE_READER_LAST
Signal end of file at the end of this sample.

Return Value

Returns an HRESULT value that depends on the implementation of the interface. HRESULT can include one of the following standard constants, or other values not listed.
E_FAIL Failure.
E_INVALIDARG Argument is invalid.
E_NOTIMPL Method is not supported.
E_POINTER Null pointer argument.
S_OK Success.

Remarks

The file lpszFile is used for the next data requested from the source filter. SetFile can be used both to implement sequenced playback of a set of file segments by waiting for the end of source data notification before calling it again, or for switching immediately to a new file. In the latter case, from the user's point of view, the switch will not appear instantaneous because there will be data that has been read from the file that won't have been played yet, but the delay will be short.

When hwndNotify is not NULL, two notifications are issued through PostMessage to hwndNotify, using the uiMsgNotify and wParam values specified for the current file segment:
Notification MeaningwParam
Start time of current segment in 100-nanosecond units.Pointer to REFERENCE_TIME. Must be freed by using CoTaskMemFree. This notification can't be called. For example, the MultiFile source filter relies on the filter connected to its output (such as the MPEG-2 Splitter filter) to implement IAMParse to get this information.
All data for current segment has been read.0

To distinguish notifications for different segments, the wParam value chosen for each segment should be different.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.