diff --git a/ChangeLog b/ChangeLog index c667ce9a0d..0f53d9e361 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-03-26 David Schleef + + * gst/Makefile.am: remove gstcpu.[ch]. The gst_cpu functionality + is broken and should be implemented in a different library. + * gst/gst.c: (init_post): don't call _gst_cpu_initialize() + * gst/gst.h: remove gstcpu.h + * gst/gstcpu.c: remove + * gst/gstcpu.h: remove + * gst/Makefile.am.future: Remove this file. It's ancient. + 2005-03-25 Ronald S. Bultje * gst/gstbin.c: (gst_bin_class_init), (gst_bin_set_manager), diff --git a/gst/Makefile.am b/gst/Makefile.am index ff02b8aa33..55974e4dc3 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -84,7 +84,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \ gstbus.c \ gstcaps.c \ gstclock.c \ - gstcpu.c \ gstdata.c \ gstelement.c \ gstelementfactory.c \ @@ -161,7 +160,6 @@ gst_headers = \ gstcaps.h \ gstclock.h \ gstcompat.h \ - gstcpu.h \ gstdata.h \ gstelement.h \ gsterror.h \ diff --git a/gst/Makefile.am.future b/gst/Makefile.am.future deleted file mode 100644 index 6271bb0b58..0000000000 --- a/gst/Makefile.am.future +++ /dev/null @@ -1,100 +0,0 @@ -# This Makefile.am is a much neater Makefile.am for this directory, but -# depends on automake 1.4d or later. - -# cheap trick to build . first... -SUBDIRS = . types elements autoplug - -lib_LTLIBRARIES = libgst.la -noinst_LTLIBRARIES = libcothreads.la - -if HAVE_CPU_I386 -GSTARCH_SRCS = gstcpuid_i386.s -else -GSTARCH_SRCS = -endif - -EXTRA_libgst_la_SOURCES = gstcpuid_i386.s - - -libcothreads_la_CFLAGS = $(CFLAGS) $(LIBGST_CFLAGS) -O2 -D_GNU_SOURCE -libgst_la_CFLAGS = $(CFLAGS) $(LIBGST_CFLAGS) -D_GNU_SOURCE -CFLAGS = - -libcothreads_la_SOURCES = cothreads.c -libgst_la_SOURCES = \ - gst.c \ - gstautoplug.c \ - gstbin.c \ - gstbuffer.c \ - gstbufferpool.c \ - gstcaps.c \ - gstclock.c \ - gstcpu.c \ - gstelement.c \ - gstelementfactory.c \ - gstextratypes.c \ - gstinfo.c \ - gstmeta.c \ - gstobject.c \ - gstpad.c \ - gstpipeline.c \ - gstplugin.c \ - gstprops.c \ - gstqueue.c \ - gstscheduler.c \ - gstthread.c \ - gsttrace.c \ - gsttype.c \ - gsttypefind.c \ - gstutils.c \ - gstxml.c \ - gstparse.c \ - $(GSTARCH_SRCS) - -libgstincludedir = $(includedir)/gst -libgstinclude_HEADERS = \ - cothreads.h \ - gst.h \ - gsttypes.h \ - gstautoplug.h \ - gstbin.h \ - gstbuffer.h \ - gstbufferpool.h \ - gstcaps.h \ - gstclock.h \ - gstcpu.h \ - gstelement.h \ - gstextratypes.h \ - gstinfo.h \ - gstlog.h \ - gstmeta.h \ - gstobject.h \ - gstpad.h \ - gstpipeline.h \ - gstplugin.h \ - gstprops.h \ - gstqueue.h \ - gstscheduler.h \ - gstthread.h \ - gsttrace.h \ - gsttype.h \ - gsttypefind.h \ - gstutils.h \ - gstparse.h \ - gstxml.h \ - gstversion.h - -noinst_HEADERS = \ - gst_private.h \ - gstarch.h \ - gsti386.h \ - gstppc.h \ - gstalpha.h \ - gstarm.h \ - gstsparc.h \ - gstpropsprivate.h - -libgst_la_LDFLAGS = -version-info $(GST_LIBVERSION) $(LIBGST_LIBS) -libgst_la_LIBADD = libcothreads.la - -EXTRA_DIST = ROADMAP diff --git a/gst/gst.c b/gst/gst.c index 53b1c27aa5..86092b7023 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -609,7 +609,6 @@ init_post (void) /* register core plugins */ _gst_plugin_register_static (&plugin_desc); - _gst_cpu_initialize (_gst_enable_cpu_opt); gst_structure_get_type (); _gst_value_initialize (); gst_caps_get_type (); diff --git a/gst/gst.h b/gst/gst.h index ae2ca5c924..fe6540cbf9 100644 --- a/gst/gst.h +++ b/gst/gst.h @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/gst/gstcpu.c b/gst/gstcpu.c deleted file mode 100644 index 88f186354b..0000000000 --- a/gst/gstcpu.c +++ /dev/null @@ -1,147 +0,0 @@ -/* GStreamer - * Copyright (C) 1999,2000 Erik Walthinsen - * 2000 Wim Taymans - * 2003 Colin Walters - * - * gstcpu.c: CPU detection and architecture-specific routines - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "gst_private.h" -#include - - -#include "gstcpu.h" -#include "gstinfo.h" - -static GStaticMutex _cpu_mutex = G_STATIC_MUTEX_INIT; -static guint32 _gst_cpu_flags = 0; - -#if defined(HAVE_CPU_I386) && defined(__GNUC__) -#define _gst_cpu_initialize_arch _gst_cpu_initialize_i386 -gboolean _gst_cpu_initialize_i386 (gulong * flags, GString * featurelist); -#else -#define _gst_cpu_initialize_arch _gst_cpu_initialize_none -gboolean _gst_cpu_initialize_none (gulong * flags, GString * featurelist); -#endif - - -void -_gst_cpu_initialize (gboolean opt) -{ - GString *featurelist = g_string_new (""); - gulong flags = 0; - - if (opt) { - if (!_gst_cpu_initialize_arch (&flags, featurelist)) - g_string_append (featurelist, "NONE"); - } else - g_string_append (featurelist, "(DISABLED)"); - - GST_CAT_INFO (GST_CAT_GST_INIT, "CPU features: (%08lx) %s", flags, - featurelist->str); - g_string_free (featurelist, TRUE); -} - -gboolean -_gst_cpu_initialize_none (gulong * flags, GString * featurelist) -{ - return FALSE; -} - -#if defined(HAVE_CPU_I386) && defined(__GNUC__) -static void -gst_cpuid_i386 (int x, unsigned long *eax, unsigned long *ebx, - unsigned long *ecx, unsigned long *edx) -{ - unsigned long regs[4]; - - asm ( - /* GCC-3.2 (and possibly others) don't clobber ebx properly, - * so we save/restore it directly. */ -" movl %%ebx, %%esi\n" " cpuid\n" " movl %%eax, %0\n" " movl %%ebx, %1\n" " movl %%ecx, %2\n" " movl %%edx, %3\n" " movl %%esi, %%ebx\n":"=o" (regs[0]), "=o" (regs[1]), "=o" (regs[2]), - "=o" (regs - [3]) -: "a" (x) -: "ecx", "edx", "esi"); - - *eax = regs[0]; - *ebx = regs[1]; - *ecx = regs[2]; - *edx = regs[3]; -} - -gboolean -_gst_cpu_initialize_i386 (gulong * flags, GString * featurelist) -{ - gboolean AMD; - gulong eax = 0, ebx = 0, ecx = 0, edx = 0; - gboolean res = FALSE; - - g_static_mutex_lock (&_cpu_mutex); - gst_cpuid_i386 (0, &eax, &ebx, &ecx, &edx); - - AMD = (ebx == 0x68747541) && (ecx == 0x444d4163) && (edx == 0x69746e65); - - gst_cpuid_i386 (1, &eax, &ebx, &ecx, &edx); - - if (edx & (1 << 23)) { - _gst_cpu_flags |= GST_CPU_FLAG_MMX; - g_string_append (featurelist, "MMX "); - - if (edx & (1 << 25)) { - _gst_cpu_flags |= GST_CPU_FLAG_SSE; - _gst_cpu_flags |= GST_CPU_FLAG_MMXEXT; - g_string_append (featurelist, "SSE "); - } - - gst_cpuid_i386 (0x80000000, &eax, &ebx, &ecx, &edx); - - if (eax >= 0x80000001) { - - gst_cpuid_i386 (0x80000001, &eax, &ebx, &ecx, &edx); - - if (edx & (1 << 31)) { - _gst_cpu_flags |= GST_CPU_FLAG_3DNOW; - g_string_append (featurelist, "3DNOW "); - } - if (AMD && (edx & (1 << 22))) { - _gst_cpu_flags |= GST_CPU_FLAG_MMXEXT; - g_string_append (featurelist, "MMXEXT "); - } - } - } - *flags = eax; - if (_gst_cpu_flags) - res = TRUE; - g_static_mutex_unlock (&_cpu_mutex); - - return res; -} -#endif - -GstCPUFlags -gst_cpu_get_flags (void) -{ - GstCPUFlags res; - - g_static_mutex_lock (&_cpu_mutex); - res = _gst_cpu_flags; - g_static_mutex_unlock (&_cpu_mutex); - - return res; -} diff --git a/gst/gstcpu.h b/gst/gstcpu.h deleted file mode 100644 index 85c3384879..0000000000 --- a/gst/gstcpu.h +++ /dev/null @@ -1,42 +0,0 @@ -/* GStreamer - * Copyright (C) 1999,2000 Erik Walthinsen - * 2000 Wim Taymans - * - * gstcpu.h: Header for CPU-specific routines - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -#ifndef __GST_CPU_H__ -#define __GST_CPU_H__ - -G_BEGIN_DECLS - -typedef enum { - GST_CPU_FLAG_MMX = (1<<0), - GST_CPU_FLAG_SSE = (1<<1), - GST_CPU_FLAG_MMXEXT = (1<<2), - GST_CPU_FLAG_3DNOW = (1<<3) -} GstCPUFlags; - -void _gst_cpu_initialize (gboolean useopt); - -GstCPUFlags gst_cpu_get_flags (void); - -G_END_DECLS - -#endif /* __GST_CPU_H__ */