IDXGIFactoryMedia::CreateDecodeSwapChainForCompositionSurfaceHandle method (dxgi1_3.h)

Creates a YUV swap chain for an existing DirectComposition surface handle. The swap chain is created with pre-existing buffers and very few descriptive elements are required. Instead, this method requires a DirectComposition surface handle and an IDXGIResource buffer to hold decoded frame data. The swap chain format is determined by the format of the subresources of the IDXGIResource.

Syntax

HRESULT CreateDecodeSwapChainForCompositionSurfaceHandle(
  [in]           IUnknown                    *pDevice,
  [in, optional] HANDLE                      hSurface,
  [in]           DXGI_DECODE_SWAP_CHAIN_DESC *pDesc,
  [in]           IDXGIResource               *pYuvDecodeBuffers,
  [in, optional] IDXGIOutput                 *pRestrictToOutput,
  [out]          IDXGIDecodeSwapChain        **ppSwapChain
);

Parameters

[in] pDevice

A pointer to the Direct3D device for the swap chain. This parameter cannot be NULL. Software drivers, like D3D_DRIVER_TYPE_REFERENCE, are not supported for composition swap chains.

[in, optional] hSurface

A handle to an existing DirectComposition surface. This parameter cannot be NULL.

[in] pDesc

A pointer to a DXGI_DECODE_SWAP_CHAIN_DESC structure for the swap-chain description. This parameter cannot be NULL.

[in] pYuvDecodeBuffers

A pointer to a IDXGIResource interface that represents the resource that contains the info that CreateDecodeSwapChainForCompositionSurfaceHandle decodes.

[in, optional] pRestrictToOutput

A pointer to the IDXGIOutput interface for the swap chain to restrict content to. If the swap chain is moved to a different output, the content is black. You can optionally set this parameter to an output target that uses DXGI_PRESENT_RESTRICT_TO_OUTPUT to restrict the content on this output. If the swap chain is moved to a different output, the content is black.

You must also pass the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag in a present call to force the content to appear blacked out on any other output. If you want to restrict the content to a different output, you must create a new swap chain. However, you can conditionally restrict content based on the DXGI_PRESENT_RESTRICT_TO_OUTPUT flag.

Set this parameter to NULL if you don't want to restrict content to an output target.

[out] ppSwapChain

A pointer to a variable that receives a pointer to the IDXGIDecodeSwapChain interface for the swap chain that this method creates.

Return value

CreateDecodeSwapChainForCompositionSurfaceHandle returns:

  • S_OK if it successfully created a swap chain.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • DXGI_ERROR_INVALID_CALL if the calling application provided invalid data, for example, if pDesc, pYuvDecodeBuffers, or ppSwapChain is NULL.
  • Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.

Remarks

The IDXGIResource provided via the pYuvDecodeBuffers parameter must point to at least one subresource, and all subresources must be created with the D3D11_BIND_DECODER flag.

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header dxgi1_3.h
Library Dxgi.lib

See also

IDXGIFactoryMedia