summaryrefslogtreecommitdiff
path: root/libswresample/swresample.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-18 23:02:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-18 23:02:10 +0200
commit4def5d2b64d78a6f15c6c8869c28ece1f823626e (patch)
treec87e238e24d5ed09fae8476808aa0bea3ace5756 /libswresample/swresample.h
parent6ba692f8a7110c3960edb4b8e7a6736ee7124e2e (diff)
downloadffmpeg-4def5d2b64d78a6f15c6c8869c28ece1f823626e.tar.gz
swr: add swr_get_delay() to find the exact delay the swresampler introduces.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/swresample.h')
-rw-r--r--libswresample/swresample.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/libswresample/swresample.h b/libswresample/swresample.h
index 137517d6d2..43112f9c17 100644
--- a/libswresample/swresample.h
+++ b/libswresample/swresample.h
@@ -30,7 +30,7 @@
#include "libavutil/samplefmt.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 0
-#define LIBSWRESAMPLE_VERSION_MINOR 11
+#define LIBSWRESAMPLE_VERSION_MINOR 12
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
@@ -159,6 +159,24 @@ int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
/**
+ * Gets the delay the next input sample will experience relative to the next output sample.
+ *
+ * Swresample can buffer data if more input has been provided than available
+ * output space, also converting between sample rates needs a delay.
+ * This function returns the sum of all such delays.
+ *
+ * @param s swr context
+ * @param base timebase in which the returned delay will be
+ * if its set to 1 the returned delay is in seconds
+ * if its set to 1000 the returned delay is in milli seconds
+ * if its set to the input sample rate then the returned delay is in input samples
+ * if its set to the output sample rate then the returned delay is in output samples
+ * an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate)
+ * @returns the delay in 1/base units.
+ */
+int64_t swr_get_delay(struct SwrContext *s, int64_t base);
+
+/**
* Return the LIBSWRESAMPLE_VERSION_INT constant.
*/
unsigned swresample_version(void);