Use DECLARE_ALIGNED macro instead of gcc __attribute__.
[mplayer/glamo.git] / stream / freesdp / priv.h
blob07d6e3dfb3fa46e584f2aebb4c91fc64de8049ea
1 /*
2 This file is part of FreeSDP
3 Copyright (C) 2001,2002,2003 Federico Montesino Pouzols <fedemp@altern.org>
5 FreeSDP is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 Benjamin Zores, (C) 2006
20 added support in parser for the a=control: lines.
21 added support in parser for the a=range: lines.
24 /**
25 * @file priv.h
27 * @short Common private header for both formatting and parsing modules.
28 **/
30 #ifndef FSDP_PRIV_H
31 #define FSDP_PRIV_H
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
37 #include "common.h"
39 #define NTP_EPOCH_OFFSET 2208988800UL
41 #define FSDP_MAX_LENGTH 2000
43 /* Tags for doxygen documentation */
45 /**
46 * @mainpage FreeSDP Library Reference Manual
47 * @section overview Overview (README)
48 * @verbinclude ../../README
50 **/
52 /**
53 * @example formatdemo.c
55 * A basic SDP descriptions formatter based on FreeSDP.
56 **/
58 /**
59 * @example parsedemo.c
61 * A basic SDP descriptions parser based on FreeSDP.
62 **/
64 /* Private routines declarations */
66 BEGIN_C_DECLS
67 /**
68 * @short bandwidth modifier
70 * Holds type of modifier and value. Also holds the literal bandwidth
71 * modifier if unknown.
72 **/
73 typedef struct
75 fsdp_bw_modifier_type_t b_mod_type;
76 unsigned long int b_value;
77 char *b_unknown_bw_modt;
78 } fsdp_bw_modifier_t;
80 /**
81 * @short a=rtpmap: attribute
83 * Holds payload type, enconding name, RTP clock rate, and encofing
84 * parameters.
85 **/
86 typedef struct
88 char *pt;
89 char *encoding_name;
90 unsigned int clock_rate;
91 char *parameters;
92 } fsdp_rtpmap_t;
94 /**
95 * @short Connection address specification
97 * Holds address (unicast or multicast) as well as TTL and number of
98 * ports, when it is an IP4 multicast address.
99 **/
100 typedef struct fsdp_connection_address_t_s
102 char *address;
103 unsigned int address_ttl;
104 unsigned int address_count;
105 } fsdp_connection_address_t;
108 * @short Struct for each media in a session description.
110 struct fsdp_media_description_t_s
112 /* from `m=<media> <port> <transport> <fmt list>' line */
113 fsdp_media_t media_type;
114 unsigned int port;
115 unsigned int port_count;
116 fsdp_transport_protocol_t transport;
117 char **formats;
118 unsigned int formats_count;
119 /* from i=<media title> */
120 char *i_title;
121 /* from `c=<network type> <address type> <connection address>' line
122 (optional) */
123 fsdp_network_type_t c_network_type;
124 fsdp_address_type_t c_address_type;
125 fsdp_connection_address_t c_address;
126 /* from `b=<modifier>:<bandwidth-value>' lines (optional) */
127 fsdp_bw_modifier_t *bw_modifiers;
128 unsigned int bw_modifiers_count;
129 /* from `k=<method>' or `k=<method>:<encryption key>' line
130 (optional) */
131 fsdp_encryption_method_t k_encryption_method;
132 char *k_encryption_content;
133 /* from `a=<attribute>' or `a=<attribute>:<value>' lines (opt) */
134 unsigned long int a_ptime;
135 unsigned long int a_maxptime;
136 /* rtpmap */
137 fsdp_rtpmap_t **a_rtpmaps;
138 unsigned int a_rtpmaps_count;
139 fsdp_orient_t a_orient;
140 fsdp_sendrecv_mode_t a_sendrecv_mode;
142 char **a_sdplangs;
143 unsigned int a_sdplangs_count;
144 char **a_langs;
145 unsigned int a_langs_count;
147 char **a_controls;
148 unsigned int a_controls_count;
150 char *a_range;
152 float a_framerate;
153 unsigned int a_quality;
154 char **a_fmtps;
155 unsigned int a_fmtps_count;
156 /* rtcp attribute */
157 unsigned int a_rtcp_port;
158 fsdp_network_type_t a_rtcp_network_type;
159 fsdp_address_type_t a_rtcp_address_type;
160 char *a_rtcp_address;
161 /* media attributes that are not directly supported */
162 char **unidentified_attributes;
163 unsigned int unidentified_attributes_count;
166 typedef struct fsdp_media_description_t_s fsdp_media_announcement_t;
169 * @short Information for a repeat (struct for r= lines)
171 typedef struct
173 /* times in seconds */
174 unsigned long int interval;
175 unsigned long int duration;
176 unsigned long int *offsets;
177 unsigned int offsets_count;
178 } fsdp_repeat_t;
181 * @short Information about a time period
183 * The start and stop times as well as the information from the r=
184 * lines for a t= line are stored in this structures.
186 typedef struct
188 time_t start;
189 time_t stop;
190 fsdp_repeat_t **repeats;
191 unsigned int repeats_count;
192 } fsdp_time_period_t;
195 * @short Struct for session descriptions.
197 struct fsdp_description_t_s
199 /* from v=... line */
200 unsigned int version;
201 /* from o=... line */
202 char *o_username;
203 char *o_session_id;
204 char *o_announcement_version;
205 fsdp_network_type_t o_network_type;
206 fsdp_address_type_t o_address_type;
207 char *o_address;
208 /* from s=... line */
209 char *s_name;
210 /* from i=... line (opt) */
211 char *i_information;
212 /* from u=... line (opt) */
213 char *u_uri;
214 /* from e=... lines (0 or more) */
215 const char **emails;
216 unsigned int emails_count;
217 /* from p=... lines (0 or more) */
218 const char **phones;
219 unsigned int phones_count;
220 /* from `c=<network type> <address type> <connection address>' line */
221 fsdp_network_type_t c_network_type;
222 fsdp_address_type_t c_address_type;
223 fsdp_connection_address_t c_address;
224 /* from `b=<modifier>:<bandwidth-value>' lines (optional) */
225 fsdp_bw_modifier_t *bw_modifiers;
226 unsigned int bw_modifiers_count;
227 /* from `t=<start time> <stop time>' lines (1 or more) */
228 /* from `r=<repeat interval> <active duration> <list of offsets from
229 start-time>' */
230 fsdp_time_period_t **time_periods;
231 unsigned int time_periods_count;
232 /* from `z=<adjustment time> <offset> <adjustment time> <offset>
233 ....' lines */
234 char *timezone_adj;
235 /* from `k=<method>' or `k=<method>:<encryption key>' line (opt) */
236 fsdp_encryption_method_t k_encryption_method;
237 char *k_encryption_content;
238 /* from `a=<attribute>' or `a=<attribute>:<value>' lines (opt) */
239 char *a_category;
240 char *a_keywords;
241 char *a_tool;
242 char *a_range;
243 /* rtpmap */
244 fsdp_rtpmap_t **a_rtpmaps;
245 unsigned int a_rtpmaps_count;
246 fsdp_sendrecv_mode_t a_sendrecv_mode;
247 fsdp_session_type_t a_type;
248 char *a_charset;
250 char **a_sdplangs;
251 unsigned int a_sdplangs_count;
252 char **a_langs;
253 unsigned int a_langs_count;
255 char **a_controls;
256 unsigned int a_controls_count;
257 /* from `m=<media> <port>/<number of ports> <transport> <fmt list>'
258 lines [one or more] */
259 fsdp_media_announcement_t **media_announcements;
260 unsigned int media_announcements_count;
261 /* session attributes that are not directly supported */
262 char **unidentified_attributes;
263 unsigned int unidentified_attributes_count;
266 #define MEDIA_RTPMAPS_MAX_COUNT 5
267 #define SDPLANGS_MAX_COUNT 5
268 #define SDPCONTROLS_MAX_COUNT 10
269 #define UNIDENTIFIED_ATTRIBUTES_MAX_COUNT 5
271 END_C_DECLS
272 #endif /* FSDP_PRIV_H */