IMFTopologyServiceLookup::LookupService method (evr.h)
[The component described on this page, Enhanced Video Renderer, is a legacy feature. It has been superseded by the Simple Video Renderer (SVR) exposed through the MediaPlayer and IMFMediaEngine components. To play video content you should send data into one of these components and allow them to instantiate the new video renderer. These components have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer or the lower level IMFMediaEngine APIs to play video media in Windows instead of the EVR, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Retrieves an interface from the enhanced video renderer (EVR), or from the video mixer or video presenter.
Syntax
HRESULT LookupService(
[in] MF_SERVICE_LOOKUP_TYPE Type,
[in] DWORD dwIndex,
[in] REFGUID guidService,
[in] REFIID riid,
[out] LPVOID *ppvObjects,
[in, out] DWORD *pnObjects
);
Parameters
[in] Type
Specifies the scope of the search. Currently this parameter is ignored. Use the value MF_SERVICE_LOOKUP_GLOBAL.
[in] dwIndex
Reserved, must be zero.
[in] guidService
Service GUID of the requested interface.
[in] riid
Interface identifier of the requested interface.
[out] ppvObjects
Array of interface pointers. If the method succeeds, each member of the array contains either a valid interface pointer or NULL. The caller must release the interface pointers when the EVR calls IMFTopologyServiceLookupClient::ReleaseServicePointers (or earlier). If the method fails, every member of the array is NULL.
[in, out] pnObjects
Pointer to a value that specifies the size of the ppvObjects array. The value must be at least 1. In the current implementation, there is no reason to specify an array size larger than one element. The value is not changed on output.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
|
Invalid argument. |
|
The requested interface is not available. |
|
The method was not called from inside the IMFTopologyServiceLookupClient::InitServicePointers method. See Remarks. |
|
The object does not support the specified service GUID. |
Remarks
This method can be called only from inside the IMFTopologyServiceLookupClient::InitServicePointers method. At any other time, the method returns MF_E_NOTACCEPTING.
The presenter can use this method to query the EVR and the mixer. The mixer can use it to query the EVR and the presenter. Which objects are queried depends on the caller and the service GUID, as shown in the following table.
Caller | Service GUID | Objects queried |
---|---|---|
Presenter | MR_VIDEO_RENDER_SERVICE | EVR |
Presenter | MR_VIDEO_MIXER_SERVICE | Mixer |
Mixer | MR_VIDEO_RENDER_SERVICE | Presenter and EVR |
The following interfaces are available from the EVR:
- IMediaEventSink. This interface is documented in the DirectShow SDK documentation.
-
IMFClock interface. This interface is available if the EVR has access to a clock (reference clock in DirectShow or presentation clock in Media Foundation). This interface might not be available. Presenter and mixers must be able to process data without a clock. If the IMFClock interface is available, you can also get these related interfaces:
-
IMFPresentationClock (Media Foundation EVR only)
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | evr.h |
Library | Strmiids.lib |