ID2D1DeviceContext2::GetImageSourceHardwareDecodeSupport method

[This documentation is preliminary and is subject to change.]

Determines whether CreateImageSourceFromWicHardware is supported, and the nearest scaled size which is supported in that method.

Syntax

HRESULT GetImageSourceHardwareDecodeSupport(
  [in]             IWICBitmapFrameDecode *wicBitmapFrame,
  [in, optional]   const D2D1_IMAGE_SOURCE_DECODING_PARAMETERS *decodingParameters,
  D2D1_IMAGE_SOURCE_DECODING_SUPPORT_OPTIONS options,
  [out]            BOOL *isSupported,
  [out, optional]  D2D1_SIZE_U *nearestSize
);

Parameters

  • wicBitmapFrame [in]
    Type: IWICBitmapFrameDecode*

    The WIC bitmap frame decode.

  • decodingParameters [in, optional]
    Type: const D2D1_IMAGE_SOURCE_DECODING_PARAMETERS*

    Parameters for the decoding pipeline.

  • options
    Type: D2D1_IMAGE_SOURCE_DECODING_SUPPORT_OPTIONS

    Decoding support options.

  • isSupported [out]
    Type: BOOL*

    Indicates whether GPU decoding is supported and CreateImageSourceFromWicHardware can be called, using the nearest SupportedMaximumDimension value returned.

  • nearestSize [out, optional]
    Type: D2D1_SIZE_U*

    The nearest size (after orientation) which is supported and which is greater than or equal to the maximumSizespecified within decodingPipelineParameters. If decoding is unsupported at any size, this value is set to 0 and isSupported is set to FALSE.

Return value

Type: HRESULT

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

Remarks

This method can be used to determine whether hardware decoding is supported, and which sizes are supported. This API can be used to determine whether and how to call CreateImageSourceFromWicHardware. That method should be called with the same values within the decodingParameters argument, other than the outputSize field, which must be replaced with the value returned in the nearestSize argument.

 

The value returned in nearestSize is only valid for the provided WIC frame and the provided decoding pipeline parameters. It should not be re-used for other frames or decoding parameters.

If the decodingParameters argument is NULL, D2D uses the following parameters:

orientation D2D1_ORIENTATION_DEFAULT
maximumSize (0,0) (No maximum size)

 

Requirements

Header

D2d1_3.h

Library

D2d1_3.lib

DLL

D2d1_3.dll

See also

ID2D1DeviceContext2