IDXVAHD_Device::GetVideoProcessorOutputFormats method (dxvahd.h)

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

Syntax

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

Parameters

[in] Count

The number of formats to retrieve. This parameter must equal the OutputFormatCount 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 output 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 output format.

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

    HRESULT hr = pDXVAHD->GetVideoProcessorOutputFormats(
        caps.OutputFormatCount, 
        pFormats
        );

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

    UINT index;
    for (index = 0; index < caps.OutputFormatCount; index++)
    {
        if (pFormats[index] == d3dformat)
        {
            break;
        }
    }
    if (index == caps.OutputFormatCount)
    {
        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