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.
27 * @short Common private header for both formatting and parsing modules.
39 #define NTP_EPOCH_OFFSET 2208988800UL
41 #define FSDP_MAX_LENGTH 2000
43 /* Tags for doxygen documentation */
46 * @mainpage FreeSDP Library Reference Manual
47 * @section overview Overview (README)
48 * @verbinclude ../../README
53 * @example formatdemo.c
55 * A basic SDP descriptions formatter based on FreeSDP.
59 * @example parsedemo.c
61 * A basic SDP descriptions parser based on FreeSDP.
64 /* Private routines declarations */
68 * @short bandwidth modifier
70 * Holds type of modifier and value. Also holds the literal bandwidth
71 * modifier if unknown.
75 fsdp_bw_modifier_type_t b_mod_type
;
76 unsigned long int b_value
;
77 char *b_unknown_bw_modt
;
81 * @short a=rtpmap: attribute
83 * Holds payload type, enconding name, RTP clock rate, and encofing
90 unsigned int clock_rate
;
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.
100 typedef struct fsdp_connection_address_t_s
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
;
115 unsigned int port_count
;
116 fsdp_transport_protocol_t transport
;
118 unsigned int formats_count
;
119 /* from i=<media title> */
121 /* from `c=<network type> <address type> <connection address>' line
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
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
;
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
;
143 unsigned int a_sdplangs_count
;
145 unsigned int a_langs_count
;
148 unsigned int a_controls_count
;
153 unsigned int a_quality
;
155 unsigned int a_fmtps_count
;
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)
173 /* times in seconds */
174 unsigned long int interval
;
175 unsigned long int duration
;
176 unsigned long int *offsets
;
177 unsigned int offsets_count
;
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.
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 */
204 char *o_announcement_version
;
205 fsdp_network_type_t o_network_type
;
206 fsdp_address_type_t o_address_type
;
208 /* from s=... line */
210 /* from i=... line (opt) */
212 /* from u=... line (opt) */
214 /* from e=... lines (0 or more) */
216 unsigned int emails_count
;
217 /* from p=... lines (0 or more) */
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
230 fsdp_time_period_t
**time_periods
;
231 unsigned int time_periods_count
;
232 /* from `z=<adjustment time> <offset> <adjustment time> <offset>
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) */
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
;
251 unsigned int a_sdplangs_count
;
253 unsigned int a_langs_count
;
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
272 #endif /* FSDP_PRIV_H */