Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetVideoProcessorOutputFormats

IDXVAHD_Device::GetVideoProcessorOutputFormats method

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

Count [in]

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.

pFormats [out]

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

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Dxvahd.h

See also

DXVA-HD
IDXVAHD_Device

 

 

Community Additions

ADD
Show:
© 2015 Microsoft