mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
gst/Makefile.am: remove gstcpu.[ch]. The gst_cpu functionality is broken and should be implemented in a different li...
Original commit message from CVS: * 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.
This commit is contained in:
parent
8eb4bb6a51
commit
a7abc22271
7 changed files with 10 additions and 293 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2005-03-26 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* 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 <rbultje@ronald.bitfreak.net>
|
2005-03-25 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_set_manager),
|
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_set_manager),
|
||||||
|
|
|
@ -84,7 +84,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
|
||||||
gstbus.c \
|
gstbus.c \
|
||||||
gstcaps.c \
|
gstcaps.c \
|
||||||
gstclock.c \
|
gstclock.c \
|
||||||
gstcpu.c \
|
|
||||||
gstdata.c \
|
gstdata.c \
|
||||||
gstelement.c \
|
gstelement.c \
|
||||||
gstelementfactory.c \
|
gstelementfactory.c \
|
||||||
|
@ -161,7 +160,6 @@ gst_headers = \
|
||||||
gstcaps.h \
|
gstcaps.h \
|
||||||
gstclock.h \
|
gstclock.h \
|
||||||
gstcompat.h \
|
gstcompat.h \
|
||||||
gstcpu.h \
|
|
||||||
gstdata.h \
|
gstdata.h \
|
||||||
gstelement.h \
|
gstelement.h \
|
||||||
gsterror.h \
|
gsterror.h \
|
||||||
|
|
|
@ -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
|
|
|
@ -609,7 +609,6 @@ init_post (void)
|
||||||
/* register core plugins */
|
/* register core plugins */
|
||||||
_gst_plugin_register_static (&plugin_desc);
|
_gst_plugin_register_static (&plugin_desc);
|
||||||
|
|
||||||
_gst_cpu_initialize (_gst_enable_cpu_opt);
|
|
||||||
gst_structure_get_type ();
|
gst_structure_get_type ();
|
||||||
_gst_value_initialize ();
|
_gst_value_initialize ();
|
||||||
gst_caps_get_type ();
|
gst_caps_get_type ();
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include <gst/gstbuffer.h>
|
#include <gst/gstbuffer.h>
|
||||||
#include <gst/gstcaps.h>
|
#include <gst/gstcaps.h>
|
||||||
#include <gst/gstclock.h>
|
#include <gst/gstclock.h>
|
||||||
#include <gst/gstcpu.h>
|
|
||||||
#include <gst/gstelement.h>
|
#include <gst/gstelement.h>
|
||||||
#include <gst/gsterror.h>
|
#include <gst/gsterror.h>
|
||||||
#include <gst/gstevent.h>
|
#include <gst/gstevent.h>
|
||||||
|
|
147
gst/gstcpu.c
147
gst/gstcpu.c
|
@ -1,147 +0,0 @@
|
||||||
/* GStreamer
|
|
||||||
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
||||||
* 2000 Wim Taymans <wtay@chello.be>
|
|
||||||
* 2003 Colin Walters <walters@verbum.org>
|
|
||||||
*
|
|
||||||
* 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 <glib.h>
|
|
||||||
|
|
||||||
|
|
||||||
#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;
|
|
||||||
}
|
|
42
gst/gstcpu.h
42
gst/gstcpu.h
|
@ -1,42 +0,0 @@
|
||||||
/* GStreamer
|
|
||||||
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
||||||
* 2000 Wim Taymans <wtay@chello.be>
|
|
||||||
*
|
|
||||||
* 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__ */
|
|
Loading…
Reference in a new issue