Partager via


IMediaControl Interface (Compact 2013)

3/26/2014

The filter graph exposes the IMediaControl interface to allow applications to control the streaming of media through the filters in the graph. The interface provides methods for running, pausing, and stopping the streaming of data. It also provides applications with a simple method of building graphs to play back media files.

When to Implement

This interface is implemented by the Filter Graph Manager. Implement this interface only if you are writing a plug-in distributor that needs to export the control methods. The CMediaControl base class implements this interface and handles the IDispatch interface.

When to Use

Use this interface from any application that wants to control the playing of media through DirectShow filter graphs. Applications can also use it to enumerate the filters in the filter graph and all the filters in the registry, to add a source filter to the filter graph, and to instruct the Filter Graph Manager to build a filter graph capable of rendering the media type in a file.

Remarks

As the IFilterInfo and IAMCollection interfaces are not supported on Windows Embedded Compact, the get_FilterCollection and get_RegFilterCollection members of the IMediaControl interface are not supported on Windows Embedded Compact either. Attempting to access either member will generate an E_NOTIMPL error.

Methods in Vtable Order

The following table shows the methods that appear in the Vtable underneath the standard COM methods inherited from IUnknown.

IDispatch method

Description

GetTypeInfoCount

Determines whether there is type information available for this dispinterface.

GetTypeInfo

Retrieves the type information for this dispinterface if GetTypeInfoCount returned successfully.

GetIDsOfNames

Converts text names of properties and methods (including arguments) to their corresponding DISPIDs.

Invoke

Calls a method or accesses a property in this dispinterface if given a DISPID and any other necessary parameters.

IMediaControl method

Description

Run

Switches the filter graph into running mode.

Pause

Pauses all filters in the filter graph.

Stop

Switches all filters in the filter graph to a stopped state.

StopWhenReady

Waits for an operation such as Pause to complete, allowing filters to queue up data, then stops the filter graph.

GetState

Retrieves the state of the filter graph.

RenderFile

Adds and connects filters needed to play the specified file.

AddSourceFilter

Adds to the graph the source filter that can read the given file name, and returns an IDispatch interface pointer representing the filter object.

Requirements

Header

dshow.h

Library

Strmiids.lib

See Also

Reference

DirectShow Interfaces