diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2005-08-24 14:08:58 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2005-08-24 14:08:58 +0000 |
commit | c4763dbb33c77f064d73147c05194d393cea5d9a (patch) | |
tree | b1492d21a0a235b3f1eb43b36e3c4f2614c0dc77 /gst/audioresample/resample.c | |
parent | 0232ff9645070024f90e7c83b821fb472c46e34b (diff) | |
download | gst-plugins-bad-c4763dbb33c77f064d73147c05194d393cea5d9a.tar.gz gst-plugins-bad-c4763dbb33c77f064d73147c05194d393cea5d9a.tar.bz2 gst-plugins-bad-c4763dbb33c77f064d73147c05194d393cea5d9a.zip |
port audioresample to basetransform
Original commit message from CVS:
port audioresample to basetransform
Diffstat (limited to 'gst/audioresample/resample.c')
-rw-r--r-- | gst/audioresample/resample.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gst/audioresample/resample.c b/gst/audioresample/resample.c index 38c6ba84..e8ec45fb 100644 --- a/gst/audioresample/resample.c +++ b/gst/audioresample/resample.c @@ -29,9 +29,9 @@ #include <limits.h> #include <liboil/liboil.h> -#include <audioresample/resample.h> -#include <audioresample/buffer.h> -#include <audioresample/debug.h> +#include "resample.h" +#include "buffer.h" +#include "debug.h" void resample_scale_ref (ResampleState * r); void resample_scale_functable (ResampleState * r); @@ -101,6 +101,10 @@ resample_buffer_free (AudioresampleBuffer * buffer, void *priv) } } +/** + * free_func: a function that frees the given closure. If NULL, caller is + * responsible for freeing. + */ void resample_add_input_data (ResampleState * r, void *data, int size, void (*free_func) (void *), void *closure) @@ -135,6 +139,12 @@ resample_input_eos (ResampleState * r) } int +resample_get_output_size_for_input (ResampleState * r, int size) +{ + return floor (size * r->o_rate / r->i_rate); +} + +int resample_get_output_size (ResampleState * r) { return floor (audioresample_buffer_queue_get_depth (r->queue) * r->o_rate / |