IXboxNV12MFSampleRenderer::RenderDecodedSample Method

Converts the specified Media Foundation sample to RGB and draws to current render targets.

Syntax

public:
HRESULT RenderDecodedSample(
         ID3D11DeviceContext * const pCtx,
         IMFSample *pSample,
         UINT uiWidth,
         UINT uiHeight
)  

Parameters

pCtx
Type: ID3D11DeviceContext * const

[in] Graphics context used by the conversion, as a pointer to ID3D11DeviceContext. Can be an immediate context or a deferred context.

pSample
Type: IMFSample *

[in] The Media Foundation sample, which contains a buffer that exposes an IMFDXGIBuffer interface, as a pointer to IMFSample. A 2D Texture resource in NV12 color space can be acquired through the IMFDXGIBuffer interface. The sample is normally created by a DXVA Media Foundation decoder or source reader.

If pSample does not contain IMFDXGIBuffer, or the resource of IMFDXGIBuffer is not in NV12 colorspace, an error will be returned.

uiWidth
Type: UINT 

[in] The video width. 0 means that the width of the 2D Texture is acquired through the IMFDXGIBuffer interface from the first buffer of pSample. If uiWidth is larger than the resource width, the resource width will be used.

uiHeight
Type: UINT 

[in] The video height. 0 means that the height of the 2D Texture is acquired through the IMFDXGIBuffer interface from the first buffer of pSample. If uiHeight is larger than the resource height, the resource height will be used.

Return value

Type: HRESULT 

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

See Media Foundation return codes.

Remarks

This method can only render the specified Media Foundation sample in a single thread at a time. Rendering the specified Media Foundation sample in multiple threads simultaneously would produce an unexpected result or behavior. Rendering different Media Foundation samples in different threads is allowed.

Requirements

Header: Declared in mfapi.h.

Library: Use mfplat.lib.