MFCreateSampleGrabberSinkActivate function (mfidl.h)

Creates an activation object for the sample grabber media sink.


HRESULT MFCreateSampleGrabberSinkActivate(
  IMFMediaType                 *pIMFMediaType,
  IMFSampleGrabberSinkCallback *pIMFSampleGrabberSinkCallback,
  IMFActivate                  **ppIActivate



Pointer to the IMFMediaType interface, defining the media type for the sample grabber's input stream.


Pointer to the IMFSampleGrabberSinkCallback interface of a callback object. The caller must implement this interface.


Receives a pointer to the IMFActivate interface. Use this interface to complete the creation of the sample grabber. The caller must release the interface.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


To create the sample grabber sink, call IMFActivate::ActivateObject on the pointer received in the ppIActivate parameter.

Before calling ActivateObject, you can configure the sample grabber by setting any of the following attributes on the ppIActivate pointer:


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

Media Foundation Functions