From 2cb6cfed22166b262ae50cb58f3ff11dd8ba91f9 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 4 Jun 2010 18:16:25 -0700 Subject: [PATCH] goom: liboil to orc conversion --- gst/goom/Makefile.am | 4 ++-- gst/goom/README | 2 +- gst/goom/gstgoom.c | 4 ---- gst/goom/plugin_info.c | 24 +++++++++++++++--------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gst/goom/Makefile.am b/gst/goom/Makefile.am index 8e7a622..4e628e9 100644 --- a/gst/goom/Makefile.am +++ b/gst/goom/Makefile.am @@ -37,8 +37,8 @@ libgstgoom_la_SOURCES = \ goom_tools.h goom_tools.h goom_config.h \ $(ARCH_FILES) -libgstgoom_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GOOM_FILTER_CFLAGS) $(LIBOIL_CFLAGS) $(ARCH_CFLAGS) -libgstgoom_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(LIBM) $(LIBOIL_LIBS) +libgstgoom_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GOOM_FILTER_CFLAGS) $(ARCH_CFLAGS) $(ORC_CFLAGS) +libgstgoom_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(LIBM) $(ORC_LIBS) libgstgoom_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstgoom_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/gst/goom/README b/gst/goom/README index 87a5e9b..08af2ba 100644 --- a/gst/goom/README +++ b/gst/goom/README @@ -4,7 +4,7 @@ http://ios.free.fr/?page=projet&quoi=1 Like the original library so is the Goom plugin available under the LGPL license -This is based on goom2k4 with changes to plugin_info.c and mmx.h to use liboil for CPU +This is based on goom2k4 with changes to plugin_info.c and mmx.h to use Orc for CPU detection and GStreamer-specific ifdef's for architecture detection. These files are not in use right now: diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index 6afdd6a..f4335e3 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -43,8 +43,6 @@ #include #include "goom.h" -#include - GST_DEBUG_CATEGORY (goom_debug); #define GST_CAT_DEFAULT goom_debug @@ -587,8 +585,6 @@ 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 7ef7e77..4987384 100644 --- a/gst/goom/plugin_info.c +++ b/gst/goom/plugin_info.c @@ -29,6 +29,9 @@ #include "drawmethods.h" #include #include +#ifdef HAVE_ORC +#include +#endif #if defined (HAVE_CPU_PPC64) || defined (HAVE_CPU_PPC) @@ -43,9 +46,6 @@ #include "mmx.h" #endif /* HAVE_MMX */ -#include -#include -#include GST_DEBUG_CATEGORY_EXTERN (goom_debug); #define GST_CAT_DEFAULT goom_debug @@ -53,25 +53,30 @@ GST_DEBUG_CATEGORY_EXTERN (goom_debug); static void setOptimizedMethods (PluginInfo * p) { - - unsigned int cpuFlavour = oil_cpu_get_flags (); +#ifdef HAVE_ORC + unsigned int cpuFlavour = + orc_target_get_default_flags (orc_target_get_by_name ("mmx")); +#else + unsigned int cpuFlavour = 0; +#endif /* set default methods */ p->methods.draw_line = draw_line; 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); + GST_INFO ("orc cpu flags: 0x%08x", cpuFlavour); /* FIXME: what about HAVE_CPU_X86_64 ? */ #ifdef HAVE_CPU_I386 #ifdef HAVE_MMX +#ifdef HAVE_ORC GST_INFO ("have an x86"); - if (cpuFlavour & OIL_IMPL_FLAG_MMXEXT) { + if (cpuFlavour & ORC_TARGET_MMX_MMXEXT) { GST_INFO ("Extended MMX detected. Using the fastest methods!"); p->methods.draw_line = draw_line_xmmx; p->methods.zoom_filter = zoom_filter_xmmx; - } else if (cpuFlavour & OIL_IMPL_FLAG_MMX) { + } else if (cpuFlavour & ORC_TARGET_MMX_MMX) { GST_INFO ("MMX detected. Using fast methods!"); p->methods.draw_line = draw_line_mmx; p->methods.zoom_filter = zoom_filter_mmx; @@ -79,6 +84,7 @@ setOptimizedMethods (PluginInfo * p) GST_INFO ("Too bad ! No SIMD optimization available for your CPU."); } #endif +#endif #endif /* HAVE_CPU_I386 */ /* disable all PPC stuff until someone finds out what to use here instead of @@ -92,7 +98,7 @@ setOptimizedMethods (PluginInfo * p) #endif /* HAVE_CPU_PPC64 */ #ifdef HAVE_CPU_PPC - if ((cpuFlavour & OIL_IMPL_FLAG_ALTIVEC) != 0) { + if ((cpuFlavour & ORC_TARGET_ALTIVEC_ALTIVEC) != 0) { /* p->methods.create_output_with_brightness = ppc_brightness_G4; */ p->methods.zoom_filter = ppc_zoom_G4; } else { -- 2.7.4