MFCreateMediaSession function (mfidl.h)

Creates the Media Session in the application's process.

Syntax

HRESULT MFCreateMediaSession(
  IMFAttributes   *pConfiguration,
  IMFMediaSession **ppMediaSession
);

Parameters

pConfiguration

Pointer to the IMFAttributes interface. This parameter can be NULL. See Remarks.

ppMediaSession

Receives a pointer to the Media Session's IMFMediaSession interface. The caller must release the interface. Before releasing the last reference to the IMFMediaSession pointer, the application must call the IMFMediaSession::Shutdown method.

Return value

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

Return code Description
S_OK
The function succeeded.

Remarks

If your application does not play protected content, you can use this function to create the Media Session in the application's process. To use the Media Session for protected content, you must call MFCreatePMPMediaSession.

You can use the pConfiguration parameter to specify any of the following attributes:

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfidl.h
Library Mf.lib
DLL Mf.dll

See also

About the Media Session

MFCreatePMPMediaSession

Media Foundation Functions

Media Session