From: <th...@ke...> - 2008-02-26 10:09:48
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: thaytan Date: Tue Feb 26 2008 10:09:52 UTC Log message: * configure.ac: Detect and indicate if GCC inline assembly syntax is available. * gst/goom/Makefile.am: * gst/goom/convolve_fx.c: * gst/goom/flying_stars_fx.c: * gst/goom/goom_config.h: * gst/goom/goom_core.c: * gst/goom/goomsl.c: * gst/goom/ifs.c: * gst/goom/mmx.c: * gst/goom/plugin_info.c: * gst/goom/xmmx.c: Fix various GCC-isms, and only build the inline assembly with compilers that support GCC inline assembly. Fix a couple of other warnings shown with Forte. Modified files: . : ChangeLog configure.ac gst/goom : Makefile.am convolve_fx.c flying_stars_fx.c goom_config.h goom_core.c goomsl.c ifs.c mmx.c plugin_info.c xmmx.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3333&r2=1.3334 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/configure.ac.diff?r1=1.731&r2=1.732 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/Makefile.am.diff?r1=1.20&r2=1.21 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/convolve_fx.c.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/flying_stars_fx.c.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/goom_config.h.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/goom_core.c.diff?r1=1.9&r2=1.10 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/goomsl.c.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/ifs.c.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/mmx.c.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/plugin_info.c.diff?r1=1.6&r2=1.7 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/goom/xmmx.c.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.3333 retrieving revision 1.3334 diff -u -d -r1.3333 -r1.3334 --- ChangeLog 25 Feb 2008 12:03:45 -0000 1.3333 +++ ChangeLog 26 Feb 2008 10:09:35 -0000 1.3334 @@ -1,3 +1,24 @@ +2008-02-26 Jan Schmidt <jan...@su...> + + * configure.ac: + Detect and indicate if GCC inline assembly syntax is + available. + * gst/goom/Makefile.am: + * gst/goom/convolve_fx.c: + * gst/goom/flying_stars_fx.c: + * gst/goom/goom_config.h: + * gst/goom/goom_core.c: + * gst/goom/goomsl.c: + * gst/goom/ifs.c: + * gst/goom/mmx.c: + * gst/goom/plugin_info.c: + * gst/goom/xmmx.c: + Fix various GCC-isms, and only build the inline assembly + with compilers that support GCC inline assembly. + Fix a couple of other warnings shown with Forte. 2008-02-25 Stefan Kost <en...@us...> * gst/goom/xmmx.c: Index: configure.ac RCS file: /cvs/gstreamer/gst-plugins-good/configure.ac,v retrieving revision 1.731 retrieving revision 1.732 diff -u -d -r1.731 -r1.732 --- configure.ac 23 Feb 2008 12:23:37 -0000 1.731 +++ configure.ac 26 Feb 2008 10:09:36 -0000 1.732 @@ -337,6 +337,13 @@ AG_GST_BISON_CHECK AG_GST_FLEX_CHECK AM_PROG_AS +dnl Check if we have GCC inline-asm +AS_GCC_INLINE_ASSEMBLY([HAVE_GCC_ASM=yes], [HAVE_GCC_ASM=no]) +if test x$HAVE_GCC_ASM = xyes ; then + AC_DEFINE(HAVE_GCC_ASM, 1, + [Define if compiler supports gcc inline assembly]) +fi +AM_CONDITIONAL(HAVE_GCC_ASM, test "x$HAVE_GCC_ASM" = "xyes") dnl *** sys plug-ins *** Index: Makefile.am RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Makefile.am 23 Feb 2008 03:10:55 -0000 1.20 +++ Makefile.am 26 Feb 2008 10:09:37 -0000 1.21 @@ -11,7 +11,7 @@ endif if HAVE_CPU_I386 ARCH_FILES = $(MMX_FILES) -ARCH_CFLAGS = -DHAVE_MMX +ARCH_CFLAGS = -DBUILD_MMX libgstgoom_la_SOURCES = \ Index: convolve_fx.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/convolve_fx.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- convolve_fx.c 23 Feb 2008 02:38:02 -0000 1.2 +++ convolve_fx.c 26 Feb 2008 10:09:37 -0000 1.3 @@ -340,10 +340,10 @@ convolve_create (void) { VisualFX vfx = { - init:convolve_init, - free:convolve_free, - apply:convolve_apply, - fx_data:0 + convolve_init, + convolve_free, + convolve_apply, + NULL }; return vfx; } Index: flying_stars_fx.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/flying_stars_fx.c,v retrieving revision 1.1 diff -u -d -r1.1 -r1.2 --- flying_stars_fx.c 23 Feb 2008 01:51:27 -0000 1.1 +++ flying_stars_fx.c 26 Feb 2008 10:09:37 -0000 1.2 @@ -200,8 +200,7 @@ FSData *data = (FSData *) _this->fx_data; int i; - int max = - (int) ((1.0f + info->sound.goomPower) * goom_irand (info->gRandom, + int max = (int) ((1.0f + info->sound.goomPower) * goom_irand (info->gRandom, 150)) + 100; float radius = (1.0f + info->sound.goomPower) * (float) (goom_irand (info->gRandom, @@ -332,10 +331,10 @@ flying_star_create (void) - init:fs_init, - free:fs_free, - apply:fs_apply, + fs_init, + fs_free, + fs_apply, Index: goom_config.h RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/goom_config.h,v --- goom_config.h 23 Feb 2008 01:51:29 -0000 1.1 +++ goom_config.h 26 Feb 2008 10:09:37 -0000 1.2 @@ -26,3 +26,7 @@ #define gint16 signed short int #define gint32 signed int #endif +#if defined (BUILD_MMX) && defined (HAVE_GCC_ASM) +#define HAVE_MMX +#endif Index: goom_core.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/goom_core.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- goom_core.c 23 Feb 2008 01:51:29 -0000 1.9 +++ goom_core.c 26 Feb 2008 10:09:37 -0000 1.10 @@ -11,6 +11,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <strings.h> #include <inttypes.h> #include "goom.h" @@ -721,8 +722,7 @@ goomInfo->update.lineMode--; if (goomInfo->update.lineMode == -1) goomInfo->update.lineMode = 0; - } else - if ((goomInfo->cycle % 80 == 0) + } else if ((goomInfo->cycle % 80 == 0) && (goom_irand (goomInfo->gRandom, 5) == 0) && goomInfo->update.lineMode) Index: goomsl.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/goomsl.c,v --- goomsl.c 23 Feb 2008 02:38:02 -0000 1.2 +++ goomsl.c 26 Feb 2008 10:09:37 -0000 1.3 @@ -2,6 +2,7 @@ +#include <glib.h> #include "goomsl.h" #include "goomsl_private.h" #include "goomsl_yacc.h" @@ -465,7 +466,6 @@ default: return VALIDATE_TODO; } - return VALIDATE_ERROR; } /* }}} */ /*************/ Index: ifs.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/ifs.c,v --- ifs.c 23 Feb 2008 02:38:02 -0000 1.2 +++ ifs.c 26 Feb 2008 10:09:37 -0000 1.3 @@ -470,7 +470,7 @@ ifs_update (PluginInfo * goomInfo, Pixel * data, Pixel * back, int increment, IfsData * fx_data) - static int couleur = 0xc0c0c0c0; + static unsigned int couleur = 0xc0c0c0c0; static int v[4] = { 2, 4, 3, 2 }; static int col[4] = { 2, 4, 3, 2 }; @@ -486,7 +486,7 @@ IFSPoint *points; - int couleursl = couleur; + unsigned int couleursl = couleur; int width = goomInfo->screen.width; int height = goomInfo->screen.height; Index: mmx.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/mmx.c,v --- mmx.c 23 Feb 2008 01:51:33 -0000 1.1 +++ mmx.c 26 Feb 2008 10:09:38 -0000 1.2 @@ -1,6 +1,10 @@ +#ifdef HAVE_CONFIG_H #include "config.h" -#if defined (HAVE_CPU_I386) || defined (HAVE_CPU_X86_64) +#include "goom_config.h" +#ifdef HAVE_MMX #define BUFFPOINTNB 16 #define BUFFPOINTMASK 0xffff @@ -252,5 +256,10 @@ emms (); /* __asm__ __volatile__ ("emms"); */ - -#endif /* HAVE_CPU_I386 || HAVE_CPU_X86_64 */ +#else +int +mmx_supported (void) +{ + return (0); +} +#endif /* HAVE_MMX */ Index: plugin_info.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/plugin_info.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- plugin_info.c 25 Feb 2008 10:32:35 -0000 1.6 +++ plugin_info.c 26 Feb 2008 10:09:38 -0000 1.7 @@ -1,7 +1,11 @@ #include <gst/gst.h> #include "goom_plugin_info.h" #include "goom_fx.h" #include "default_scripts.h" @@ -18,9 +22,9 @@ #endif /* HAVE_CPU_PPC64 || HAVE_CPU_PPC */ -#ifdef HAVE_CPU_I386 #include "mmx.h" -#endif /* HAVE_CPU_I386 */ #include <liboil/liboil.h> #include <liboil/liboilfunction.h> @@ -44,6 +48,7 @@ /* FIXME: what about HAVE_CPU_X86_64 ? */ #ifdef HAVE_CPU_I386 GST_INFO ("have an x86"); if (cpuFlavour & OIL_IMPL_FLAG_MMXEXT) { GST_INFO ("Extended MMX detected. Using the fastest methods!"); @@ -56,6 +61,7 @@ } else { GST_INFO ("Too bad ! No SIMD optimization available for your CPU."); #endif /* HAVE_CPU_I386 */ #ifdef HAVE_CPU_PPC64 Index: xmmx.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/goom/xmmx.c,v --- xmmx.c 25 Feb 2008 12:03:46 -0000 1.2 +++ xmmx.c 26 Feb 2008 10:09:38 -0000 1.3 @@ -1,3 +1,8 @@ +#include "config.h" #ifdef HAVE_MMX @@ -362,5 +367,10 @@ /* this was femms, which is AMD 3dnow */ __asm__ __volatile__ ("emms\n"); +xmmx_supported (void) |