From a973a4f154d9e17ed6551f3511f6a2bdc38f580f Mon Sep 17 00:00:00 2001 From: Brian Cameron Date: Mon, 21 Jan 2008 19:35:58 +0000 Subject: [PATCH] configure.ac: Detect video4linux headers on Solaris too. Original commit message from CVS: * configure.ac: Detect video4linux headers on Solaris too. * sys/v4l2/gstv4l2colorbalance.h: * sys/v4l2/gstv4l2object.h: * sys/v4l2/v4l2_calls.c: * sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize), (gst_v4l2_buffer_new): Make v4l2 build on Solaris. Patch by: Brian Cameron Fixes: #510505 --- ChangeLog | 14 ++++++++++++++ configure.ac | 22 +++++++++++++++++++--- sys/v4l2/gstv4l2colorbalance.h | 2 +- sys/v4l2/gstv4l2object.h | 4 ++++ sys/v4l2/v4l2_calls.c | 5 +++++ sys/v4l2/v4l2src_calls.c | 9 +++++++-- 6 files changed, 50 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 005b392..c2d0904 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-01-21 Jan Schmidt + + * configure.ac: + Detect video4linux headers on Solaris too. + * sys/v4l2/gstv4l2colorbalance.h: + * sys/v4l2/gstv4l2object.h: + * sys/v4l2/v4l2_calls.c: + * sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize), + (gst_v4l2_buffer_new): + + Make v4l2 build on Solaris. + Patch by: Brian Cameron + Fixes: #510505 + 2008-01-21 Stefan Kost * docs/plugins/gst-plugins-good-plugins-docs.sgml: diff --git a/configure.ac b/configure.ac index d0153d0..427fbf7 100644 --- a/configure.ac +++ b/configure.ac @@ -473,10 +473,15 @@ AG_GST_CHECK_FEATURE(GST_V4L2, [Video 4 Linux 2], v4l2src, [ AC_MSG_CHECKING([Checking for uptodate v4l2 installation]) AC_TRY_COMPILE([ #include +#ifdef __sun /* Solaris */ +#include +#include +#else /* Linux */ #include #define _LINUX_TIME_H #define __user #include +#endif #if defined(V4L2_MAJOR_VERSION) || defined(V4L2_MINOR_VERSION) #error too early v4l2 version or no v4l2 at all #endif @@ -488,13 +493,19 @@ return 0; ], [ HAVE_GST_V4L2="no" AC_MSG_RESULT(no) - AC_CHECK_HEADER(linux/videodev2.h, + + HAVE_VIDEODEV=no + AC_CHECK_HEADER(linux/videodev2.h, [ HAVE_VIDEODEV=yes ], [ + AC_CHECK_HEADER(sys/videodev2.h, [ HAVE_VIDEODEV=yes ]) + ]) + + if test "x$HAVE_VIDEODEV" = "xyes"; then AC_MSG_WARN([video4linux2 headers were found, but they're old.]) AC_MSG_WARN([Please update v4l2 to compile the v4l2 plugins]) - ], [ + else AC_MSG_WARN([video4linux2 was not found]) - ]) + fi ]) if [ test x$HAVE_GST_V4L2 = xyes ]; then @@ -503,10 +514,15 @@ return 0; AC_MSG_CHECKING(struct v4l2_buffer declaration) AC_TRY_COMPILE([ #include +#ifdef __sun /* Solaris */ +#include +#include +#else /* Linux */ #include #define _LINUX_TIME_H #define __user #include +#endif ],[ struct v4l2_buffer buf; buf.index = 0; diff --git a/sys/v4l2/gstv4l2colorbalance.h b/sys/v4l2/gstv4l2colorbalance.h index ecd0111..e251927 100644 --- a/sys/v4l2/gstv4l2colorbalance.h +++ b/sys/v4l2/gstv4l2colorbalance.h @@ -79,7 +79,7 @@ interface_as_function ## _color_balance_set_value (GstColorBalance * balance, gint value) \ { \ Type *this = (Type*) balance; \ - return gst_v4l2_color_balance_set_value(this->v4l2object, channel, value); \ + gst_v4l2_color_balance_set_value(this->v4l2object, channel, value); \ } \ \ static gint \ diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h index f309bc7..d08d274 100644 --- a/sys/v4l2/gstv4l2object.h +++ b/sys/v4l2/gstv4l2object.h @@ -37,10 +37,14 @@ * errors here, check your linux/time.h && sys/time.h header setup. */ #include +#ifndef __sun #include #define _LINUX_TIME_H #define __user #include +#else +#include +#endif #include #include diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index 1d00591..616f659 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -33,6 +33,11 @@ #include #include #include +#ifdef __sun +/* Needed on older Solaris Nevada builds (72 at least) */ +#include +#include +#endif #include "v4l2_calls.h" #include "gstv4l2tuner.h" #include "gstv4l2xoverlay.h" diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index dc6a23b..4ecedf3 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -36,6 +36,11 @@ #include "v4l2src_calls.h" #include #include +#ifdef __sun +/* Needed on older Solaris Nevada builds (72 at least) */ +#include +#include +#endif #include "gstv4l2tuner.h" @@ -98,7 +103,7 @@ gst_v4l2_buffer_finalize (GstV4l2Buffer * buffer) if (!resuscitated) { GST_LOG ("buffer %p not recovered, unmapping", buffer); gst_mini_object_unref (GST_MINI_OBJECT (pool)); - munmap (GST_BUFFER_DATA (buffer), buffer->vbuffer.length); + munmap ((void *) GST_BUFFER_DATA (buffer), buffer->vbuffer.length); } } @@ -173,7 +178,7 @@ gst_v4l2_buffer_new (GstV4l2BufferPool * pool, guint index, GstCaps * caps) GST_LOG (" length: %u", ret->vbuffer.length); GST_LOG (" input: %u", ret->vbuffer.input); - data = mmap (0, ret->vbuffer.length, + data = (guint8 *) mmap (0, ret->vbuffer.length, PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd, ret->vbuffer.m.offset); -- 2.7.4