root/rat/trunk/codec_types.h @ 2966

Revision 2966, 1.6 KB (checked in by ucacoxh, 15 years ago)

- Added media_data_dup for duplicating media_data units.

  • 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 */
13
14#ifndef _CODEC_TYPES_H_
15#define _CODEC_TYPES_H_
16
17#define CODEC_PAYLOAD_DYNAMIC   255
18
19typedef uint32_t codec_id_t;
20
21typedef struct {
22        u_char    *state;
23        codec_id_t id;
24} codec_state;
25
26#define CODEC_SHORT_NAME_LEN   16
27#define CODEC_LONG_NAME_LEN    32
28#define CODEC_DESCRIPTION_LEN 128
29
30typedef struct s_codec_format {
31        char         short_name[CODEC_SHORT_NAME_LEN];
32        char         long_name[CODEC_LONG_NAME_LEN];
33        char         description[CODEC_DESCRIPTION_LEN];
34        u_char       default_pt;
35        uint16_t      mean_per_packet_state_size;
36        uint16_t      mean_coded_frame_size;
37        const audio_format format;
38} codec_format_t;
39
40typedef struct s_coded_unit {
41        codec_id_t id;
42        u_char  *state;
43        uint16_t  state_len;
44        u_char  *data;
45        uint16_t  data_len;
46} coded_unit;
47
48#define MAX_MEDIA_UNITS  5
49/* This data structure is for storing multiple representations of
50 * coded audio for a given time interval.
51 */
52typedef struct {
53        uint8_t      nrep;
54        coded_unit *rep[MAX_MEDIA_UNITS];
55} media_data;
56
57int  media_data_create    (media_data **m, int nrep);
58void media_data_destroy   (media_data **m, uint32_t md_size);
59int  media_data_dup       (media_data **dst, media_data *src);
60
61int  coded_unit_dup       (coded_unit *dst, coded_unit *src);
62
63void coded_unit_layer_split (coded_unit *in, coded_unit *out, uint8_t layer, uint8_t *layer_markers);
64
65#endif /* _CODEC_TYPES_H_ */
Note: See TracBrowser for help on using the browser.