From e39e729a7059e521da47825c80bdab96552ad67f Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sun, 6 Jun 2010 23:50:05 -0700 Subject: [PATCH] audioresample: convert from liboil to orc --- gst/audioresample/Makefile.am | 12 ++---------- gst/audioresample/gstaudioresample.c | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/gst/audioresample/Makefile.am b/gst/audioresample/Makefile.am index 30c5e8b..7f4e466 100644 --- a/gst/audioresample/Makefile.am +++ b/gst/audioresample/Makefile.am @@ -1,13 +1,5 @@ plugin_LTLIBRARIES = libgstaudioresample.la -if AUDIORESAMPLE_NEEDS_LIBOIL -COND_LIBOIL_CFLAGS=$(LIBOIL_CFLAGS) -COND_LIBOIL_LIBS=$(LIBOIL_LIBS) -else -COND_LIBOIL_CFLAGS= -COND_LIBOIL_LIBS= -endif - libgstaudioresample_la_SOURCES = \ gstaudioresample.c \ speex_resampler_int.c \ @@ -18,13 +10,13 @@ libgstaudioresample_la_CFLAGS = \ $(GST_PLUGINS_BASE_CFLAGS) \ $(GST_BASE_CFLAGS) \ $(GST_CFLAGS) \ - $(COND_LIBOIL_CFLAGS) + $(ORC_CFLAGS) libgstaudioresample_la_LIBADD = \ $(GST_PLUGINS_BASE_LIBS) \ $(GST_BASE_LIBS) \ $(GST_LIBS) \ - $(COND_LIBOIL_LIBS) \ + $(ORC_LIBS) -lorc-test-0.4 \ $(LIBM) libgstaudioresample_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 6336db5..6ec4213 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -50,11 +50,10 @@ #include #include -#if defined AUDIORESAMPLE_FORMAT_AUTO -#define OIL_ENABLE_UNSTABLE_API -#include -#include -#endif +#include +#include +#include + GST_DEBUG_CATEGORY (audio_resample_debug); #define GST_CAT_DEFAULT audio_resample_debug @@ -1391,13 +1390,13 @@ _benchmark_int_int (SpeexResamplerState * st) static gboolean _benchmark_integer_resampling (void) { - OilProfile a, b; + OrcProfile a, b; gdouble av, bv; SpeexResamplerState *sta, *stb; int i; - oil_profile_init (&a); - oil_profile_init (&b); + orc_profile_init (&a); + orc_profile_init (&b); sta = resample_float_resampler_init (1, 48000, 24000, 4, NULL); if (sta == NULL) { @@ -1414,23 +1413,23 @@ _benchmark_integer_resampling (void) /* Benchmark */ for (i = 0; i < 10; i++) { - oil_profile_start (&a); + orc_profile_start (&a); if (!_benchmark_int_float (sta)) goto error; - oil_profile_stop (&a); + orc_profile_stop (&a); } /* Benchmark */ for (i = 0; i < 10; i++) { - oil_profile_start (&b); + orc_profile_start (&b); if (!_benchmark_int_int (stb)) goto error; - oil_profile_stop (&b); + orc_profile_stop (&b); } /* Handle results */ - oil_profile_get_ave_std (&a, &av, NULL); - oil_profile_get_ave_std (&b, &bv, NULL); + orc_profile_get_ave_std (&a, &av, NULL); + orc_profile_get_ave_std (&b, &bv, NULL); /* Remember benchmark result in global variable */ gst_audio_resample_use_int = (av > bv); @@ -1458,8 +1457,6 @@ plugin_init (GstPlugin * plugin) GST_DEBUG_CATEGORY_INIT (audio_resample_debug, "audioresample", 0, "audio resampling element"); #if defined AUDIORESAMPLE_FORMAT_AUTO - oil_init (); - if (!_benchmark_integer_resampling ()) return FALSE; #endif -- 2.7.4