diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-10 19:38:26 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-10 19:38:26 +0000 |
commit | 446fe9d06743deee7ccf8f563b2a5d05ed4e05d8 (patch) | |
tree | 7a206b5c388b0c0b991e2a4255879a4846999dde /include | |
parent | 2ff66c038be0869476cf2b6b5cc8033161ec9b11 (diff) |
improve slinfactory API to remove implicit sample rate and require explicit sample rate selection by creator of the slinfactory
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@174705 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/slinfactory.h | 21 |
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 * |