summaryrefslogtreecommitdiff
path: root/include/asterisk/slinfactory.h
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-02-10 19:38:26 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-02-10 19:38:26 +0000
commit23939e54f389f7cd2f8aa73699f99edde60072c8 (patch)
tree7a206b5c388b0c0b991e2a4255879a4846999dde /include/asterisk/slinfactory.h
parent656110e42bbf4a94a3e149c0c7959eca8dd300fe (diff)
improve slinfactory API to remove implicit sample rate and require explicit sample rate selection by creator of the slinfactory
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/slinfactory.h')
-rw-r--r--include/asterisk/slinfactory.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/asterisk/slinfactory.h b/include/asterisk/slinfactory.h
index 1b13b5a24..4309af789 100644
--- a/include/asterisk/slinfactory.h
+++ b/include/asterisk/slinfactory.h
@@ -38,10 +38,11 @@ struct ast_slinfactory {
size_t holdlen; /*!< Number of samples currently in the hold */
unsigned int size; /*!< Number of samples currently in the factory */
unsigned int format; /*!< Current format the translation path is converting from */
+ unsigned int output_format; /*!< The output format desired */
};
/*!
- * \brief Initialize an slinfactory
+ * \brief Initialize a slinfactory
*
* \param sf The slinfactory to initialize
*
@@ -50,6 +51,16 @@ struct ast_slinfactory {
void ast_slinfactory_init(struct ast_slinfactory *sf);
/*!
+ * \brief Initialize a slinfactory
+ *
+ * \param sf The slinfactory to initialize
+ * \param sample_rate The output sample rate desired
+ *
+ * \return 0 on success, non-zero on failure
+ */
+int ast_slinfactory_init_rate(struct ast_slinfactory *sf, unsigned int sample_rate);
+
+/*!
* \brief Destroy the contents of a slinfactory
*
* \param sf The slinfactory that is no longer needed
@@ -63,7 +74,7 @@ void ast_slinfactory_init(struct ast_slinfactory *sf);
void ast_slinfactory_destroy(struct ast_slinfactory *sf);
/*!
- * \brief Feed audio into an slinfactory
+ * \brief Feed audio into a slinfactory
*
* \param sf The slinfactory to feed into
* \param f Frame containing audio to feed in
@@ -73,7 +84,7 @@ void ast_slinfactory_destroy(struct ast_slinfactory *sf);
int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f);
/*!
- * \brief Read samples from an slinfactory
+ * \brief Read samples from a slinfactory
*
* \param sf The slinfactory to read from
* \param buf Buffer to put samples into
@@ -84,7 +95,7 @@ int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f);
int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples);
/*!
- * \brief Retrieve number of samples currently in an slinfactory
+ * \brief Retrieve number of samples currently in a slinfactory
*
* \param sf The slinfactory to peek into
*
@@ -93,7 +104,7 @@ int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples)
unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf);
/*!
- * \brief Flush the contents of an slinfactory
+ * \brief Flush the contents of a slinfactory
*
* \param sf The slinfactory to flush
*