Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

MFCreateDXSurfaceBuffer function

Creates a media buffer object that manages a Direct3D 9 surface.

Syntax


HRESULT MFCreateDXSurfaceBuffer(
  _In_   REFIID riid,
  _In_   IUnknown *punkSurface,
  _In_   BOOL fBottomUpWhenLinear,
  _Out_  IMFMediaBuffer **ppBuffer
);

Parameters

riid [in]

Identifies the type of Direct3D 9 surface. Currently this value must be IID_IDirect3DSurface9.

punkSurface [in]

A pointer to the IUnknown interface of the DirectX surface.

fBottomUpWhenLinear [in]

If TRUE, the buffer's IMF2DBuffer::ContiguousCopyTo method copies the buffer into a bottom-up format. The bottom-up format is compatible with GDI for uncompressed RGB images. If this parameter is FALSE, the ContiguousCopyTo method copies the buffer into a top-down format, which is compatible with DirectX.

For more information about top-down versus bottom-up images, see Image Stride.

ppBuffer [out]

Receives a pointer to the IMFMediaBuffer interface. The caller must release the buffer.

Return value

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

Return codeDescription
S_OK

The method succeeded.

E_INVALIDARG

Invalid argument.

 

Remarks

This function creates a media buffer object that holds a pointer to the Direct3D surface specified in punkSurface. Locking the buffer gives the caller access to the surface memory. When the buffer object is destroyed, it releases the surface. For more information about media buffers, see Media Buffers.

Note  This function does not allocate the Direct3D surface itself.

The buffer object created by this function also exposes the IMF2DBuffer interface. For more information, see DirectX Surface Buffer.

This function does not support DXGI surfaces.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mfapi.h

Library

Evr.lib

DLL

Evr.dll

See also

DirectX Surface Buffer
Media Foundation Functions
Media Buffers

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.