Attribut d’optimisation de _ _ lecture statique de _ la topologie MF _

Active les optimisations statiques dans le pipeline vidéo.

Type de données

UINT32

Obtenir/définir

Pour récupérer cet attribut, appelez IMFAttributes :: GetUInt32.

Pour définir cet attribut, appelez IMFAttributes :: SetUINT32.

S’applique à

IMFTopology

Notes

Définissez cet attribut avant de charger une topologie. Si l’attribut a la valeur true, le chargeur de topologie tente d’optimiser le pipeline avant le démarrage de la lecture.

Si vous définissez cet attribut, vous devez également définir les attributs suivants :

La constante GUID de cet attribut est exportée à partir de mfuuid. lib.

Exemples

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

Spécifications

Condition requise Valeur
Client minimal pris en charge
applications de [ bureau Windows 7 uniquement]
Serveur minimal pris en charge
Windows Serveur 2008 R2, [ applications de bureau uniquement]
En-tête
Mfidl. h

Voir aussi

Liste alphabétique des attributs Media Foundation

Attributs de topologie

Gestion de la qualité vidéo