[vlc-commits] [Git][videolan/vlc][master] 2 commits: dxgi_swapchain: unify the isWin8OrGreater check
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Feb 1 14:23:39 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
41532b38 by Steve Lhomme at 2025-02-01T14:11:09+00:00
dxgi_swapchain: unify the isWin8OrGreater check
Similar to ca1e15692ce9acc2d421c302434efd10eec64d27.
GetCurrentThreadStackLimits is also available in UWP.
- - - - -
87da908e by Steve Lhomme at 2025-02-01T14:11:09+00:00
dxgi_swapchain: don't look for OS API if we build with Win10/8
- - - - -
1 changed file:
- modules/video_output/win32/dxgi_swapchain.cpp
Changes:
=====================================
modules/video_output/win32/dxgi_swapchain.cpp
=====================================
@@ -245,25 +245,33 @@ static void FillSwapChainDesc(dxgi_swapchain *display, UINT width, UINT height,
out->Format = display->pixelFormat->formatTexture;
//out->Flags = 512; // DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO;
+#if (_WIN32_WINNT < _WIN32_WINNT_WIN10)
bool isWin10OrGreater = false;
HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (likely(hKernel32 != NULL))
isWin10OrGreater = GetProcAddress(hKernel32, "GetSystemCpuSetInformation") != NULL;
if (isWin10OrGreater)
+#endif // !_WIN32_WINNT_WIN10
out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
+#if (_WIN32_WINNT < _WIN32_WINNT_WIN10)
else
{
- bool isWin80OrGreater = false;
+#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
+ bool isWin8OrGreater = false;
if (likely(hKernel32 != NULL))
- isWin80OrGreater = GetProcAddress(hKernel32, "CheckTokenCapability") != NULL;
- if (isWin80OrGreater)
+ isWin8OrGreater = GetProcAddress(hKernel32, "GetCurrentThreadStackLimits") != NULL;
+ if (isWin8OrGreater)
+#endif // !_WIN32_WINNT_WIN8
out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
else
{
out->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
out->BufferCount = 1;
}
+#endif // !_WIN32_WINNT_WIN8
}
+#endif // !_WIN32_WINNT_WIN10
}
static void DXGI_CreateSwapchainHwnd(dxgi_swapchain *display,
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6e67d0312d57880d446f238eee55f968a7314f1b...87da908e898e975c03c91e848f6c3c4131130ec8
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6e67d0312d57880d446f238eee55f968a7314f1b...87da908e898e975c03c91e848f6c3c4131130ec8
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list