annotate stream/freesdp/parserpriv.h @ 30924:798e4a2b2571

100l, fix frametime calculation for MPEG-2 files with frame rate extension.
author reimar
date Sat, 27 Mar 2010 12:47:26 +0000
parents 0f1b5b68af32
children 08a90b0e44e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18823
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
1 /*
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
2 This file is part of FreeSDP
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
3 Copyright (C) 2001,2002,2003 Federico Montesino Pouzols <fedemp@suidzer0.org>
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
4
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
5 FreeSDP is free software; you can redistribute it and/or modify it
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
6 under the terms of the GNU General Public License as published by
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
7 the Free Software Foundation; either version 2 of the License, or
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
8 (at your option) any later version.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
9
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
13 GNU General Public License for more details.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
14
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
16 along with this program; if not, write to the Free Software
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
18 */
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
19
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
20 /**
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
21 * @file parserpriv.h
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
22 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
23 * @short Private header for parser module.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
24 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
25
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
26 #ifndef FSDP_PARSERPRIV_H
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
27 #define FSDP_PARSERPRIV_H
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
28
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
29 #include "priv.h"
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
30 #include "parser.h"
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
31
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
32 /**
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
33 * Parse a connection (c=<network type> <address type> <connection
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
34 * address>) line. If the textual description in <code>p</code> begins
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
35 * with a connection line, it is parsed. If not, nothing is done.
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 19271
diff changeset
36 *
18823
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
37 * @param p fraction of textual SDP description.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
38 * @param ntype where to store the network type.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
39 * @param atype where to store the address type.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
40 * @param address where to store the connection address as a string.
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 19271
diff changeset
41 *
18823
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
42 * @return parse error code.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
43 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
44 static fsdp_error_t
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
45 fsdp_parse_c (const char **p, fsdp_network_type_t * ntype,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
46 fsdp_address_type_t * atype,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
47 fsdp_connection_address_t * address);
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
48
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
49 /**
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
50 * Parse b (b=<modifier>:<bandwidth-value>) consecutive lines. If the
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
51 * textual description in <code>p</code> begins with a bandwidth line,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
52 * it is parsed as well as all b lines inmediately after it. If not,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
53 * nothing is done.
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 19271
diff changeset
54 *
18823
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
55 * @param p fraction of textual SDP description.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
56 * @param bw_modifiers pointer to empty array of bandwidth modifiers to fill.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
57 * @param bw_modifiers_count where to set the number of bandwidth
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
58 * modifiers successfully parsed.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
59 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
60 * @return parse error code.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
61 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
62 static fsdp_error_t
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
63 fsdp_parse_b (const char **p, fsdp_bw_modifier_t ** bw_modifiers,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
64 unsigned int *bw_modifiers_count);
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
65
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
66 /**
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
67 * Parse a k (k=<method>) or (k=<method>:<encryption key>) line. If
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
68 * the textual description in <code>p</code> begins with an encryption
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
69 * line, it is parsed. If not, nothing is done.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
70 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
71 * @param p fraction of textual SDP description.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
72 * @param method where to store the encryption method.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
73 * @param content where to store the encryption key if provided.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
74 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
75 * @return parse error code.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
76 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
77 static fsdp_error_t
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
78 fsdp_parse_k (const char **p, fsdp_encryption_method_t * method,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
79 char **content);
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
80
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
81
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
82 /**
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
83 * Parses a string whose first token (first characters before the
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
84 * first space or end of string) is supposed to be a time in SDP
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
85 * syntax. Some examples of SDP times are: 2d, 5h, 3444, 7778s,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
86 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
87 * @param time time in SDP syntax as a string.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
88 * @param seconds where to store the value in seconds as an integer.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
89 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
90 * @return parse error code.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
91 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
92 static fsdp_error_t
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
93 fsdp_repeat_time_to_uint (const char *time, unsigned long int *seconds);
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
94
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
95 static fsdp_error_t
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
96 fsdp_parse_rtpmap (fsdp_rtpmap_t *** rtpmap, unsigned int *counter,
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
97 const char *value);
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
98
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 19271
diff changeset
99 /**
18823
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
100 * Maximun default field len for "expected to be short" fields, like
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
101 * username, session_id or inet addresses.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
102 *
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 19271
diff changeset
103 * MDFLENS value must be MAXSHORTFIELDLEN - 1
18823
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
104 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
105 #define MAXSHORTFIELDLEN 96
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
106 #define MSFLENS "95"
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
107
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
108 /**
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
109 * Maximun default field len for "maybe very long" fields, like
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
110 * information, attribute values. This can also be used for lines
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
111 * where there is only a string field, like phone and email.
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
112 *
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
113 * MLFLENS value must be MAXLONGFIELDLEN - 1
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
114 **/
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
115 #define MAXLONGFIELDLEN 1024
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
116 #define MLFLENS "1023"
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
117
ef667dd373e2 new imported library in libmpdemux: freesdp (will be used by native rtsp demuxer)
ben
parents:
diff changeset
118 #endif /* FSDP_PARSERPRIV_H */