Mon Sep 20 2010 00:23:53

Asterisk developer's documentation


slin.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2007, Digium, Inc.
00005  *
00006  * Russell Bryant <russell@digium.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 static uint8_t ex_slin8[] = {
00020    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00021    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00022    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00023    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00024    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00025    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00026    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00027    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00028    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00029    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00030    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00031    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00032    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00033    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00034    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00035    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00036    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00037    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00038    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00039    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00040 };
00041 
00042 static uint8_t ex_slin16[] = {
00043    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00044    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00045    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00046    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00047    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00048    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00049    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00050    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00051    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00052    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00053    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00054    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00055    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00056    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00057    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00058    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00059    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00060    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00061    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00062    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00063    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00064    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00065    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00066    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00067    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00068    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00069    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00070    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00071    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00072    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00073    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00074    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00075    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00076    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00077    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00078    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00079    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00080    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00081    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00082    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00083 };
00084 
00085 static inline struct ast_frame *slin8_sample(void)
00086 {
00087    static struct ast_frame f = {
00088       .frametype = AST_FRAME_VOICE,
00089       .subclass = AST_FORMAT_SLINEAR,
00090       .datalen = sizeof(ex_slin8),
00091       .samples = ARRAY_LEN(ex_slin8) / 2,
00092       .mallocd = 0,
00093       .offset = 0,
00094       .src = __PRETTY_FUNCTION__,
00095       .data.ptr = ex_slin8,
00096    };
00097 
00098    return &f;
00099 }
00100 
00101 static inline struct ast_frame *slin16_sample(void)
00102 {
00103    static struct ast_frame f = {
00104       .frametype = AST_FRAME_VOICE,
00105       .subclass = AST_FORMAT_SLINEAR16,
00106       .datalen = sizeof(ex_slin16),
00107       .samples = ARRAY_LEN(ex_slin16) / 2,
00108       .mallocd = 0,
00109       .offset = 0,
00110       .src = __PRETTY_FUNCTION__,
00111       .data.ptr = ex_slin16,
00112    };
00113 
00114    return &f;
00115 }