summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-01-30 18:25:03 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-02-07 11:23:04 +0100
commitb9938d4c19ee1279cdd0e437d83fcad49f8a094b (patch)
tree6ec1674128c46458f361cb6e973842e5acac4dd3
parent1a2f105e09dbac9fa4b547b9d70f1945047b8fc5 (diff)
downloadgstreamer-vaapi-b9938d4c19ee1279cdd0e437d83fcad49f8a094b.tar.gz
Add glib compatibility glue for older versions.
-rw-r--r--configure.ac3
-rw-r--r--gst-libs/gst/vaapi/Makefile.am1
-rw-r--r--gst-libs/gst/vaapi/glibcompat.h36
-rw-r--r--gst-libs/gst/vaapi/sysdeps.h2
4 files changed, 42 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 975d665b..63a5f1a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,9 @@ AC_SUBST(GTKDOC_VERSION)
dnl Check for GLib
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
PKG_CHECK_MODULES([GLIB], [glib-2.0])
+AC_CHECK_LIB([glib-2.0], [g_list_free_full], [
+ AC_DEFINE([HAVE_G_LIST_FREE_FULL], [1],
+ [Define to 1 if g_list_free_full() is available.])])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am
index 1477e16f..1312c386 100644
--- a/gst-libs/gst/vaapi/Makefile.am
+++ b/gst-libs/gst/vaapi/Makefile.am
@@ -70,6 +70,7 @@ libgstvaapi_source_h = \
$(NULL)
libgstvaapi_source_priv_h = \
+ glibcompat.h \
gstvaapi_priv.h \
gstvaapicompat.h \
gstvaapidebug.h \
diff --git a/gst-libs/gst/vaapi/glibcompat.h b/gst-libs/gst/vaapi/glibcompat.h
new file mode 100644
index 00000000..7df3ddfe
--- /dev/null
+++ b/gst-libs/gst/vaapi/glibcompat.h
@@ -0,0 +1,36 @@
+/*
+ * glibcompat.h - System-dependent definitions
+ *
+ * Copyright (C) 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#ifndef GLIB_COMPAT_H
+#define GLIB_COMPAT_H
+
+#include <glib.h>
+
+#ifndef HAVE_G_LIST_FREE_FULL
+static inline void
+g_list_free_full(GList *list, GDestroyNotify free_func)
+{
+ g_list_foreach(list, (GFunc)free_func, NULL);
+ g_list_free(list);
+}
+#endif
+
+#endif /* GLIB_COMPAT_H */
diff --git a/gst-libs/gst/vaapi/sysdeps.h b/gst-libs/gst/vaapi/sysdeps.h
index b4a8878d..c8be8907 100644
--- a/gst-libs/gst/vaapi/sysdeps.h
+++ b/gst-libs/gst/vaapi/sysdeps.h
@@ -26,4 +26,6 @@
# include "config.h"
#endif
+#include "glibcompat.h"
+
#endif /* SYSDEPS_H */