From 687bcfb30ea9dfd216493f99164f7f533fc20e78 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 8 Nov 2023 16:10:02 +0100 Subject: [PATCH] spout cap.: improvements - removed inclusion of config*.h - use Sleep instead of usleep - subsequent improves in gl_common.h (removed config*.h) --- src/gl_context.h | 14 ++++---------- src/video_capture/spout.cpp | 14 +++++--------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/gl_context.h b/src/gl_context.h index 6c2ff682a..fd426468d 100644 --- a/src/gl_context.h +++ b/src/gl_context.h @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2012-2013 CESNET, z. s. p. o. + * Copyright (c) 2012-2023 CESNET, z. s. p. o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,19 +38,13 @@ #ifndef _GL_CONTEXT_H_ #define _GL_CONTEXT_H_ -#ifdef HAVE_CONFIG_H -#include "config.h" -#include "config_win32.h" -#include "config_unix.h" -#endif // HAVE_CONFIG_H - -#if defined HAVE_LINUX || defined WIN32 +#if defined __linux__ || defined _WIN32 #include #else #include #endif /* HAVE_LINUX */ -#ifdef HAVE_MACOSX +#ifdef __APPLE__ #include #endif @@ -58,7 +52,7 @@ extern "C" { #endif // __cplusplus -#if defined HAVE_MACOSX && ! defined __MAC_10_8 +#if defined __APPLE__ && ! defined __MAC_10_8 #define glGenFramebuffers glGenFramebuffersEXT #define glBindFramebuffer glBindFramebufferEXT #define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT diff --git a/src/video_capture/spout.cpp b/src/video_capture/spout.cpp index 712b3619d..3035c821b 100644 --- a/src/video_capture/spout.cpp +++ b/src/video_capture/spout.cpp @@ -35,22 +35,18 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" -#endif - -#include "gl_context.h" // it looks like it needs to be included prior to Spout.h #include #include #include #include +#include #include +#include #include #include "debug.h" +#include "gl_context.h" #include "host.h" #include "lib_common.h" #include "spout_sender.h" // spout_set_log_level @@ -214,7 +210,7 @@ static void vidcap_spout_done(void *state) static struct video_frame *vidcap_spout_grab(void *state, struct audio_frame **audio) { enum { - MS100_IN_US = 100 * 1000, + MS100 = 100, }; state_vidcap_spout *s = (state_vidcap_spout *) state; @@ -227,7 +223,7 @@ static struct video_frame *vidcap_spout_grab(void *state, struct audio_frame **a vf_free(out); gl_context_make_current(NULL); MSG(WARNING, "No signal detected...\n"); - usleep(MS100_IN_US); + Sleep(MS100); return NULL; } if (s->spout_state->IsUpdated()) {