root/rat/trunk/codec_types.h @ 2270

Revision 2270, 3.2 KB (checked in by ucaccsp, 15 years ago)

Mu -> � :-)

(okay, so I got bored whilst working on other stuff...)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * FILE:    codec_types.h
3 * PROGRAM: RAT
4 * AUTHOR:  Orion Hodson
5 *
6 * $Revision$
7 * $Date$
8 *
9 * Copyright (c) 1995-98 University College London
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, is permitted, for non-commercial use only, provided
14 * that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright
16 *    notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 *    notice, this list of conditions and the following disclaimer in the
19 *    documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 *    must display the following acknowledgement:
22 *      This product includes software developed by the Computer Science
23 *      Department at University College London
24 * 4. Neither the name of the University nor of the Department may be used
25 *    to endorse or promote products derived from this software without
26 *    specific prior written permission.
27 * Use of this software for commercial purposes is explicitly forbidden
28 * unless prior written permission is obtained from the authors.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 */
42
43#ifndef _CODEC_TYPES_H_
44#define _CODEC_TYPES_H_
45
46#define CODEC_PAYLOAD_DYNAMIC   255
47
48typedef u_int32 codec_id_t;
49
50typedef struct {
51        u_char    *state;
52        codec_id_t id;
53} codec_state;
54
55#define CODEC_SHORT_NAME_LEN   16
56#define CODEC_LONG_NAME_LEN    32
57#define CODEC_DESCRIPTION_LEN 128
58
59typedef struct s_codec_format {
60        char         short_name[CODEC_SHORT_NAME_LEN];
61        char         long_name[CODEC_LONG_NAME_LEN];
62        char         description[CODEC_DESCRIPTION_LEN];
63        u_char       default_pt;
64        u_int16      mean_per_packet_state_size;
65        u_int16      mean_coded_frame_size;
66        const audio_format format;
67} codec_format_t;
68
69typedef struct s_coded_unit {
70        codec_id_t id;
71        u_char  *state;
72        u_int16  state_len;
73        u_char  *data;
74        u_int16  data_len;
75} coded_unit;
76
77#define MAX_MEDIA_UNITS  3
78/* This data structure is for storing multiple representations of
79 * coded audio for a given time interval.
80 */
81typedef struct {
82        u_int8      nrep;
83        coded_unit *rep[MAX_MEDIA_UNITS];
84} media_data;
85
86int  media_data_create    (media_data **m, int nrep);
87void media_data_destroy   (media_data **m, u_int32 md_size);
88
89#endif /* _CODEC_TYPES_H_ */
Note: See TracBrowser for help on using the browser.