summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaniv Kamay <ykamay@redhat.com>2009-10-26 23:30:41 +0200
committerYaniv Kamay <ykamay@redhat.com>2009-10-27 13:29:39 +0200
commit402a201ce6f56dbbedb641edc912295d79bf7a3b (patch)
treeb3d57364c4a92e78f8764cec54d5b0497e39a2d4
parent7498ef3b666b0587e6dd94b40e1371c69937d628 (diff)
downloadspice-402a201ce6f56dbbedb641edc912295d79bf7a3b.tar.gz
spice-402a201ce6f56dbbedb641edc912295d79bf7a3b.tar.xz
spice-402a201ce6f56dbbedb641edc912295d79bf7a3b.zip
fix build on Debian
-rw-r--r--client/display_channel.cpp5
-rw-r--r--client/windows/redc.vcproj4
-rw-r--r--client/x11/Makefile.am1
-rw-r--r--common/linux/ffmpeg_inc.h.in12
-rw-r--r--common/win/ffmpeg_inc.h4
-rw-r--r--configure.ac7
-rw-r--r--server/Makefile.am1
-rw-r--r--server/red_worker.c2
-rw-r--r--server/reds.c8
9 files changed, 34 insertions, 10 deletions
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 5d3a7afd..2e2e4f56 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -40,10 +40,7 @@
#include "red_gdi_canvas.h"
#endif
#include "platform_utils.h"
-
-extern "C" {
-#include "libavcodec/avcodec.h"
-}
+#include "ffmpeg_inc.h"
static Mutex avcodec_mutex;
diff --git a/client/windows/redc.vcproj b/client/windows/redc.vcproj
index 25ff3259..e0919c50 100644
--- a/client/windows/redc.vcproj
+++ b/client/windows/redc.vcproj
@@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=".;..;&quot;..\..\common\win\my_getopt-1.5&quot;;..\..\common;&quot;$(SPICE_LIBS)\include&quot;;&quot;$(SPICE_LIBS)\include\qcairo&quot;;&quot;$(SPICE_LIBS)\include\ffmpeg&quot;"
+ AdditionalIncludeDirectories=".;..;..\..\common;..\..\common\win;&quot;..\..\common\win\my_getopt-1.5&quot;;&quot;$(SPICE_LIBS)\include&quot;;&quot;$(SPICE_LIBS)\include\qcairo&quot;;&quot;$(SPICE_LIBS)\include\ffmpeg&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;CAIRO_CANVAS_ACCESS_TEST;CAIRO_CANVAS_CACHE;CAIRO_CANVAS_CACH_IS_SHARED;RED_DEBUG;CAIRO_CANVAS_NO_CHUNKS;_WIN32_WINNT=0x0500;LOG4CPLUS_STATIC;USE_GLZ;PTW32_STATIC_LIB"
MinimalRebuild="false"
BasicRuntimeChecks="3"
@@ -124,7 +124,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;..;&quot;..\..\common\win\my_getopt-1.5&quot;;..\..\common;&quot;$(SPICE_LIBS)\include&quot;;&quot;$(SPICE_LIBS)\include\qcairo&quot;;&quot;$(SPICE_LIBS)\include\ffmpeg&quot;"
+ AdditionalIncludeDirectories=".;..;..\..\common;..\..\common\win;&quot;..\..\common\win\my_getopt-1.5&quot;;&quot;$(SPICE_LIBS)\include&quot;;&quot;$(SPICE_LIBS)\include\qcairo&quot;;&quot;$(SPICE_LIBS)\include\ffmpeg&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;CAIRO_CANVAS_ACCESS_TEST;CAIRO_CANVAS_CACHE;CAIRO_CANVAS_NO_CHUNKS;CAIRO_CANVAS_CACH_IS_SHARED;_WIN32_WINNT=0x0500;LOG4CPLUS_STATIC;USE_GLZ;PTW32_STATIC_LIB"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
diff --git a/client/x11/Makefile.am b/client/x11/Makefile.am
index 2bb1c853..9d87127b 100644
--- a/client/x11/Makefile.am
+++ b/client/x11/Makefile.am
@@ -12,6 +12,7 @@ INCLUDES = \
-I. \
-I.. \
-I$(top_srcdir)/common \
+ -I$(top_srcdir)/common/linux \
-I$(top_srcdir)/client \
$(GL_CFLAGS) \
$(ALSA_CFLAGS) \
diff --git a/common/linux/ffmpeg_inc.h.in b/common/linux/ffmpeg_inc.h.in
new file mode 100644
index 00000000..7e322b51
--- /dev/null
+++ b/common/linux/ffmpeg_inc.h.in
@@ -0,0 +1,12 @@
+
+#ifdef __GNUG__
+extern "C" {
+#endif
+
+#include "@AVCODEC_PREFIX@avcodec.h"
+
+#ifdef __GNUG__
+}
+#endif
+
+
diff --git a/common/win/ffmpeg_inc.h b/common/win/ffmpeg_inc.h
new file mode 100644
index 00000000..8d4473ff
--- /dev/null
+++ b/common/win/ffmpeg_inc.h
@@ -0,0 +1,4 @@
+
+extern "C" {
+#include "libavcodec/avcodec.h"
+}
diff --git a/configure.ac b/configure.ac
index 25a2f034..1e368308 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,12 @@ FFMPEG_LIBDIR=`pkg-config --variable=libdir libavutil`
AC_SUBST(FFMPEG_LIBDIR)
SPICE_REQUIRES+=" libavcodec libavutil"
+saved_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
+AC_CHECK_HEADER(avcodec.h, AVCODEC_PREFIX="", AVCODEC_PREFIX="libavcodec/")
+CPPFLAGS="$saved_CPPFLAGS"
+AC_SUBST([AVCODEC_PREFIX])
+
PKG_CHECK_MODULES(ALSA, alsa)
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
@@ -297,6 +303,7 @@ AC_OUTPUT([
Makefile
spice.pc
common/Makefile
+common/linux/ffmpeg_inc.h
server/Makefile
client/Makefile
client/x11/Makefile
diff --git a/server/Makefile.am b/server/Makefile.am
index e6ffab40..2731efc3 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -3,6 +3,7 @@ NULL =
INCLUDES = \
-I. \
-I$(top_srcdir)/common \
+ -I$(top_srcdir)/common/linux \
$(FFMPEG_CFLAGS) \
$(QCAIRO_CFLAGS) \
$(GL_CFLAGS) \
diff --git a/server/red_worker.c b/server/red_worker.c
index 4604e05e..1490f9e7 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -39,7 +39,7 @@
#include "cairo_canvas.h"
#include "gl_canvas.h"
#include "ogl_ctx.h"
-#include "libavcodec/avcodec.h"
+#include "ffmpeg_inc.h"
#include "quic.h"
#include "lz.h"
#include "glz_encoder_dictionary.h"
diff --git a/server/reds.c b/server/reds.c
index 067304d7..d73bec49 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -27,7 +27,6 @@
#include <time.h>
#include <pthread.h>
#include <sys/mman.h>
-#include <sys/user.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
@@ -354,7 +353,10 @@ typedef struct PingItem {
int size;
} PingItem;
-static uint8_t zero_page[PAGE_SIZE] = {0};
+
+#define ZERO_BUF_SIZE 4096
+
+static uint8_t zero_page[ZERO_BUF_SIZE] = {0};
static void reds_main_write(void *data);
static void reds_push();
@@ -1083,7 +1085,7 @@ static void reds_prepare_ping_item(RedsOutItem *in_item, struct iovec* vec, int
int pos = 2;
while (size) {
ASSERT(pos < REDS_MAX_SEND_IOVEC);
- int now = MIN(PAGE_SIZE, size);
+ int now = MIN(ZERO_BUF_SIZE, size);
size -= now;
vec[pos].iov_base = zero_page;
vec[pos].iov_len = now;