a52dec: Use orc for CPU feature detection and don't check for liboil

This commit is contained in:
Sebastian Dröge 2010-06-14 14:34:25 +02:00
parent 20c3e5ba0c
commit 359260bd5b
3 changed files with 20 additions and 17 deletions

View file

@ -152,12 +152,7 @@ dnl *** checks for dependency libraries ***
dnl GLib is required
AG_GST_GLIB_CHECK([2.18])
dnl liboil is required
PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.14, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
if test "x$HAVE_LIBOIL" != "xyes"; then
AC_ERROR([liboil-0.3.14 or later is required])
fi
ORC_CHECK([0.4.5])
dnl checks for gstreamer
dnl uninstalled is selected preferentially -- see pkg-config(1)
@ -542,3 +537,5 @@ sed \
AC_OUTPUT
AG_GST_OUTPUT_PLUGINS
ORC_OUTPUT

View file

@ -4,12 +4,12 @@ libgsta52dec_la_SOURCES = gsta52dec.c
libgsta52dec_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(LIBOIL_CFLAGS) \
$(ORC_CFLAGS) \
$(A52DEC_CFLAGS)
libgsta52dec_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstaudio-$(GST_MAJORMINOR) \
$(LIBOIL_LIBS) \
$(ORC_LIBS) \
$(A52DEC_LIBS)
libgsta52dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgsta52dec_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -49,9 +49,9 @@
#include <a52dec/mm_accel.h>
#include "gsta52dec.h"
#include <liboil/liboil.h>
#include <liboil/liboilcpu.h>
#include <liboil/liboilfunction.h>
#if HAVE_ORC
#include <orc/orc.h>
#endif
#ifdef LIBA52_DOUBLE
#define SAMPLE_WIDTH 64
@ -185,8 +185,6 @@ gst_a52dec_class_init (GstA52DecClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LFE,
g_param_spec_boolean ("lfe", "LFE", "LFE", TRUE, G_PARAM_READWRITE));
oil_init ();
/* If no CPU instruction based acceleration is available, end up using the
* generic software djbfft based one when available in the used liba52 */
#ifdef MM_ACCEL_DJBFFT
@ -194,13 +192,21 @@ gst_a52dec_class_init (GstA52DecClass * klass)
#else
klass->a52_cpuflags = 0;
#endif
cpuflags = oil_cpu_get_flags ();
if (cpuflags & OIL_IMPL_FLAG_MMX)
#if HAVE_ORC
cpuflags = orc_target_get_default_flags (orc_target_get_by_name ("mmx"));
if (cpuflags & ORC_TARGET_MMX_MMX)
klass->a52_cpuflags |= MM_ACCEL_X86_MMX;
if (cpuflags & OIL_IMPL_FLAG_3DNOW)
if (cpuflags & ORC_TARGET_MMX_3DNOW)
klass->a52_cpuflags |= MM_ACCEL_X86_3DNOW;
if (cpuflags & OIL_IMPL_FLAG_MMXEXT)
if (cpuflags & ORC_TARGET_MMX_MMXEXT)
klass->a52_cpuflags |= MM_ACCEL_X86_MMXEXT;
#else
cpuflags = 0;
#endif
g_print ("%p\n", orc_target_get_by_name ("mmx"));
GST_LOG ("CPU flags: a52=%08x, liboil=%08x", klass->a52_cpuflags, cpuflags);
}