From 2548014dfc35fc2d0bfe3430f67abf00ee6f71a7 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 12 Apr 2022 01:01:23 +0900 Subject: [PATCH] win32: Enable high-resolution timer for MinGW build timeapi.h is missing in our MinGW toolchain. Include mmsystem.h header instead, which defines struct and APIs in case of our MinGW toolchain. Note that in case of native Windows10 SDK (MSVC build), mmsystem.h will include timeapi.h Part-of: --- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp | 2 +- subprojects/gst-plugins-bad/sys/d3d11/meson.build | 2 +- subprojects/gst-plugins-base/tools/gst-play.c | 2 +- subprojects/gst-plugins-base/tools/meson.build | 2 +- subprojects/gstreamer/tools/gst-launch.c | 2 +- subprojects/gstreamer/tools/meson.build | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp index 23329a0..c517b68 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp @@ -58,7 +58,7 @@ #include #ifdef HAVE_WINMM -#include +#include #endif GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_decoder_debug); diff --git a/subprojects/gst-plugins-bad/sys/d3d11/meson.build b/subprojects/gst-plugins-bad/sys/d3d11/meson.build index 11306f1..36a8d43 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/meson.build +++ b/subprojects/gst-plugins-bad/sys/d3d11/meson.build @@ -66,7 +66,7 @@ if d3d11_winapi_desktop 'gstd3d11screencapturesrc.cpp'] # multimedia clock is desktop only API - if winmm_lib.found() and cc.has_header('timeapi.h') + if winmm_lib.found() and cc.has_header('mmsystem.h') extra_args += ['-DHAVE_WINMM'] extra_dep += [winmm_lib] endif diff --git a/subprojects/gst-plugins-base/tools/gst-play.c b/subprojects/gst-plugins-base/tools/gst-play.c index d8702b9..6d6da71 100644 --- a/subprojects/gst-plugins-base/tools/gst-play.c +++ b/subprojects/gst-plugins-base/tools/gst-play.c @@ -42,7 +42,7 @@ #ifdef HAVE_WINMM #define WIN32_LEAN_AND_MEAN #include -#include +#include #endif #include "gst-play-kb.h" diff --git a/subprojects/gst-plugins-base/tools/meson.build b/subprojects/gst-plugins-base/tools/meson.build index f96d060..ed180f8 100644 --- a/subprojects/gst-plugins-base/tools/meson.build +++ b/subprojects/gst-plugins-base/tools/meson.build @@ -18,7 +18,7 @@ if host_system == 'windows' if not building_for_uwp winmm_lib = cc.find_library('winmm', required: false) - if winmm_lib.found() and cc.has_header('timeapi.h') + if winmm_lib.found() and cc.has_header('mmsystem.h') extra_args += ['-DHAVE_WINMM'] extra_deps += [winmm_lib] endif diff --git a/subprojects/gstreamer/tools/gst-launch.c b/subprojects/gstreamer/tools/gst-launch.c index 2a3bf4b..16759e6 100644 --- a/subprojects/gstreamer/tools/gst-launch.c +++ b/subprojects/gstreamer/tools/gst-launch.c @@ -47,7 +47,7 @@ #include /* for LC_ALL */ #include "tools.h" #ifdef HAVE_WINMM -#include +#include #endif extern volatile gboolean glib_on_error_halt; diff --git a/subprojects/gstreamer/tools/meson.build b/subprojects/gstreamer/tools/meson.build index ad2f5d3..f51892c 100644 --- a/subprojects/gstreamer/tools/meson.build +++ b/subprojects/gstreamer/tools/meson.build @@ -10,7 +10,7 @@ extra_launch_arg = [] if gst_parse if host_system == 'windows' and not building_for_uwp winmm_lib = cc.find_library('winmm', required: false) - if winmm_lib.found() and cc.has_header('timeapi.h') + if winmm_lib.found() and cc.has_header('mmsystem.h') extra_launch_dep += [winmm_lib] extra_launch_arg += ['-DHAVE_WINMM'] endif -- 2.7.4