Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
OGG/Speex streams. More...
#include "asterisk.h"
#include "asterisk/mod_format.h"
#include "asterisk/module.h"
#include "asterisk/format_cache.h"
#include <speex/speex_header.h>
#include <ogg/ogg.h>
Go to the source code of this file.
Data Structures | |
struct | speex_desc |
Macros | |
#define | BLOCK_SIZE 4096 /* buffer size for feeding OGG routines */ |
#define | BUF_SIZE 200 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
static void | ogg_speex_close (struct ast_filestream *fs) |
Close a OGG/Speex filestream. More... | |
static int | ogg_speex_open (struct ast_filestream *fs) |
Create a new OGG/Speex filestream and set it up for reading. More... | |
static struct ast_frame * | ogg_speex_read (struct ast_filestream *fs, int *whennext) |
Read a frame full of audio data from the filestream. More... | |
static int | ogg_speex_seek (struct ast_filestream *s, off_t sample_offset, int whence) |
Seek to a specific position in an OGG/Speex filestream. More... | |
static off_t | ogg_speex_tell (struct ast_filestream *s) |
static int | ogg_speex_trunc (struct ast_filestream *s) |
Truncate an OGG/Speex filestream. More... | |
static int | ogg_speex_write (struct ast_filestream *s, struct ast_frame *f) |
static int | read_packet (struct ast_filestream *fs) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "OGG/Speex audio" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_format_def | speex16_f |
static struct ast_format_def | speex32_f |
static struct ast_format_def | speex_f |
#define BLOCK_SIZE 4096 /* buffer size for feeding OGG routines */ |
Definition at line 39 of file format_ogg_speex.c.
#define BUF_SIZE 200 |
Definition at line 40 of file format_ogg_speex.c.
|
static |
Definition at line 354 of file format_ogg_speex.c.
|
static |
Definition at line 354 of file format_ogg_speex.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 354 of file format_ogg_speex.c.
|
static |
Definition at line 333 of file format_ogg_speex.c.
References ast_format_def_register, ast_format_speex, ast_format_speex16, ast_format_speex32, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_format_def::format, speex16_f, speex32_f, speex_f, and unload_module().
|
static |
Close a OGG/Speex filestream.
fs | A OGG/Speex filestream. |
Definition at line 214 of file format_ogg_speex.c.
References ast_filestream::_private, speex_desc::os, and speex_desc::oy.
|
static |
Create a new OGG/Speex filestream and set it up for reading.
fs | File that points to on disk storage of the OGG/Speex data. |
Definition at line 130 of file format_ogg_speex.c.
References ast_filestream::_private, ast_format_get_sample_rate(), ast_log, BLOCK_SIZE, error(), ast_filestream::f, ast_filestream::fmt, ast_format_def::format, LOG_ERROR, NULL, speex_desc::og, speex_desc::op, speex_desc::os, speex_desc::oy, read_packet(), result, and speex_desc::serialno.
|
static |
Read a frame full of audio data from the filestream.
fs | The filestream. |
whennext | Number of sample times to schedule the next call. |
Definition at line 228 of file format_ogg_speex.c.
References ast_filestream::_private, ast_codec_samples_count(), AST_FRAME_SET_BUFFER, AST_FRIENDLY_OFFSET, ast_filestream::buf, BUF_SIZE, ast_frame::data, ast_frame::datalen, ast_filestream::fr, if(), NULL, speex_desc::op, ast_frame::ptr, read_packet(), and ast_frame::samples.
|
static |
Seek to a specific position in an OGG/Speex filestream.
s | The filestream to truncate. |
sample_offset | New position for the filestream, measured in 8KHz samples. |
whence | Location to measure |
Definition at line 270 of file format_ogg_speex.c.
References ast_log, and LOG_WARNING.
|
static |
Definition at line 276 of file format_ogg_speex.c.
References ast_log, and LOG_WARNING.
|
static |
Truncate an OGG/Speex filestream.
s | The filestream to truncate. |
Definition at line 251 of file format_ogg_speex.c.
References ast_log, and LOG_WARNING.
|
static |
Definition at line 257 of file format_ogg_speex.c.
References ast_log, and LOG_WARNING.
|
static |
Definition at line 55 of file format_ogg_speex.c.
References ast_filestream::_private, ast_log, BLOCK_SIZE, speex_desc::eos, ast_filestream::f, LOG_WARNING, speex_desc::og, speex_desc::op, speex_desc::os, speex_desc::oy, result, speex_desc::serialno, and while().
Referenced by ogg_speex_open(), and ogg_speex_read().
|
static |
Definition at line 324 of file format_ogg_speex.c.
References ast_format_def_unregister(), ast_format_def::name, speex16_f, speex32_f, and speex_f.
Referenced by load_module().
|
static |
Definition at line 354 of file format_ogg_speex.c.
|
static |
Definition at line 354 of file format_ogg_speex.c.
|
static |
Definition at line 296 of file format_ogg_speex.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 310 of file format_ogg_speex.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 282 of file format_ogg_speex.c.
Referenced by load_module(), and unload_module().