IXboxColorConverter::Transform Method

Converts a texture to another texture that uses a different color space (NV12->RGB or RGB->NV12).

Syntax

public:
HRESULT Transform(
         ID3D11DeviceContext * const pCtx,
         ID3D11Resource *pSrc,
         UINT iSubSrc,
         LPRECT rcSrc,
         ID3D11Resource *pDst,
         UINT iSubDst,
         LPRECT rcDst
)  

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.

pSrc
Type: ID3D11Resource *

[in] Source 2D texture, created using CreateTexture2D, as a pointer to ID3D11Resource. Specify DXGI_FORMAT_NV12 or DXGI_FORMAT_R8G8B8A8_UNORM/DXGI_FORMAT_B8G8R8A8_UNORM as the texture format.

iSubSrc
Type: UINT 

The subresource index for the source texture.

rcSrc
Type: LPRECT 

[in, optional] The region of the source texture to be converted. Specify NULL to use the full texture.

pDst
Type: ID3D11Resource *

[in] The destination 2D texture, created using CreateTexture2D, as a pointer to ID3D11Resource. Specify DXGI_FORMAT_R8G8B8A8_UNORM/DXGI_FORMAT_B8G8R8A8_UNORM or DXGI_FORMAT_NV12 as the texture format.

iSubDst
Type: UINT 

[in] Subresource index for the destination texture.

rcDst
Type: LPRECT 

[in, optional] The region of the destination texture to be converted. Specify NULL to use the full texture.

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

If the MF_RENDER_DONOTUSE_SOURCE_ASPECTRATIO attribute is not specified or is set to 0, the converter will use the aspect ratio from the source texture when converted to destination texture.

If the MF_RENDER_DONOTUSE_SOURCE_ASPECTRATIO attribute is specified and set to 1 when creating this interface, the converter will not keep the source aspect ratio.

Requirements

Header: Declared in mfapi.h.

Library: Use mfplat.lib.