From 9c65d30bcf66cd2c245a53fda7ee7900021880c2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 6 May 2020 10:20:28 +0200 Subject: [PATCH] Allow system vrgstream.h override --- configure.ac | 4 ++++ src/rtp/rtp_callback.c | 8 +++++++- src/video_capture/shm.c | 8 +++++++- src/{vrgstream.h => vrgstream-fallback.h} | 0 4 files changed, 18 insertions(+), 2 deletions(-) rename src/{vrgstream.h => vrgstream-fallback.h} (100%) diff --git a/configure.ac b/configure.ac index 7bc907f29..5dee3d87f 100644 --- a/configure.ac +++ b/configure.ac @@ -3188,6 +3188,10 @@ AC_ARG_ENABLE(vrg, AC_CHECK_HEADER(vrgstream.h, FOUND_VRG_H=yes, FOUND_VRG_H=no) AC_CHECK_LIB(vrgstream, vrgStreamInit, FOUND_VRG_L=yes, FOUND_VRG_L=no) +if test $FOUND_VRG_H = yes; then + AC_DEFINE([HAVE_VRG_H], [1], [We can use vrgstream.h]) +fi + if test $vrg_req != no -a $FOUND_VRG_H = yes -a $FOUND_VRG_L = yes then LIBS="$LIBS -lvrgstream" diff --git a/src/rtp/rtp_callback.c b/src/rtp/rtp_callback.c index fb2880cfa..52c9279e9 100644 --- a/src/rtp/rtp_callback.c +++ b/src/rtp/rtp_callback.c @@ -74,8 +74,14 @@ #include "rtp/pbuf.h" #include "rtp/rtp_callback.h" #include "tfrc.h" + +// substitute RGBA not to collide with UG RGBA #define RGBA VR_RGBA -#include "vrgstream.h" +#ifdef HAVE_VRG_H +#include +#else +#include "vrgstream-fallback.h" +#endif #undef RGBA extern char *frame; diff --git a/src/video_capture/shm.c b/src/video_capture/shm.c index 5b6617b0e..9565cad5f 100644 --- a/src/video_capture/shm.c +++ b/src/video_capture/shm.c @@ -55,8 +55,14 @@ #include "video.h" #include "video_capture.h" #include "video_capture/shm.h" + +// substitute RGBA not to collide with UG RGBA #define RGBA VR_RGBA -#include "vrgstream.h" +#ifdef HAVE_VRG_H +#include +#else +#include "vrgstream-fallback.h" +#endif #undef RGBA #define MAX_BUF_LEN (7680 * 2160 / 3 * 2) diff --git a/src/vrgstream.h b/src/vrgstream-fallback.h similarity index 100% rename from src/vrgstream.h rename to src/vrgstream-fallback.h