Mercurial > libavformat.hg
annotate rtp.c @ 3091:b8df4b5e16d0 libavformat
return error if malloc fails
author | bcoudurier |
---|---|
date | Wed, 27 Feb 2008 09:30:56 +0000 |
parents | 0d0ffa1a0478 |
children | 64d885714dff |
rev | line source |
---|---|
0 | 1 /* |
2 * RTP input/output format | |
3 * Copyright (c) 2002 Fabrice Bellard. | |
4 * | |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1332
diff
changeset
|
5 * This file is part of FFmpeg. |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1332
diff
changeset
|
6 * |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1332
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
0 | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1332
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
0 | 11 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1332
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
0 | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Lesser General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Lesser General Public | |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1332
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
896
edbe5c3717f9
Update licensing information: The FSF changed postal address.
diego
parents:
885
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 20 */ |
21 #include "avformat.h" | |
774 | 22 #include "bitstream.h" |
0 | 23 |
24 #include <unistd.h> | |
1754 | 25 #include "network.h" |
0 | 26 |
1419 | 27 #include "rtp_internal.h" |
28 | |
0 | 29 //#define DEBUG |
30 | |
774 | 31 /* from http://www.iana.org/assignments/rtp-parameters last updated 05 January 2005 */ |
2901 | 32 static const struct |
33 { | |
34 int pt; | |
35 const char enc_name[50]; /* XXX: why 50 ? */ | |
36 enum CodecType codec_type; | |
37 enum CodecID codec_id; | |
38 int clock_rate; | |
39 int audio_channels; | |
40 } AVRtpPayloadTypes[]= | |
774 | 41 { |
42 {0, "PCMU", CODEC_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1}, | |
43 {1, "Reserved", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
44 {2, "Reserved", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
45 {3, "GSM", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
46 {4, "G723", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
47 {5, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
48 {6, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1}, | |
49 {7, "LPC", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
50 {8, "PCMA", CODEC_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1}, | |
51 {9, "G722", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
52 {10, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2}, | |
53 {11, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1}, | |
1259 | 54 {12, "QCELP", CODEC_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1}, |
774 | 55 {13, "CN", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
56 {14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP2, 90000, -1}, | |
57 {15, "G728", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
58 {16, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1}, | |
59 {17, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1}, | |
60 {18, "G729", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, | |
61 {19, "reserved", CODEC_TYPE_AUDIO, CODEC_ID_NONE, -1, -1}, | |
62 {20, "unassigned", CODEC_TYPE_AUDIO, CODEC_ID_NONE, -1, -1}, | |
63 {21, "unassigned", CODEC_TYPE_AUDIO, CODEC_ID_NONE, -1, -1}, | |
64 {22, "unassigned", CODEC_TYPE_AUDIO, CODEC_ID_NONE, -1, -1}, | |
65 {23, "unassigned", CODEC_TYPE_AUDIO, CODEC_ID_NONE, -1, -1}, | |
66 {24, "unassigned", CODEC_TYPE_VIDEO, CODEC_ID_NONE, -1, -1}, | |
67 {25, "CelB", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, | |
68 {26, "JPEG", CODEC_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1}, | |
69 {27, "unassigned", CODEC_TYPE_VIDEO, CODEC_ID_NONE, -1, -1}, | |
70 {28, "nv", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, | |
71 {29, "unassigned", CODEC_TYPE_VIDEO, CODEC_ID_NONE, -1, -1}, | |
72 {30, "unassigned", CODEC_TYPE_VIDEO, CODEC_ID_NONE, -1, -1}, | |
73 {31, "H261", CODEC_TYPE_VIDEO, CODEC_ID_H261, 90000, -1}, | |
74 {32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1}, | |
2760 | 75 {32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1}, |
774 | 76 {33, "MP2T", CODEC_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1}, |
77 {34, "H263", CODEC_TYPE_VIDEO, CODEC_ID_H263, 90000, -1}, | |
78 {35, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
79 {36, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
80 {37, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
81 {38, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
82 {39, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
83 {40, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
84 {41, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
85 {42, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
86 {43, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
87 {44, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
88 {45, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
89 {46, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
90 {47, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
91 {48, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
92 {49, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
93 {50, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
94 {51, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
95 {52, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
96 {53, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
97 {54, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
98 {55, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
99 {56, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
100 {57, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
101 {58, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
102 {59, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
103 {60, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
104 {61, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
105 {62, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
106 {63, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
107 {64, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
108 {65, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
109 {66, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
110 {67, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
111 {68, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
112 {69, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
113 {70, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
114 {71, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
115 {72, "reserved for RTCP conflict avoidance", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
116 {73, "reserved for RTCP conflict avoidance", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
117 {74, "reserved for RTCP conflict avoidance", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
118 {75, "reserved for RTCP conflict avoidance", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
119 {76, "reserved for RTCP conflict avoidance", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
120 {77, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
121 {78, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
122 {79, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
123 {80, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
124 {81, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
125 {82, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
126 {83, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
127 {84, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
128 {85, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
129 {86, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
130 {87, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
131 {88, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
132 {89, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
133 {90, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
134 {91, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
135 {92, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
136 {93, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
137 {94, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
138 {95, "unassigned", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
139 {96, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
140 {97, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
141 {98, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
142 {99, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
143 {100, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
144 {101, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
145 {102, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
146 {103, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
147 {104, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
148 {105, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
149 {106, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
150 {107, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
151 {108, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
152 {109, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
153 {110, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
154 {111, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
155 {112, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
156 {113, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
157 {114, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
158 {115, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
159 {116, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
160 {117, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
161 {118, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
162 {119, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
163 {120, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
164 {121, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
165 {122, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
166 {123, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
167 {124, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
168 {125, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
169 {126, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
170 {127, "dynamic", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1}, | |
171 {-1, "", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1} | |
172 }; | |
0 | 173 |
174 int rtp_get_codec_info(AVCodecContext *codec, int payload_type) | |
175 { | |
2759
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
176 int i = 0; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
177 |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
178 for (i = 0; AVRtpPayloadTypes[i].pt >= 0; i++) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
179 if (AVRtpPayloadTypes[i].pt == payload_type) { |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
180 if (AVRtpPayloadTypes[i].codec_id != CODEC_ID_NONE) { |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
181 codec->codec_type = AVRtpPayloadTypes[i].codec_type; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
182 codec->codec_id = AVRtpPayloadTypes[i].codec_id; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
183 if (AVRtpPayloadTypes[i].audio_channels > 0) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
184 codec->channels = AVRtpPayloadTypes[i].audio_channels; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
185 if (AVRtpPayloadTypes[i].clock_rate > 0) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
186 codec->sample_rate = AVRtpPayloadTypes[i].clock_rate; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
187 return 0; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
188 } |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
189 } |
774 | 190 return -1; |
0 | 191 } |
192 | |
193 int rtp_get_payload_type(AVCodecContext *codec) | |
194 { | |
774 | 195 int i, payload_type; |
0 | 196 |
197 /* compute the payload type */ | |
774 | 198 for (payload_type = -1, i = 0; AVRtpPayloadTypes[i].pt >= 0; ++i) |
199 if (AVRtpPayloadTypes[i].codec_id == codec->codec_id) { | |
200 if (codec->codec_id == CODEC_ID_PCM_S16BE) | |
201 if (codec->channels != AVRtpPayloadTypes[i].audio_channels) | |
202 continue; | |
203 payload_type = AVRtpPayloadTypes[i].pt; | |
0 | 204 } |
205 return payload_type; | |
206 } | |
207 | |
2759
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
208 const char *ff_rtp_enc_name(int payload_type) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
209 { |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
210 int i; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
211 |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
212 for (i = 0; AVRtpPayloadTypes[i].pt >= 0; i++) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
213 if (AVRtpPayloadTypes[i].pt == payload_type) { |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
214 return AVRtpPayloadTypes[i].enc_name; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
215 } |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
216 |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
217 return ""; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
218 } |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
219 |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
220 enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
221 { |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
222 int i; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
223 |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
224 for (i = 0; AVRtpPayloadTypes[i].pt >= 0; i++) |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
225 if (!strcmp(buf, AVRtpPayloadTypes[i].enc_name) && (codec_type == AVRtpPayloadTypes[i].codec_type)){ |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
226 return AVRtpPayloadTypes[i].codec_id; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
227 } |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
228 |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
229 return CODEC_ID_NONE; |
b252e318023a
Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP
lucabe
parents:
2706
diff
changeset
|
230 } |