Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Enables static optimizations in the video pipeline.
Data type
UINT32
Get/set
To get this attribute, call IMFAttributes::GetUINT32.
To set this attribute, call IMFAttributes::SetUINT32.
Applies to
Remarks
Set this attribute before loading a topology. If the attribute is TRUE, the topology loader attempts to optimize the pipeline before playback starts.
If you set this attribute, you should also set the following attributes:
The GUID constant for this attribute is exported from mfuuid.lib.
Examples
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;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 7 [desktop apps only] |
Minimum supported server |
Windows Server 2008 R2 [desktop apps only] |
Header |
|
See also