win32: Enable high-resolution timer for MinGW build
authorSeungha Yang <seungha@centricular.com>
Mon, 11 Apr 2022 16:01:23 +0000 (01:01 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 12 Apr 2022 15:09:16 +0000 (15:09 +0000)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2153>

subprojects/gst-plugins-bad/sys/d3d11/gstd3d11decoder.cpp
subprojects/gst-plugins-bad/sys/d3d11/meson.build
subprojects/gst-plugins-base/tools/gst-play.c
subprojects/gst-plugins-base/tools/meson.build
subprojects/gstreamer/tools/gst-launch.c
subprojects/gstreamer/tools/meson.build

index 23329a0..c517b68 100644 (file)
@@ -58,7 +58,7 @@
 #include <string>
 
 #ifdef HAVE_WINMM
-#include <timeapi.h>
+#include <mmsystem.h>
 #endif
 
 GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_decoder_debug);
index 11306f1..36a8d43 100644 (file)
@@ -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
index d8702b9..6d6da71 100644 (file)
@@ -42,7 +42,7 @@
 #ifdef HAVE_WINMM
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
-#include <timeapi.h>
+#include <mmsystem.h>
 #endif
 
 #include "gst-play-kb.h"
index f96d060..ed180f8 100644 (file)
@@ -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
index 2a3bf4b..16759e6 100644 (file)
@@ -47,7 +47,7 @@
 #include <locale.h>             /* for LC_ALL */
 #include "tools.h"
 #ifdef HAVE_WINMM
-#include <timeapi.h>
+#include <mmsystem.h>
 #endif
 
 extern volatile gboolean glib_on_error_halt;
index ad2f5d3..f51892c 100644 (file)
@@ -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