summaryrefslogtreecommitdiffstats
path: root/gst/speexresample/speex_resampler.h
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2007-11-23 08:48:50 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-11-23 08:48:50 +0000
commite8182f4d33a93374e586127e88c3d18fd9c13ffc (patch)
tree81068e58d1eb14987644273badaaee732d99cf76 /gst/speexresample/speex_resampler.h
parentf219caaf015cf4bec440519008cba304e2270199 (diff)
downloadgst-plugins-bad-e8182f4d33a93374e586127e88c3d18fd9c13ffc.tar.gz
gst-plugins-bad-e8182f4d33a93374e586127e88c3d18fd9c13ffc.tar.bz2
gst-plugins-bad-e8182f4d33a93374e586127e88c3d18fd9c13ffc.zip
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.
Diffstat (limited to 'gst/speexresample/speex_resampler.h')
-rw-r--r--gst/speexresample/speex_resampler.h65
1 files changed, 63 insertions, 2 deletions
diff --git a/gst/speexresample/speex_resampler.h b/gst/speexresample/speex_resampler.h
index 7ca6efc0..7c6282b5 100644
--- a/gst/speexresample/speex_resampler.h
+++ b/gst/speexresample/speex_resampler.h
@@ -73,6 +73,11 @@
#define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride)
#define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride)
#define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride)
+#define speex_resampler_get_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_latency)
+#define speex_resampler_drain_float CAT_PREFIX(RANDOM_PREFIX,_resampler_drain_float)
+#define speex_resampler_drain_int CAT_PREFIX(RANDOM_PREFIX,_resampler_drain_int)
+#define speex_resampler_drain_interleaved_float CAT_PREFIX(RANDOM_PREFIX,_resampler_drain_interleaved_float)
+#define speex_resampler_drain_interleaved_int CAT_PREFIX(RANDOM_PREFIX,_resampler_drain_interleaved_int)
#define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros)
#define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
#define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)
@@ -283,7 +288,7 @@ void speex_resampler_set_input_stride(SpeexResamplerState *st,
/** Get the input stride.
* @param st Resampler state
- * @param stride Input stride copied
+ * @param stride Input stride
*/
void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
@@ -296,12 +301,68 @@ void speex_resampler_set_output_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the output stride.
- * @param st Resampler state copied
+ * @param st Resampler state
* @param stride Output stride
*/
void speex_resampler_get_output_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
+/** Get the latency in input samples introduced by the resampler.
+ * @param st Resampler state
+ */
+int speex_resampler_get_latency(SpeexResamplerState *st);
+
+/**
+ * Outputs the remaining samples into a float array.
+ * @param st Resampler state
+ * @param channel_index Index of the channel to process for the multi-channel
+ * base (0 otherwise)
+ * of samples processed
+ * @param out Output buffer
+ * @param out_len Size of the output buffer. Returns the number of samples written
+ */
+int speex_resampler_drain_float(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ float *out,
+ spx_uint32_t *out_len);
+/**
+ * Outputs the remaining samples into an int array.
+ * @param st Resampler state
+ * @param channel_index Index of the channel to process for the multi-channel
+ * base (0 otherwise)
+ * of samples processed
+ * @param out Output buffer
+ * @param out_len Size of the output buffer. Returns the number of samples written
+ */
+int speex_resampler_drain_int(SpeexResamplerState *st,
+ spx_uint32_t channel_index,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
+/**
+ * Outputs the remaining samples into a float array.
+ * @param st Resampler state
+ * @param channel_index Index of the channel to process for the multi-channel
+ * base (0 otherwise)
+ * of samples processed
+ * @param out Output buffer
+ * @param out_len Size of the output buffer. Returns the number of samples written
+ */
+int speex_resampler_drain_interleaved_float(SpeexResamplerState *st,
+ float *out,
+ spx_uint32_t *out_len);
+/**
+ * Outputs the remaining samples into an int array.
+ * @param st Resampler state
+ * @param channel_index Index of the channel to process for the multi-channel
+ * base (0 otherwise)
+ * of samples processed
+ * @param out Output buffer
+ * @param out_len Size of the output buffer. Returns the number of samples written
+ */
+int speex_resampler_drain_interleaved_int(SpeexResamplerState *st,
+ spx_int16_t *out,
+ spx_uint32_t *out_len);
+
/** Make sure that the first samples to go out of the resamplers don't have
* leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as