gstreamer/gst/speexresample
Sebastian Dröge e8182f4d33 gst/speexresample/: Add functions to push the remaining samples and to get the latency of the resampler. These will g...
Original commit message from CVS:
* gst/speexresample/resample.c: (speex_resampler_get_latency),
(speex_resampler_drain_float), (speex_resampler_drain_int),
(speex_resampler_drain_interleaved_float),
(speex_resampler_drain_interleaved_int):
* gst/speexresample/speex_resampler.h:
* gst/speexresample/speex_resampler_wrapper.h:
Add functions to push the remaining samples and to get the latency
of the resampler. These will get added to Speex SVN in this or a
slightly changed form at some point too and should get merged then
again.
* gst/speexresample/gstspeexresample.c: (gst_speex_resample_init),
(gst_speex_resample_init_state),
(gst_speex_resample_transform_size),
(gst_speex_resample_push_drain), (gst_speex_resample_event),
(gst_speex_fix_output_buffer), (gst_speex_resample_process),
(gst_speex_resample_query), (gst_speex_resample_query_type):
Drop the prepending zeroes and output the remaining samples on EOS.
Also properly implement the latency query for this. speexresample
should be completely ready for production use now.
2007-11-23 08:48:50 +00:00
..
arch.h Add resample element based on the Speex resampling algorithm. 2007-11-20 07:02:45 +00:00
fixed_generic.h Add resample element based on the Speex resampling algorithm. 2007-11-20 07:02:45 +00:00
gstspeexresample.c gst/speexresample/: Add functions to push the remaining samples and to get the latency of the resampler. These will g... 2007-11-23 08:48:50 +00:00
gstspeexresample.h Add speexresample to the docs and while at that do a make update. 2007-11-20 07:47:27 +00:00
Makefile.am gst/speexresample/Makefile.am: Add missing file. 2007-11-20 12:56:00 +00:00
README gst/speexresample/README: Add README explaining where the resampling code was taken from and which changes were done. 2007-11-21 10:18:56 +00:00
resample.c gst/speexresample/: Add functions to push the remaining samples and to get the latency of the resampler. These will g... 2007-11-23 08:48:50 +00:00
speex_resampler.h gst/speexresample/: Add functions to push the remaining samples and to get the latency of the resampler. These will g... 2007-11-23 08:48:50 +00:00
speex_resampler_float.c Add resample element based on the Speex resampling algorithm. 2007-11-20 07:02:45 +00:00
speex_resampler_int.c Add resample element based on the Speex resampling algorithm. 2007-11-20 07:02:45 +00:00
speex_resampler_wrapper.h gst/speexresample/: Add functions to push the remaining samples and to get the latency of the resampler. These will g... 2007-11-23 08:48:50 +00:00

resample.c
arch.h
fixed_generic.h
speex_resampler.h

are taken from http://svn.xiph.org/trunk/speex/ revision 14208.

The only changes are:

--- speex/libspeex/arch.h       2007-11-21 11:05:46.000000000 +0100
+++ speexresample/arch.h      2007-11-20 05:41:09.000000000 +0100
@@ -78,7 +78,9 @@
 #include "speex/speex_types.h"
 #endif
 
+#ifndef ABS
 #define ABS(x) ((x) < 0 ? (-(x)) : (x))      /**< Absolute integer value. */
+#endif
 #define ABS16(x) ((x) < 0 ? (-(x)) : (x))    /**< Absolute 16-bit value.  */
 #define MIN16(a,b) ((a) < (b) ? (a) : (b))   /**< Maximum 16-bit value.   */
 #define MAX16(a,b) ((a) > (b) ? (a) : (b))   /**< Maximum 16-bit value.   */

--- speex/include/speex/speex_resampler.h       2007-11-21 11:05:44.000000000 +0100
+++ speexresample/speex_resampler.h   2007-11-21 11:10:02.000000000 +0100
@@ -41,6 +41,8 @@
 
 #ifdef OUTSIDE_SPEEX
 
+#include <glib.h>
+
 /********* WARNING: MENTAL SANITY ENDS HERE *************/
 
 /* If the resampler is defined outside of Speex, we change the symbol names so that 
@@ -75,10 +77,10 @@
 #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
 #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)
 
-#define spx_int16_t short
-#define spx_int32_t int
-#define spx_uint16_t unsigned short
-#define spx_uint32_t unsigned int
+#define spx_int16_t gint16
+#define spx_int32_t gint32
+#define spx_uint16_t guint16
+#define spx_uint32_t guint32
       
 #else /* OUTSIDE_SPEEX */

--- speex/libspeex/resample.c   2007-11-21 11:07:32.000000000 +0100
+++ speexresample/resample.c  2007-11-21 11:15:09.000000000 +0100
@@ -62,20 +62,22 @@
 
 #ifdef OUTSIDE_SPEEX
 #include <stdlib.h>
-static void *
+#include <glib.h>
+
+static inline void *
 speex_alloc (int size)
 {
-  return calloc (size, 1);
+  return g_malloc0 (size);
 }
-static void *
+static inline void *
 speex_realloc (void *ptr, int size)
 {
-  return realloc (ptr, size);
+  return g_realloc (ptr, size);
 }
-static void
+static inline void
 speex_free (void *ptr)
 {
-  free (ptr);
+  g_free (ptr);
 }
 
 #include "speex_resampler.h"