atribut MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS

Mengaktifkan pengoptimalan statis dalam alur video.

Jenis Data

UINT32

Dapatkan/atur

Untuk mendapatkan atribut ini, panggil IMFAttributes::GetUINT32.

Untuk mengatur atribut ini, panggil IMFAttributes::SetUINT32.

Berlaku untuk

IMFTopology

Keterangan

Atur atribut ini sebelum memuat topologi. Jika atribut true, pemuat topologi mencoba mengoptimalkan alur sebelum pemutaran dimulai.

Jika Anda mengatur atribut ini, Anda juga harus mengatur atribut berikut:

Konstanta GUID untuk atribut ini diekspor dari mfuuid.lib.

Contoh

HRESULT SetPlaybackOptimizations(IMFTopology *pTopology, HWND hwnd)
{
    HRESULT hr = pTopology->SetUINT32(
        MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS, TRUE);

    if (FAILED(hr))
    {
        return hr;
    }

    HMONITOR hCurrentMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);

    if (hCurrentMon)
    {
        MONITORINFO MonitorInfo = {0};
        MonitorInfo.cbSize = sizeof(MONITORINFO);

        BOOL fSucceeded = GetMonitorInfo(hCurrentMon, &MonitorInfo);

        if (fSucceeded )
        {
            const RECT& rcMonitor = MonitorInfo.rcMonitor;

            LONG width = rcMonitor.right - rcMonitor.left;
            LONG height = rcMonitor.bottom - rcMonitor.top;

            hr = MFSetAttributeSize(
                pTopology, 
                MF_TOPOLOGY_PLAYBACK_MAX_DIMS, 
                (UINT32)width, (UINT32)height
                );

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

            HDC hdc = GetDC(hwnd);

            hr = MFSetAttributeRatio(
                pTopology,
                MF_TOPOLOGY_PLAYBACK_FRAMERATE,
                GetDeviceCaps(hdc, VREFRESH), 1
                );

            ReleaseDC(hwnd, hdc);
        }
    }
done:
    return hr;
}

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung
Windows 7 [hanya aplikasi desktop]
Server minimum yang didukung
Windows Server 2008 R2 [hanya aplikasi desktop]
Header
Mfidl.h

Lihat juga

Daftar Alfabet Atribut Media Foundation

Atribut Topologi

Manajemen Kualitas Video