summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2012-04-04 14:53:45 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-04-04 14:53:45 +0100
commit38982a71dc5b01a5f2c479c7bc81a3b8c940731c (patch)
tree319fc5101644ff0619dfaa11861746e856afcc34
parent46a74a4703ab286f751388a2ffb51887ce24758d (diff)
More build fixes for GLib 2.16tp-vision
-rw-r--r--configure.ac2
-rw-r--r--docs/libs/Makefile.am2
-rw-r--r--gst-libs/gst/Makefile.am6
-rw-r--r--gst-libs/gst/codecparsers/gstvc1parser.c2
-rw-r--r--gst-libs/gst/glib-compat-private.h180
-rw-r--r--sys/vdpau/h264/gsth264frame.c4
6 files changed, 192 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index f33fd7206..499e1f208 100644
--- a/configure.ac
+++ b/configure.ac
@@ -311,7 +311,7 @@ AG_GST_CHECK_PLUGIN(audiovisualizers)
AG_GST_CHECK_PLUGIN(autoconvert)
AG_GST_CHECK_PLUGIN(bayer)
AG_GST_CHECK_PLUGIN(camerabin)
-AG_GST_CHECK_PLUGIN(camerabin2)
+dnl AG_GST_CHECK_PLUGIN(camerabin2)
AG_GST_CHECK_PLUGIN(cdxaparse)
AG_GST_CHECK_PLUGIN(coloreffects)
AG_GST_CHECK_PLUGIN(colorspace)
diff --git a/docs/libs/Makefile.am b/docs/libs/Makefile.am
index 1ab46ff3b..63df6b4d1 100644
--- a/docs/libs/Makefile.am
+++ b/docs/libs/Makefile.am
@@ -49,10 +49,10 @@ extra_files =
# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
# contains GtkObjects/GObjects and you want to document signals and properties.
+# $(top_builddir)/gst-libs/gst/basecamerabinsrc/libgstbasecamerabinsrc-@GST_MAJORMINOR@.la
GTKDOC_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS)
GTKDOC_LIBS = \
$(top_builddir)/gst-libs/gst/codecparsers/libgstcodecparsers-@GST_MAJORMINOR@.la \
- $(top_builddir)/gst-libs/gst/basecamerabinsrc/libgstbasecamerabinsrc-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/interfaces/libgstphotography-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/signalprocessor/libgstsignalprocessor-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/video/libgstbasevideo-@GST_MAJORMINOR@.la \
diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am
index 130956ee4..f30a5c660 100644
--- a/gst-libs/gst/Makefile.am
+++ b/gst-libs/gst/Makefile.am
@@ -1,6 +1,8 @@
-SUBDIRS = interfaces signalprocessor video basecamerabinsrc codecparsers
+# basecamerabinsrc - we don't need it for our purposes (tpm)
+
+SUBDIRS = interfaces signalprocessor video codecparsers
noinst_HEADERS = gst-i18n-plugin.h gettext.h
-DIST_SUBDIRS = interfaces signalprocessor video basecamerabinsrc codecparsers
+DIST_SUBDIRS = interfaces signalprocessor video codecparsers
diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c
index 8f2937f01..cb214f07c 100644
--- a/gst-libs/gst/codecparsers/gstvc1parser.c
+++ b/gst-libs/gst/codecparsers/gstvc1parser.c
@@ -38,6 +38,8 @@
#include <gst/base/gstbitreader.h>
#include <string.h>
+#include "gst/glib-compat-private.h"
+
#ifndef GST_DISABLE_GST_DEBUG
#define GST_CAT_DEFAULT ensure_debug_category()
diff --git a/gst-libs/gst/glib-compat-private.h b/gst-libs/gst/glib-compat-private.h
new file mode 100644
index 000000000..fc56092a1
--- /dev/null
+++ b/gst-libs/gst/glib-compat-private.h
@@ -0,0 +1,180 @@
+/*
+ * glib-compat.c
+ * Functions copied from glib 2.10
+ *
+ * Copyright 2005 David Schleef <ds@schleef.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GLIB_COMPAT_PRIVATE_H__
+#define __GLIB_COMPAT_PRIVATE_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#if !GLIB_CHECK_VERSION(2,25,0)
+
+#if defined (_MSC_VER) && !defined(_WIN64)
+typedef struct _stat32 GStatBuf;
+#else
+typedef struct stat GStatBuf;
+#endif
+
+#endif
+
+#if GLIB_CHECK_VERSION(2,26,0)
+#define GLIB_HAS_GDATETIME
+#endif
+
+/* See bug #651514 */
+#if GLIB_CHECK_VERSION(2,29,5)
+#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
+ g_atomic_pointer_compare_and_exchange ((a),(b),(c))
+#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
+ g_atomic_int_compare_and_exchange ((a),(b),(c))
+#else
+#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \
+ g_atomic_pointer_compare_and_exchange ((volatile gpointer *)(a),(b),(c))
+#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \
+ g_atomic_int_compare_and_exchange ((volatile int *)(a),(b),(c))
+#endif
+
+/* See bug #651514 */
+#if GLIB_CHECK_VERSION(2,29,5)
+#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_add ((a),(b))
+#else
+#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_exchange_and_add ((a),(b))
+#endif
+
+/* copies */
+
+#if GLIB_CHECK_VERSION (2, 31, 0)
+#define g_mutex_new gst_g_mutex_new
+static inline GMutex *
+gst_g_mutex_new (void)
+{
+ GMutex *mutex = g_slice_new (GMutex);
+ g_mutex_init (mutex);
+ return mutex;
+}
+#define g_mutex_free gst_g_mutex_free
+static inline void
+gst_g_mutex_free (GMutex *mutex)
+{
+ g_mutex_clear (mutex);
+ g_slice_free (GMutex, mutex);
+}
+#define g_static_rec_mutex_init gst_g_static_rec_mutex_init
+static inline void
+gst_g_static_rec_mutex_init (GStaticRecMutex *mutex)
+{
+ static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT;
+
+ *mutex = init_mutex;
+}
+#define g_cond_new gst_g_cond_new
+static inline GCond *
+gst_g_cond_new (void)
+{
+ GCond *cond = g_slice_new (GCond);
+ g_cond_init (cond);
+ return cond;
+}
+#define g_cond_free gst_g_cond_free
+static inline void
+gst_g_cond_free (GCond *cond)
+{
+ g_cond_clear (cond);
+ g_slice_free (GCond, cond);
+}
+#define g_cond_timed_wait gst_g_cond_timed_wait
+static inline gboolean
+gst_g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *abs_time)
+{
+ gint64 end_time;
+
+ if (abs_time == NULL) {
+ g_cond_wait (cond, mutex);
+ return TRUE;
+ }
+
+ end_time = abs_time->tv_sec;
+ end_time *= 1000000;
+ end_time += abs_time->tv_usec;
+
+ /* would be nice if we had clock_rtoffset, but that didn't seem to
+ * make it into the kernel yet...
+ */
+ /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and
+ * g_get_real_time() are returning the same clock and we'd add ~0
+ */
+ end_time += g_get_monotonic_time () - g_get_real_time ();
+ return g_cond_wait_until (cond, mutex, end_time);
+}
+#endif /* GLIB_CHECK_VERSION (2, 31, 0) */
+
+/* To make things work with older GLib versions */
+#if ! GLIB_CHECK_VERSION(2,23,3)
+#define G_VALUE_COLLECT_INIT(p_val,valtype,varargs,flags,p_err) \
+ do { \
+ g_value_init (p_val,valtype); \
+ G_VALUE_COLLECT (p_val, varargs, flags, p_err); \
+ } while(0)
+#endif
+
+#if ! GLIB_CHECK_VERSION(2,23,3)
+#define g_thread_get_initialized g_thread_supported
+#endif
+
+#if ! GLIB_CHECK_VERSION(2,22,0)
+#define g_main_context_get_thread_default() NULL
+#define g_main_context_push_thread_default(c)
+#define g_main_context_pop_thread_default(c)
+#define g_mapped_file_unref g_mapped_file_free
+#endif
+
+#ifndef G_GUINTPTR_FORMAT
+#if GLIB_SIZEOF_VOID_P == GLIB_SIZEOF_LONG
+typedef signed long gintptr;
+typedef unsigned long guintptr;
+#define G_GINTPTR_FORMAT "ld"
+#define G_GUINTPTR_FORMAT "lu"
+#else
+#error "FIX G_GUINTPTR_FORMAT and friends for this arch"
+#endif
+#endif
+
+#if ! GLIB_CHECK_VERSION(2,24,0)
+#define SIZE_OVERFLOWS(a,b) (G_UNLIKELY ((b) > 0 && (a) > G_MAXSIZE / (b)))
+#define g_realloc_n gst_g_realloc_n
+static inline gpointer
+gst_g_realloc_n (gpointer mem, gsize n_blocks, gsize n_block_bytes)
+{
+ if (SIZE_OVERFLOWS (n_blocks, n_block_bytes)) {
+ g_error ("%s: overflow allocating %"G_GSIZE_FORMAT"*%"G_GSIZE_FORMAT" bytes",
+ G_STRLOC, n_blocks, n_block_bytes);
+ }
+ return g_realloc (mem, n_blocks * n_block_bytes);
+}
+#endif
+
+/* adaptations */
+
+G_END_DECLS
+
+#endif
diff --git a/sys/vdpau/h264/gsth264frame.c b/sys/vdpau/h264/gsth264frame.c
index 421de0fe3..432f2c781 100644
--- a/sys/vdpau/h264/gsth264frame.c
+++ b/sys/vdpau/h264/gsth264frame.c
@@ -49,6 +49,10 @@ gst_h264_frame_new (void)
static GObjectClass *gst_h264_frame_parent_class;
+#if ! GLIB_CHECK_VERSION(2,22,0)
+#define g_ptr_array_unref(arr) g_ptr_array_free(arr,TRUE)
+#endif
+
static void
gst_h264_frame_finalize (GstH264Frame * h264_frame)
{