diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-19 00:19:29 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-19 00:19:29 +0000 |
commit | f8247040e6231c4b3b5099ea3a526348b7941566 (patch) | |
tree | 0cc92ad6ebf6ae49a62f6e7ef8ec819121d63630 /trunk/include/asterisk/slinfactory.h | |
parent | d88e56c61ce2042544c1a8a71c93b69ab2e6ffba (diff) |
Creating tag for the release of asterisk-1.6.0-beta1v1.6.0-beta1
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.6.0-beta1@99163 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'trunk/include/asterisk/slinfactory.h')
-rw-r--r-- | trunk/include/asterisk/slinfactory.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/trunk/include/asterisk/slinfactory.h b/trunk/include/asterisk/slinfactory.h new file mode 100644 index 000000000..603c648c7 --- /dev/null +++ b/trunk/include/asterisk/slinfactory.h @@ -0,0 +1,65 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2005, Anthony Minessale II + * + * Anthony Minessale <anthmct@yahoo.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * \brief A machine to gather up arbitrary frames and convert them + * to raw slinear on demand. + */ + +#ifndef _ASTERISK_SLINFACTORY_H +#define _ASTERISK_SLINFACTORY_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +struct ast_slinfactory { + AST_LIST_HEAD_NOLOCK(, ast_frame) queue; + struct ast_trans_pvt *trans; + short hold[1280]; + short *offset; + size_t holdlen; /*!< in samples */ + unsigned int size; /*!< in samples */ + unsigned int format; +}; + +void ast_slinfactory_init(struct ast_slinfactory *sf); + +/*! + * \brief Destroy the contents of a slinfactory + * + * \arg sf the slinfactory that is no longer needed + * + * This function will free any memory allocated for the contents of the + * slinfactory. It does not free the slinfactory itself. If the sf is + * malloc'd, then it must be explicitly free'd after calling this function. + * + * \return nothing + */ +void ast_slinfactory_destroy(struct ast_slinfactory *sf); + +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); +unsigned int ast_slinfactory_available(const struct ast_slinfactory *sf); +void ast_slinfactory_flush(struct ast_slinfactory *sf); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* _ASTERISK_SLINFACTORY_H */ |