00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 2005, Anthony Minessale II 00005 * 00006 * Anthony Minessale <anthmct@yahoo.com> 00007 * 00008 * See http://www.asterisk.org for more information about 00009 * the Asterisk project. Please do not directly contact 00010 * any of the maintainers of this project for assistance; 00011 * the project provides a web site, mailing lists and IRC 00012 * channels for your use. 00013 * 00014 * This program is free software, distributed under the terms of 00015 * the GNU General Public License Version 2. See the LICENSE file 00016 * at the top of the source tree. 00017 */ 00018 00019 /*! \file 00020 * \brief A machine to gather up arbitrary frames and convert them 00021 * to raw slinear on demand. 00022 */ 00023 00024 #ifndef _ASTERISK_SLINFACTORY_H 00025 #define _ASTERISK_SLINFACTORY_H 00026 #include <stdlib.h> 00027 #include <unistd.h> 00028 #include <string.h> 00029 00030 00031 #if defined(__cplusplus) || defined(c_plusplus) 00032 extern "C" { 00033 #endif 00034 00035 struct ast_slinfactory { 00036 struct ast_frame *queue; 00037 struct ast_trans_pvt *trans; 00038 short hold[1280]; 00039 short *offset; 00040 size_t holdlen; 00041 int size; 00042 int format; 00043 }; 00044 00045 void ast_slinfactory_init(struct ast_slinfactory *sf); 00046 void ast_slinfactory_destroy(struct ast_slinfactory *sf); 00047 int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f); 00048 int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t bytes); 00049 00050 00051 00052 #if defined(__cplusplus) || defined(c_plusplus) 00053 } 00054 #endif 00055 00056 #endif /* _ASTERISK_SLINFACTORY_H */