From c28c480eb9d3354bc2d1673aa21b346cab401375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 17 Sep 2010 08:43:48 +0200 Subject: [PATCH] cog: Allow compilation without orc Also don't ignore --disable-orc. Fixes bug #629897. --- configure.ac | 3 +-- ext/cog/Makefile.am | 2 ++ ext/cog/cogvirtframe.c | 4 ++++ ext/cog/gstcog.c | 4 ++++ ext/cog/gstcogmse.c | 9 ++++++--- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 77d79fe51f..20526c499a 100644 --- a/configure.ac +++ b/configure.ac @@ -602,13 +602,12 @@ AG_GST_CHECK_FEATURE(CELT, [celt], celt, [ dnl *** Cog *** translit(dnm, m, l) AM_CONDITIONAL(USE_COG, true) AG_GST_CHECK_FEATURE(COG, [Cog plugin], cog, [ - PKG_CHECK_MODULES(COG, libpng >= 1.2 orc-0.4 >= $ORC_REQ, HAVE_COG="yes", [ + PKG_CHECK_MODULES(COG, libpng >= 1.2, HAVE_COG="yes", [ HAVE_COG="no" AC_MSG_RESULT(no) ]) AC_SUBST(COG_CFLAGS) AC_SUBST(COG_LIBS) - dnl ORCC was set up by Orc check above ]) dnl *** dc1394 *** diff --git a/ext/cog/Makefile.am b/ext/cog/Makefile.am index c24253c50f..81e0f15e1c 100644 --- a/ext/cog/Makefile.am +++ b/ext/cog/Makefile.am @@ -8,11 +8,13 @@ libgstcog_la_CFLAGS = \ -I$(srcdir)/.. \ $(GST_PLUGINS_BASE_CFLAGS) \ $(GST_CFLAGS) \ + $(ORC_CFLAGS) \ $(COG_CFLAGS) libgstcog_la_LIBADD = \ $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \ $(GST_BASE_LIBS) \ $(GST_LIBS) \ + $(ORC_LIBS) \ $(COG_LIBS) libgstcog_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBM) libgstcog_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/cog/cogvirtframe.c b/ext/cog/cogvirtframe.c index 860dc8eac2..0fc0ad1298 100644 --- a/ext/cog/cogvirtframe.c +++ b/ext/cog/cogvirtframe.c @@ -9,7 +9,11 @@ #include #include #include +#ifdef HAVE_ORC #include +#else +#define orc_memcpy memcpy +#endif #include #include "gstcogorc.h" diff --git a/ext/cog/gstcog.c b/ext/cog/gstcog.c index 86c11255d2..beb147a9e8 100644 --- a/ext/cog/gstcog.c +++ b/ext/cog/gstcog.c @@ -23,7 +23,9 @@ #include #include +#ifdef HAVE_ORC #include +#endif GType gst_deblock_get_type (void); GType gst_cogdownsample_get_type (void); @@ -38,7 +40,9 @@ GST_DEBUG_CATEGORY (cog_debug); static gboolean plugin_init (GstPlugin * plugin) { +#ifdef HAVE_ORC orc_init (); +#endif GST_DEBUG_CATEGORY_INIT (cog_debug, "cog", 0, "Cog"); diff --git a/ext/cog/gstcogmse.c b/ext/cog/gstcogmse.c index c2e3b42e0b..71bae980d8 100644 --- a/ext/cog/gstcogmse.c +++ b/ext/cog/gstcogmse.c @@ -26,7 +26,9 @@ #include #include #include +#ifdef HAVE_ORC #include +#endif #include #include "gstcogutils.h" @@ -447,7 +449,7 @@ gst_mse_sink_event (GstPad * pad, GstEvent * event) static int sum_square_diff_u8 (uint8_t * s1, uint8_t * s2, int n) { -#if 0 +#ifndef HAVE_ORC int sum = 0; int i; int x; @@ -456,8 +458,8 @@ sum_square_diff_u8 (uint8_t * s1, uint8_t * s2, int n) x = s1[i] - s2[i]; sum += x * x; } - d_1[0] = sum; -#endif + return sum; +#else static OrcProgram *p = NULL; OrcExecutor *ex; int val; @@ -494,6 +496,7 @@ sum_square_diff_u8 (uint8_t * s1, uint8_t * s2, int n) orc_executor_free (ex); return val; +#endif } static double