IDXVAHD_Device::GetVideoProcessorInputFormats method (dxvahd.h)

Gets a list of the input formats supported by the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

Syntax

HRESULT GetVideoProcessorInputFormats(
  [in]  UINT      Count,
  [out] D3DFORMAT *pFormats
);

Parameters

[in] Count

The number of formats to retrieve. This parameter must equal the InputFormatCount member of the DXVAHD_VPDEVCAPS structure. Call the IDXVAHD_Device::GetVideoProcessorDeviceCaps method to get this value.

[out] pFormats

A pointer to an array of D3DFORMAT values. The Count parameter specifies the number of elements in the array. The method fills the array with a list of input formats.

Return value

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

Remarks

The list of formats can include both D3DFORMAT values, such as D3DFMT_X8R8G8B8, and FOURCC codes, such as 'NV12'. For more information, see Video FOURCCs.

Examples

// Checks whether a DXVA-HD device supports a specified input format.

HRESULT CheckInputFormatSupport(
    IDXVAHD_Device          *pDXVAHD,
    const DXVAHD_VPDEVCAPS& caps,
    D3DFORMAT               d3dformat
    )
{
    D3DFORMAT *pFormats = new (std::nothrow) D3DFORMAT[ caps.InputFormatCount ];
    if (pFormats == NULL)
    {
        return E_OUTOFMEMORY;
    }

    HRESULT hr = pDXVAHD->GetVideoProcessorInputFormats(
        caps.InputFormatCount, 
        pFormats
        );

    if (FAILED(hr)) 
    { 
        goto done; 
    }

    UINT index;
    for (index = 0; index < caps.InputFormatCount; index++)
    {
        if (pFormats[index] == d3dformat)
        {
            break;
        }
    }
    if (index == caps.InputFormatCount)
    {
        hr = E_FAIL;
    }

done:
    delete [] pFormats;
    return hr;
}

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header dxvahd.h

See also

DXVA-HD

IDXVAHD_Device