From 67101abdd69f40043548a401b33a9f1d4127f95b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 23 Feb 2008 12:10:16 +0000 Subject: [PATCH] gst/goom/: Call oil_init(), otherwise oil_get_cpu_flags() won't return anything useful. Export goom debug category so... Original commit message from CVS: * gst/goom/gstgoom.c: (goom_debug), (plugin_init): * gst/goom/plugin_info.c: (goom_debug), (GST_CAT_DEFAULT), (setOptimizedMethods): Call oil_init(), otherwise oil_get_cpu_flags() won't return anything useful. Export goom debug category so we can get rid of the VERBOSE define and the printfs. --- ChangeLog | 9 +++++++++ gst/goom/gstgoom.c | 10 +++++++--- gst/goom/plugin_info.c | 24 ++++++++++++------------ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index da33c5f..85d6d42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-02-23 Tim-Philipp Müller + * gst/goom/gstgoom.c: (goom_debug), (plugin_init): + * gst/goom/plugin_info.c: (goom_debug), (GST_CAT_DEFAULT), + (setOptimizedMethods): + Call oil_init(), otherwise oil_get_cpu_flags() won't return + anything useful. Export goom debug category so we can get + rid of the VERBOSE define and the printfs. + +2008-02-23 Tim-Philipp Müller + * gst/goom/goomsl_heap.c: (align_it): * gst/goom/plugin_info.c: (setOptimizedMethods): Compile fixes for x86-64. diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index 7ba6654..3ccaf7d 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -46,7 +46,9 @@ #include #include "goom.h" -GST_DEBUG_CATEGORY_STATIC (goom_debug); +#include + +GST_DEBUG_CATEGORY (goom_debug); #define GST_CAT_DEFAULT goom_debug /* elementfactory information */ @@ -153,8 +155,6 @@ gst_goom_class_init (GstGoomClass * klass) gobject_class->finalize = gst_goom_finalize; gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_goom_change_state); - - GST_DEBUG_CATEGORY_INIT (goom_debug, "goom", 0, "goom visualisation element"); } static void @@ -593,6 +593,10 @@ gst_goom_change_state (GstElement * element, GstStateChange transition) static gboolean plugin_init (GstPlugin * plugin) { + GST_DEBUG_CATEGORY_INIT (goom_debug, "goom", 0, "goom visualisation element"); + + oil_init (); + return gst_element_register (plugin, "goom", GST_RANK_NONE, GST_TYPE_GOOM); } diff --git a/gst/goom/plugin_info.c b/gst/goom/plugin_info.c index f5d04ba..0fba325 100644 --- a/gst/goom/plugin_info.c +++ b/gst/goom/plugin_info.c @@ -1,5 +1,7 @@ #include "config.h" +#include + #include "goom_plugin_info.h" #include "goom_fx.h" #include "default_scripts.h" @@ -23,7 +25,9 @@ #include #include #include -/* #define VERBOSE 1 */ + +GST_DEBUG_CATEGORY_EXTERN (goom_debug); +#define GST_CAT_DEFAULT goom_debug static void setOptimizedMethods (PluginInfo * p) @@ -36,26 +40,22 @@ setOptimizedMethods (PluginInfo * p) p->methods.zoom_filter = zoom_filter_c; /* p->methods.create_output_with_brightness = create_output_with_brightness;*/ + GST_INFO ("liboil cpu flags: 0x%08x", cpuFlavour); + /* FIXME: what about HAVE_CPU_X86_64 ? */ #ifdef HAVE_CPU_I386 - printf ("have an x86\n"); + GST_INFO ("have an x86"); if (cpuFlavour & OIL_IMPL_FLAG_MMXEXT) { -#ifdef VERBOSE - printf ("Extended MMX detected. Using the fastest methods !\n"); -#endif + GST_INFO ("Extended MMX detected. Using the fastest methods!"); p->methods.draw_line = draw_line_mmx; p->methods.zoom_filter = zoom_filter_xmmx; } else if (cpuFlavour & OIL_IMPL_FLAG_MMX) { -#ifdef VERBOSE - printf ("MMX detected. Using fast methods !\n"); -#endif + GST_INFO ("MMX detected. Using fast methods!"); p->methods.draw_line = draw_line_mmx; p->methods.zoom_filter = zoom_filter_mmx; + } else { + GST_INFO ("Too bad ! No SIMD optimization available for your CPU."); } -#ifdef VERBOSE - else - printf ("Too bad ! No SIMD optimization available for your CPU.\n"); -#endif #endif /* HAVE_CPU_I386 */ #ifdef HAVE_CPU_PPC64 -- 2.7.4