IMFMediaEventGenerator::GetEvent Method

Retrieves the next event in the queue. This method is synchronous.

Syntax

public:
HRESULT GetEvent(
         DWORD dwFlags,
         IMFMediaEvent **ppEvent
)  

Parameters

dwFlags
Type: DWORD 

Specifies one of the following values.

Value Meaning
0 The method blocks until the event generator queues an event.
MF_EVENT_FLAG_NO_WAIT The method returns immediately.

ppEvent
Type: IMFMediaEvent **

[out, optional]

Receives a pointer to the IMFMediaEvent interface. The caller must release the interface.

Return value

Type: HRESULT 

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codes
Return code Description
S_OK The method succeeded.
E_INVALIDARG NULL pointer argument.
MF_E_MULTIPLE_SUBSCRIBERS There is a pending request.
MF_E_NO_EVENTS_AVAILABLE There are no events in the queue.
MF_E_SHUTDOWN The object was shut down.

Refer to Media Foundation return codes.

Remarks

This method executes synchronously.

If the queue already contains an event, the method returns S_OK immediately. If the queue does not contain an event, the behavior depends on the value of dwFlags:

This method returns MF_E_MULTIPLE_SUBSCRIBERS if you previously called IMFMediaEventGenerator::BeginGetEvent and have not yet called IMFMediaEventGenerator::EndGetEvent.

Requirements

Header: Declared in mfobjects.h (include mfidl.h).

Library: Use mfuuid.lib.