Asterisk - The Open Source Telephony Project GIT-master-b023714
|
OGG/Vorbis streams. More...
#include "asterisk.h"
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
#include <vorbis/vorbisfile.h>
#include "asterisk/mod_format.h"
#include "asterisk/module.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | ogg_vorbis_desc |
Macros | |
#define | BLOCK_SIZE 4096 /* used internally in the vorbis routines */ |
#define | BUF_SIZE (2*SAMPLES_MAX) |
#define | SAMPLES_MAX 512 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | _ov_header_fseek_wrap (FILE *f, ogg_int64_t off, int whence) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
static void | ogg_vorbis_close (struct ast_filestream *fs) |
Close a OGG/Vorbis filestream. | |
static int | ogg_vorbis_open (struct ast_filestream *s) |
Create a new OGG/Vorbis filestream and set it up for reading. | |
static struct ast_frame * | ogg_vorbis_read (struct ast_filestream *fs, int *whennext) |
Read a frame full of audio data from the filestream. | |
static int | ogg_vorbis_rewrite (struct ast_filestream *s, const char *comment) |
Create a new OGG/Vorbis filestream and set it up for writing. | |
static int | ogg_vorbis_seek (struct ast_filestream *fs, off_t sample_offset, int whence) |
Seek to a specific position in an OGG/Vorbis filestream. | |
static off_t | ogg_vorbis_tell (struct ast_filestream *fs) |
Tell the current position in OGG/Vorbis filestream measured in pcms. | |
static int | ogg_vorbis_trunc (struct ast_filestream *fs) |
Truncate an OGG/Vorbis filestream. | |
static int | ogg_vorbis_write (struct ast_filestream *fs, struct ast_frame *f) |
Write audio data from a frame to an OGG/Vorbis filestream. | |
static int | unload_module (void) |
static void | write_stream (struct ogg_vorbis_desc *s, FILE *f) |
Write out any pending encoded data. | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "OGG/Vorbis audio" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static ov_callbacks | OV_CALLBACKS_NOCLOSE |
static struct ast_format_def | vorbis_f |
#define BLOCK_SIZE 4096 /* used internally in the vorbis routines */ |
Definition at line 56 of file format_ogg_vorbis.c.
#define BUF_SIZE (2*SAMPLES_MAX) |
Definition at line 54 of file format_ogg_vorbis.c.
#define SAMPLES_MAX 512 |
Definition at line 53 of file format_ogg_vorbis.c.
|
static |
Definition at line 449 of file format_ogg_vorbis.c.
|
static |
Definition at line 449 of file format_ogg_vorbis.c.
|
static |
Definition at line 88 of file format_ogg_vorbis.c.
References NULL.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 449 of file format_ogg_vorbis.c.
|
static |
Definition at line 431 of file format_ogg_vorbis.c.
References ast_format_def_register, ast_format_slin, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_format_def::format, and vorbis_f.
|
static |
Close a OGG/Vorbis filestream.
fs | A OGG/Vorbis filestream. |
Definition at line 269 of file format_ogg_vorbis.c.
References ast_filestream::_private, ast_filestream::f, ogg_vorbis_desc::os, ogg_vorbis_desc::ov_f, ogg_vorbis_desc::vb, ogg_vorbis_desc::vc, ogg_vorbis_desc::vd, ogg_vorbis_desc::vi, write_stream(), and ogg_vorbis_desc::writing.
|
static |
Create a new OGG/Vorbis filestream and set it up for reading.
s | File that points to on disk storage of the OGG/Vorbis data. |
Definition at line 109 of file format_ogg_vorbis.c.
References ast_filestream::_private, ast_log, DEFAULT_SAMPLE_RATE, desc, ast_filestream::f, LOG_ERROR, NULL, OV_CALLBACKS_NOCLOSE, and result.
|
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 297 of file format_ogg_vorbis.c.
References __BIG_ENDIAN, __BYTE_ORDER, ast_filestream::_private, AST_FRAME_SET_BUFFER, AST_FRIENDLY_OFFSET, ast_log, ast_filestream::buf, BUF_SIZE, ast_frame::data, ast_frame::datalen, desc, ast_filestream::fr, LOG_WARNING, NULL, ast_frame::ptr, and ast_frame::samples.
|
static |
Create a new OGG/Vorbis filestream and set it up for writing.
s | File pointer that points to on-disk storage. |
comment | Comment that should be embedded in the OGG/Vorbis file. |
Definition at line 147 of file format_ogg_vorbis.c.
References ast_filestream::_private, ast_log, ast_random(), comment, DEFAULT_SAMPLE_RATE, ogg_vorbis_desc::eos, errno, ast_filestream::f, LOG_ERROR, LOG_WARNING, ogg_vorbis_desc::og, ogg_vorbis_desc::os, ogg_vorbis_desc::vb, ogg_vorbis_desc::vc, ogg_vorbis_desc::vd, ogg_vorbis_desc::vi, ogg_vorbis_desc::writing, and ogg_vorbis_desc::writing_pcm_pos.
|
static |
Seek to a specific position in an OGG/Vorbis filestream.
fs | The filestream to take action on. |
sample_offset | New position for the filestream, measured in 8KHz samples. |
whence | Location to measure |
Definition at line 377 of file format_ogg_vorbis.c.
References ast_filestream::_private, ast_log, desc, LOG_WARNING, and ogg_vorbis_tell().
|
static |
Tell the current position in OGG/Vorbis filestream measured in pcms.
fs | The filestream to take action on. |
Definition at line 355 of file format_ogg_vorbis.c.
References ast_filestream::_private, and desc.
Referenced by ogg_vorbis_seek().
|
static |
Truncate an OGG/Vorbis filestream.
fs | The filestream to truncate. |
Definition at line 344 of file format_ogg_vorbis.c.
References ast_log, and LOG_WARNING.
|
static |
Write audio data from a frame to an OGG/Vorbis filestream.
fs | An OGG/Vorbis filestream. |
f | A frame containing audio to be written to the filestream. |
Definition at line 235 of file format_ogg_vorbis.c.
References ast_filestream::_private, ast_log, ast_frame::data, ast_frame::datalen, ast_filestream::f, LOG_ERROR, ast_frame::ptr, ast_frame::samples, ogg_vorbis_desc::vd, write_stream(), ogg_vorbis_desc::writing, and ogg_vorbis_desc::writing_pcm_pos.
|
static |
Definition at line 439 of file format_ogg_vorbis.c.
References ast_format_def_unregister(), ast_format_def::name, and vorbis_f.
|
static |
Write out any pending encoded data.
s | An OGG/Vorbis filestream. |
f | The file to write to. |
Definition at line 203 of file format_ogg_vorbis.c.
References ast_log, ogg_vorbis_desc::eos, errno, LOG_WARNING, NULL, ogg_vorbis_desc::og, ogg_vorbis_desc::op, ogg_vorbis_desc::os, ogg_vorbis_desc::vb, and ogg_vorbis_desc::vd.
Referenced by ast_write_stream(), ogg_vorbis_close(), ogg_vorbis_write(), and tech_write().
|
static |
Definition at line 449 of file format_ogg_vorbis.c.
|
static |
Definition at line 449 of file format_ogg_vorbis.c.
|
static |
Definition at line 96 of file format_ogg_vorbis.c.
Referenced by ogg_vorbis_open().
|
static |
Definition at line 416 of file format_ogg_vorbis.c.
Referenced by load_module(), and unload_module().