Asterisk - The Open Source Telephony Project
21.4.1
|
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 = "da6642af068ee5e6490c5b1d2cc1d238" , .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 |
|
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.
|
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_filestream::fmt, and ast_format_def::format.
|
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, ast_frame::data, ast_frame::datalen, ast_filestream::fr, 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.
|
static |
Truncate an OGG/Speex filestream.
s | The filestream to truncate. |
Definition at line 251 of file format_ogg_speex.c.