[gst-cvs] CVS: gstreamer/plugins/audioscale audioscale.c,1.15,1.16 audioscale.h,1.5,1.6
David Schleef
dschleef at users.sourceforge.net
Sun Oct 28 14:14:02 PST 2001
- Previous message: [gst-cvs] CVS: gstreamer/plugins/rtp/rtpsend .cvsignore,1.1,NONE Makefile.am,1.1,NONE rtp.c,1.1,NONE rtp.h,1.1,NONE rtpsend.c,1.5,NONE rtpsend.h,1.2,NONE
- Next message: [gst-cvs] CVS: gstreamer/plugins/capture Makefile.am,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/gstreamer/gstreamer/plugins/audioscale
In directory usw-pr-cvs1:/tmp/cvs-serv17836
Modified Files:
audioscale.c audioscale.h
Log Message:
Major fixup work. Added caps. Added new properties "filter_length"
and "method". Old algorithm became "Nearest" method (default), and
two new methods were added, "Bilinear" and "Sinc". Both Nearest and
Bilinear add clearly audible artifacts, so Sinc is the preferred method,
although it is computationally expensive, especially at longer, higher
quality filter_lengths. Sinc filter does not (yet) do windowing.
Index: audioscale.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/audioscale/audioscale.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- audioscale.c 2001/08/21 20:16:45 1.15
+++ audioscale.c 2001/10/28 22:13:25 1.16
@@ -19,9 +19,11 @@
#include <string.h>
+#include <math.h>
//#define DEBUG_ENABLED
#include <audioscale.h>
+#include <libs/audio/gstaudio.h>
/* elementfactory information */
static GstElementDetails audioscale_details = {
@@ -42,20 +44,77 @@
enum {
ARG_0,
ARG_FREQUENCY,
+ ARG_FILTERLEN,
+ ARG_METHOD,
/* FILL ME */
};
+static GstPadTemplate *
+sink_template (void)
+{
+ static GstPadTemplate *template = NULL;
+
+ if (!template) {
+ template = gst_padtemplate_new ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ gst_caps_new
+ ("audioscale_sink",
+ "audio/raw", GST_AUDIO_INT_PAD_TEMPLATE_PROPS), NULL);
+ }
+ return template;
+}
+static GstPadTemplate *
+src_template (void)
+{
+ static GstPadTemplate *template = NULL;
+ if (!template) {
+ template = gst_padtemplate_new ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new
+ ("audioscale_src",
+ "audio/raw", GST_AUDIO_INT_PAD_TEMPLATE_PROPS), NULL);
+ }
+ return template;
+}
+
+#define GST_TYPE_AUDIOSCALE_METHOD (gst_audioscale_method_get_type())
+static GType
+gst_audioscale_method_get_type (void)
+{
+ static GType audioscale_method_type = 0;
+ static GEnumValue audioscale_methods[] = {
+ { GST_AUDIOSCALE_NEAREST, "0", "Nearest" },
+ { GST_AUDIOSCALE_BILINEAR, "1", "Bilinear" },
+ { GST_AUDIOSCALE_SINC, "2", "Sinc" },
+ { 0, NULL, NULL },
+ };
+ if(!audioscale_method_type){
+ audioscale_method_type = g_enum_register_static("GstAudioscaleMethod",
+ audioscale_methods);
+ }
+ return audioscale_method_type;
+}
+
static void gst_audioscale_class_init (AudioscaleClass *klass);
static void gst_audioscale_init (Audioscale *audioscale);
static void gst_audioscale_chain (GstPad *pad, GstBuffer *buf);
-static void gst_audioscale_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void gst_audioscale_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static void gst_audioscale_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_audioscale_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
+
+static GstBuffer *audioscale_nearest (Audioscale * audioscale, GstBuffer * i_buf);
+static GstBuffer *audioscale_bilinear (Audioscale * audioscale, GstBuffer * i_buf);
+static GstBuffer *audioscale_sinc (Audioscale * audioscale, GstBuffer * i_buf);
static GstElementClass *parent_class = NULL;
+
//static guint gst_audioscale_signals[LAST_SIGNAL] = { 0 };
GType
@@ -91,6 +150,12 @@
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FREQUENCY,
g_param_spec_int("frequency","frequency","frequency",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); // CHECKME
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FILTERLEN,
+ g_param_spec_int ("filter_length", "filter_length", "filter_length",
+ G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); // CHECKME
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_METHOD,
+ g_param_spec_int ("method", "method", "method",
+ G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); // CHECKME
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
@@ -99,22 +164,90 @@
}
+static GstPadNegotiateReturn
+audioscale_negotiate_src (GstPad * pad, GstCaps ** caps, gpointer * data)
+{
+ Audioscale *audioscale = GST_AUDIOSCALE (gst_pad_get_parent (pad));
+
+ g_print ("audioscale_negotiate_src\n");
+
+ if (*caps == NULL)
+ return GST_PAD_NEGOTIATE_FAIL;
+
+ *caps = gst_caps_copy_on_write (*caps);
+ gst_caps_set (*caps, "rate", GST_PROPS_INT_RANGE (8000, 48000));
+
+ return gst_pad_negotiate_proxy (pad, audioscale->sinkpad, caps);
+}
+
+static GstPadNegotiateReturn
+audioscale_negotiate_sink (GstPad * pad, GstCaps ** caps, gpointer * data)
+{
+ Audioscale *audioscale = GST_AUDIOSCALE (gst_pad_get_parent (pad));
+
+ g_print ("audioscale_negotiate_sink\n");
+
+ if (*caps == NULL)
+ return GST_PAD_NEGOTIATE_FAIL;
+
+ *caps = gst_caps_copy_on_write (*caps);
+ gst_caps_set (*caps, "rate", GST_PROPS_INT (audioscale->targetfrequency));
+
+ return gst_pad_negotiate_proxy (pad, audioscale->srcpad, caps);
+}
+
+static void
+gst_audioscale_newcaps (GstPad * pad, GstCaps * caps)
+{
+ Audioscale *audioscale;
+
+ audioscale = GST_AUDIOSCALE (gst_pad_get_parent (pad));
+
+ audioscale->frequency = gst_caps_get_int (caps, "rate");
+ audioscale->channels = gst_caps_get_int (caps, "channels");
+
+ switch(audioscale->method){
+ case GST_AUDIOSCALE_NEAREST:
+ audioscale->scale = &audioscale_nearest;
+ break;
+ case GST_AUDIOSCALE_BILINEAR:
+ audioscale->scale = &audioscale_bilinear;
+ break;
+ case GST_AUDIOSCALE_SINC:
+ audioscale->scale = &audioscale_sinc;
+ break;
+ default:
+ g_print("audioscale: unsupported scaling method %d\n", audioscale->method);
+ return;
+ }
+
+
+}
+
static void
gst_audioscale_init (Audioscale *audioscale)
{
- audioscale->sinkpad = gst_pad_new("sink",GST_PAD_SINK);
+ audioscale->sinkpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (sink_template), "sink");
+ gst_pad_set_negotiate_function (audioscale->sinkpad, audioscale_negotiate_sink);
gst_element_add_pad(GST_ELEMENT(audioscale),audioscale->sinkpad);
gst_pad_set_chain_function(audioscale->sinkpad,gst_audioscale_chain);
+ gst_pad_set_newcaps_function (audioscale->sinkpad, gst_audioscale_newcaps);
- audioscale->srcpad = gst_pad_new("src",GST_PAD_SRC);
+ audioscale->srcpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (src_template), "src");
+ gst_pad_set_negotiate_function (audioscale->srcpad, audioscale_negotiate_src);
+
gst_element_add_pad(GST_ELEMENT(audioscale),audioscale->srcpad);
audioscale->targetfrequency = -1;
audioscale->buffer = NULL;
audioscale->buffersize = 0;
-}
+ audioscale->i_start = 0;
+ audioscale->o_start = 0;
+ audioscale->halftaps = 16;
+}
+
static void
gst_audioscale_chain (GstPad *pad, GstBuffer *buf)
{
@@ -122,8 +255,6 @@
guchar *data;
gulong size;
GstBuffer *outbuf;
- int i;
- int pos;
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
@@ -133,60 +264,292 @@
data = GST_BUFFER_DATA(buf);
size = GST_BUFFER_SIZE(buf);
- GST_DEBUG (0,"gst_audioscale_chain: got buffer of %ld bytes in '%s'\n",size,
- gst_element_get_name (GST_ELEMENT (audioscale)));
+ GST_DEBUG (0,
+ "gst_audioscale_chain: got buffer of %ld bytes in '%s'\n",
+ size, gst_element_get_name (GST_ELEMENT (audioscale)));
- /* first deal with audio metadata */
- /*
- meta = gst_buffer_get_first_meta(buf);
- if (meta) {
- if (audioscale->format != ((MetaAudioRaw *)meta)->format ||
- audioscale->channels != ((MetaAudioRaw *)meta)->channels ||
- audioscale->frequency != ((MetaAudioRaw *)meta)->frequency) {
+ outbuf = audioscale->scale (audioscale, buf);
- audioscale->format = ((MetaAudioRaw *)meta)->format;
- audioscale->channels = ((MetaAudioRaw *)meta)->channels;
- audioscale->frequency = ((MetaAudioRaw *)meta)->frequency;
+ gst_pad_push (audioscale->srcpad, outbuf);
+
+ gst_buffer_unref (buf);
+}
+
+static GstBuffer *
+audioscale_nearest (Audioscale * audioscale, GstBuffer * i_buf)
+{
+ GstBuffer *o_buf;
+ double i_inc, o_inc;
+ double i_end, o_end;
+ int i_samples, o_samples;
+ int i_size, o_size;
+ signed short *i_ptr, *o_ptr;
+ int i_count = 0;
+ double a;
+ int i;
+
+ i_size = GST_BUFFER_SIZE (i_buf);
+ i_samples = i_size / 2 / audioscale->channels;
+
+ /* i_inc is the number of samples that the output increments for
+ * each input sample. o_inc is the opposite. */
+ i_inc = (double) audioscale->targetfrequency / audioscale->frequency;
+ o_inc = (double) audioscale->frequency / audioscale->targetfrequency;
+
+ /* i_start is the offset (in a given output sample) that is the
+ * beginning of the current input buffer */
+ i_end = audioscale->i_start + i_inc * i_samples;
+
+ o_samples = floor (i_end) - floor (audioscale->i_start);
+ o_end = audioscale->o_start + o_inc * o_samples;
+
+ /*g_print("audioscale: in=%d out=%d %g\n",samples,outsamples,
+ audioscale->invincrement); */
+
+ o_buf = gst_buffer_new ();
+ o_size = o_samples * audioscale->channels * 2;
+ GST_BUFFER_SIZE (o_buf) = o_size;
+ GST_BUFFER_DATA (o_buf) = g_malloc (o_size);
+ GST_BUFFER_TIMESTAMP (o_buf) = GST_BUFFER_TIMESTAMP (i_buf);
+
+ i_ptr = (signed short *) GST_BUFFER_DATA (i_buf);
+ o_ptr = (signed short *) GST_BUFFER_DATA (o_buf);
+
+ a = audioscale->o_start;
+ i_count = 0;
+#define SCALE_LOOP(COPY,INC) \
+ for (i = 0; i < o_samples; i++) { \
+ COPY; \
+ a += o_inc; \
+ while (a >= 1) { \
+ a -= 1; \
+ i_ptr+=INC; \
+ i_count++; \
+ } \
+ o_ptr+=INC; \
+ }
+
+ switch (audioscale->channels) {
+ case 1:
+ SCALE_LOOP (o_ptr[0] = i_ptr[0], 1);
+ break;
+ case 2:
+ SCALE_LOOP (o_ptr[0] = i_ptr[0];
+ o_ptr[1] = i_ptr[1], 2);
+ break;
+ default:
+ {
+ int n, n_chan = audioscale->channels;
+
+ SCALE_LOOP (for (n = 0; n < n_chan; n++) o_ptr[n] = i_ptr[n], n_chan);
}
}
- */
- if (audioscale->buffer == NULL) {
- audioscale->buffer = g_malloc(size);
- memcpy(audioscale->buffer, data, size);
- audioscale->buffersize = size;
+ if (i_count != i_samples) {
+ g_print ("handled %d in samples (expected %d)\n", i_count, i_samples);
+ }
+
+ audioscale->o_start = o_end - floor (o_end);
+ audioscale->i_start = i_end - floor (i_end);
+
+ return o_buf;
+}
+
+static GstBuffer *
+audioscale_bilinear (Audioscale * audioscale, GstBuffer * i_buf)
+{
+ GstBuffer *o_buf;
+ double i_inc, o_inc;
+ double i_end, o_end;
+ int i_samples, o_samples;
+ int i_size, o_size;
+ signed short *i_ptr, *o_ptr;
+ int o_count = 0;
+ double b;
+ int i;
+ double acc0, acc1;
+
+ i_size = GST_BUFFER_SIZE (i_buf);
+ i_samples = i_size / 2 / audioscale->channels;
+
+ /* i_inc is the number of samples that the output increments for
+ * each input sample. o_inc is the opposite. */
+ i_inc = (double) audioscale->targetfrequency / audioscale->frequency;
+ o_inc = (double) audioscale->frequency / audioscale->targetfrequency;
+
+ /* i_start is the offset (in a given output sample) that is the
+ * beginning of the current input buffer */
+ i_end = audioscale->i_start + i_inc * i_samples;
+
+ o_samples = floor (i_end) - floor (audioscale->i_start);
+
+ o_end = audioscale->o_start + o_inc * o_samples;
+
+ /*g_print("audioscale: in=%d out=%d %g\n",samples,outsamples,
+ audioscale->invincrement); */
+
+ o_buf = gst_buffer_new ();
+ o_size = o_samples * audioscale->channels * 2;
+ GST_BUFFER_SIZE (o_buf) = o_size;
+ GST_BUFFER_DATA (o_buf) = g_malloc (o_size);
+
+ i_ptr = (signed short *) GST_BUFFER_DATA (i_buf);
+ o_ptr = (signed short *) GST_BUFFER_DATA (o_buf);
+
+ acc0 = audioscale->acc[0];
+ acc1 = audioscale->acc[1];
+ b = audioscale->i_start;
+ for (i = 0; i < i_samples; i++) {
+ b += i_inc;
+//g_print("in %d\n",i_ptr[0]);
+ if (b >= 1) {
+ acc0 += (2.0 - b) * i_ptr[0];
+ acc1 += (2.0 - b) * i_ptr[1];
+
+ o_ptr[0] = rint (acc0 * i_inc);
+//g_print("out %d\n",o_ptr[0]);
+ o_ptr[1] = rint (acc1 * i_inc);
+ o_ptr += 2;
+ o_count++;
+ b -= 1.0;
+
+ acc0 = b * i_ptr[0];
+ acc1 = b * i_ptr[1];
}
else {
- audioscale->buffer = g_realloc(audioscale->buffer, audioscale->buffersize + size);
- memcpy(audioscale->buffer+audioscale->buffersize, data, size);
- audioscale->buffersize += size;
+ acc0 += i_ptr[0];
+ acc1 += i_ptr[1];
+ }
+ i_ptr += 2;
}
+ audioscale->acc[0] = acc0;
+ audioscale->acc[1] = acc1;
- while (audioscale->buffersize >= audioscale->frequency) {
- outbuf = gst_buffer_new();
- GST_BUFFER_DATA(outbuf) = g_malloc(audioscale->targetfrequency);
- GST_BUFFER_SIZE(outbuf) = audioscale->targetfrequency;
- //memcpy(GST_BUFFER_DATA(outbuf), audioscale->buffer, audioscale->targetfrequency);
+ if (o_count != o_samples) {
+ g_print ("handled %d out samples (expected %d)\n", o_count, o_samples);
+ }
- for (i=0; i< audioscale->targetfrequency/4; i++) {
- pos = (i * audioscale->frequency)/audioscale->targetfrequency;
- //printf("%d %d\n", i, pos);
- *(((gulong *)GST_BUFFER_DATA(outbuf))+i) = *(((gulong *)audioscale->buffer)+pos);
- }
- memcpy(audioscale->buffer, audioscale->buffer+audioscale->frequency, audioscale->buffersize-audioscale->frequency);
- audioscale->buffer = g_realloc(audioscale->buffer, audioscale->buffersize-audioscale->frequency);
- audioscale->buffersize -= audioscale->frequency;
+ audioscale->o_start = o_end - floor (o_end);
+ audioscale->i_start = i_end - floor (i_end);
- GST_DEBUG (0,"gst_audioscale_chain: pushing buffer of %d bytes in '%s'\n",GST_BUFFER_SIZE(outbuf),
- gst_element_get_name (GST_ELEMENT (audioscale)));
+ return o_buf;
+ }
- gst_pad_push(audioscale->srcpad, outbuf);
+inline double
+sinc (double sinx, double x)
+{
+#define INV3FAC 1.666666666e-1
+#define INV5FAC 8.333333333e-3
+#define INV7FAC 1.984126984e-4
+ if (-0.001 < x && x < 0.001) {
+ double x2 = x * x;
+
+ return 1 - x2 * INV3FAC + x2 * x2 * INV5FAC - x2 * x2 * x2 * INV7FAC;
}
- gst_buffer_unref(buf);
+ return sinx / x;
}
+static GstBuffer *
+audioscale_sinc (Audioscale * audioscale, GstBuffer * i_buf)
+{
+ GstBuffer *o_buf;
+ double i_inc, o_inc;
+ double i_end, o_end;
+ int i_samples, o_samples;
+ int i_size, o_size;
+ signed short *i_ptr, *o_ptr;
+ int i, j;
+ double c0, c1;
+ double a;
+ int start;
+ double center;
+ double weight;
+ int taps = audioscale->halftaps * 2 + 1;
+
+ if (!audioscale->buffer) {
+ int size = taps * 2 * audioscale->channels;
+
+ g_print ("audioscale temp buffer\n");
+ audioscale->buffer = g_malloc (size);
+ memset (audioscale->buffer, 0, size);
+ }
+
+ i_size = GST_BUFFER_SIZE (i_buf);
+ i_samples = i_size / 2 / audioscale->channels;
+
+ /* i_inc is the number of samples that the output increments for
+ * each input sample. o_inc is the opposite. */
+ i_inc = (double) audioscale->targetfrequency / audioscale->frequency;
+ o_inc = (double) audioscale->frequency / audioscale->targetfrequency;
+
+ /* i_start is the offset (in a given output sample) that is the
+ * beginning of the current input buffer */
+ i_end = audioscale->i_start + i_inc * i_samples;
+
+ o_samples = floor (i_end) - floor (audioscale->i_start);
+
+ o_end = audioscale->o_start + o_inc * o_samples;
+
+ //g_print("audioscale: in=%d out=%d %g\n",i_samples,o_samples,i_inc);
+
+ o_buf = gst_buffer_new ();
+ o_size = o_samples * audioscale->channels * 2;
+ GST_BUFFER_SIZE (o_buf) = o_size;
+ GST_BUFFER_DATA (o_buf) = g_malloc (o_size);
+
+ i_ptr = (signed short *) GST_BUFFER_DATA (i_buf);
+ o_ptr = (signed short *) GST_BUFFER_DATA (o_buf);
+
+ a = audioscale->i_start;
+#define GETBUF(index,chan) (((index)<0) \
+ ? ((short *)(audioscale->buffer))[((index)+taps)*2+(chan)] \
+ : i_ptr[(index)*2+(chan)])
+ {
+ double sinx, cosx, sind, cosd;
+ double x, d;
+ double t;
+
+ for (i = 0; i < o_samples; i++) {
+ start = floor (a) - taps;
+ center = a - audioscale->halftaps;
+ x = M_PI * (start - center) * o_inc;
+ sinx = sin (M_PI * (start - center) * o_inc);
+ cosx = cos (M_PI * (start - center) * o_inc);
+ d = M_PI * o_inc;
+ sind = sin (M_PI * o_inc);
+ cosd = cos (M_PI * o_inc);
+ c0 = 0;
+ c1 = 0;
+ for (j = 0; j < taps; j++) {
+ weight = sinc (sinx, x);
+//printf("j %d sin %g cos %g\n",j,sinx,cosx);
+//printf("j %d sin %g x %g sinc %g\n",j,sinx,x,weight);
+ c0 += weight * GETBUF ((start + j), 0);
+ c1 += weight * GETBUF ((start + j), 1);
+ t = cosx * cosd - sinx * sind;
+ sinx = cosx * sind + sinx * cosd;
+ cosx = t;
+ x += d;
+ }
+ o_ptr[0] = rint (c0);
+ o_ptr[1] = rint (c1);
+ o_ptr += 2;
+ a += o_inc;
+ }
+ }
+
+ audioscale->o_start = o_end - floor (o_end);
+ audioscale->i_start = i_end - floor (i_end);
+
+ memcpy (audioscale->buffer,
+ i_ptr + (i_samples - taps) * audioscale->channels, taps * 2 * audioscale->channels);
+
+ return o_buf;
+}
+
static void
-gst_audioscale_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+gst_audioscale_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
{
Audioscale *src;
@@ -198,7 +561,15 @@
case ARG_FREQUENCY:
src->targetfrequency = g_value_get_int (value);
break;
+ case ARG_FILTERLEN:
+ src->halftaps = g_value_get_int (value);
+ g_print ("new filter length %d\n", src->halftaps);
+ break;
+ case ARG_METHOD:
+ src->method = g_value_get_int (value);
+ break;
default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -216,6 +587,12 @@
case ARG_FREQUENCY:
g_value_set_int (value, src->targetfrequency);
break;
+ case ARG_FILTERLEN:
+ g_value_set_int (value, src->halftaps);
+ break;
+ case ARG_METHOD:
+ g_value_set_int (value, src->method);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -229,8 +606,7 @@
GstElementFactory *factory;
/* create an elementfactory for the audioscale element */
- factory = gst_elementfactory_new("audioscale",GST_TYPE_AUDIOSCALE,
- &audioscale_details);
+ factory = gst_elementfactory_new ("audioscale", GST_TYPE_AUDIOSCALE, &audioscale_details);
g_return_val_if_fail(factory != NULL, FALSE);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
@@ -243,4 +619,3 @@
"audioscale",
plugin_init
};
-
Index: audioscale.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/audioscale/audioscale.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- audioscale.h 2001/06/25 01:20:09 1.5
+++ audioscale.h 2001/10/28 22:13:25 1.6
@@ -42,6 +42,12 @@
#define GST_IS_AUDIOSCALE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSCALE))
+typedef enum {
+ GST_AUDIOSCALE_NEAREST,
+ GST_AUDIOSCALE_BILINEAR,
+ GST_AUDIOSCALE_SINC,
+} GstAudioScaleMethod;
+
typedef struct _Audioscale Audioscale;
typedef struct _AudioscaleClass AudioscaleClass;
@@ -55,9 +61,18 @@
gint channels;
gint frequency;
gint targetfrequency;
+ gint halftaps;
+ gint method;
+ GstBuffer *(*scale)(Audioscale *audioscale, GstBuffer * i_buf);
+
+ double i_start;
+ double o_start;
+
guchar *buffer;
gulong buffersize;
+
+ double acc[10];
};
struct _AudioscaleClass {
- Previous message: [gst-cvs] CVS: gstreamer/plugins/rtp/rtpsend .cvsignore,1.1,NONE Makefile.am,1.1,NONE rtp.c,1.1,NONE rtp.h,1.1,NONE rtpsend.c,1.5,NONE rtpsend.h,1.2,NONE
- Next message: [gst-cvs] CVS: gstreamer/plugins/capture Makefile.am,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Gstreamer-commits
mailing list