IDXGIDecodeSwapChain interface
Represents a swap chain that is used by desktop media apps to decode video data and show it on a DirectComposition surface.
Members
The IDXGIDecodeSwapChain interface inherits from the IUnknown interface. IDXGIDecodeSwapChain also has these types of members:
Methods
The IDXGIDecodeSwapChain interface has these methods.
| Method | Description |
|---|---|
| GetColorSpace |
Gets the color space used by the swap chain. |
| GetDestSize |
Gets the size of the destination surface to use for the video processing blit operation. |
| GetSourceRect |
Gets the source region that is used for the swap chain. |
| GetTargetRect |
Gets the rectangle that defines the target region for the video processing blit operation. |
| PresentBuffer |
Presents a frame on the output adapter. |
| SetColorSpace |
Sets the color space used by the swap chain. |
| SetDestSize |
Sets the size of the destination surface to use for the video processing blit operation. |
| SetSourceRect |
Sets the rectangle that defines the source region for the video processing blit operation. |
| SetTargetRect |
Sets the rectangle that defines the target region for the video processing blit operation. |
Using a decode swap chain
Instead of using system-created buffers owned by the swap chain, decode swap chains use a set of decode buffers owned by the media app. These buffers are created by the media app and provided as DXGI subresources when the swap chain is created.
- Create a decode swap chain by calling IDXGIFactoryMedia::CreateDecodeSwapChainForCompositionSurfaceHandle.
- Buffers must be created with the D3D11_BIND_DECODER flag.
- When PresentBuffer is called on an IDXGIDecodeSwapChain, the BufferToPresent parameter specifies the subresource for DXGI to decode. The app must track which buffers are currently queued for present, and which buffers are available for decoding a new frame.
- Buffers can be presented in any order.
- The decode swap chain lifecycle is separate from the buffer subresource lifecycle. DXGI will unbind the swap chain from the decode buffers, but the media app is responsible for destroying the buffers. The buffer subresources can be bound to a new swap chain in the interim, for example when the swap chain needs to be recreated.
DXGI decodes the presented buffer to a final output buffer. The final output buffer will be in an overlay plane if supported by the hardware, otherwise video decoding will occur on the GPU. The source, target, and destination size are used with decoding as follows:
- The swap chain will consider the final output buffer size to be DestSize.
- The final output buffer is cleared to black.
- The SourceRect region from the decode buffer is blitted to the TargetRect region in the final output buffer, and is decoded in the process.
Remarks
Decode swap chains are intended for use primarily with YUV surface formats. When using decode buffers created with an RGB surface format, the TargetRect and DestSize must be set equal to the buffer dimensions. SourceRect cannot exceed the buffer dimensions.
In clone mode, the decode swap chain is only guaranteed to be shown on the primary output.
Decode swap chains cannot be used with dirty rects.
Requirements
|
Minimum supported client |
Windows 8.1 [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2012 R2 [desktop apps only] |
|
Header |
|
|
Library |
|
See also