Bagikan melalui


IDXVAHD_Device::Metode GetVideoProcessorOutputFormats (dxvahd.h)

Mendapatkan daftar format output yang didukung oleh perangkat Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

Sintaks

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

Parameter

[in] Count

Jumlah format yang akan diambil. Parameter ini harus sama dengan anggota OutputFormatCount dari struktur DXVAHD_VPDEVCAPS . Panggil metode IDXVAHD_Device::GetVideoProcessorDeviceCaps untuk mendapatkan nilai ini.

[out] pFormats

Penunjuk ke array nilai D3DFORMAT . Parameter Count menentukan jumlah elemen dalam array. Metode ini mengisi array dengan daftar format output.

Menampilkan nilai

Jika metode ini berhasil, metode ini mengembalikan S_OK. Jika tidak, kode kesalahan HRESULT akan dikembalikan.

Keterangan

Daftar format dapat mencakup nilai D3DFORMAT , seperti D3DFMT_X8R8G8B8, dan kode FOURCC, seperti 'NV12'. Untuk informasi selengkapnya, lihat Video FOURC.

Contoh

// 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;
}

Persyaratan

   
Klien minimum yang didukung Windows 7 [hanya aplikasi desktop]
Server minimum yang didukung Windows Server 2008 R2 [hanya aplikasi desktop]
Target Platform Windows
Header dxvahd.h

Lihat juga

DXVA-HD

IDXVAHD_Device