1 /*
2 * RTP Depacketization of MP4A-LATM, RFC 3016
3 * Copyright (c) 2010 Martin Storsjo
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
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
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
26
32 };
33
35 {
37 }
38
40 {
41 if (!data)
42 return;
47 }
50 }
51
56 {
58
59 if (buf) {
66
70 }
72
79 }
80
84 }
85
86 cur_len = 0;
87 while (data->
pos < data->
len) {
90 if (val != 0xff)
91 break;
92 }
93 if (data->
pos + cur_len > data->
len) {
96 }
97
100 memcpy(pkt->
data, data->
buf + data->
pos, cur_len);
101 data->
pos += cur_len;
103 return data->
pos < data->
len;
104 }
105
107 {
111 int audio_mux_version, same_time_framing, num_programs, num_layers;
112
113 /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
115 if (!config)
119 audio_mux_version =
get_bits(&gb, 1);
120 same_time_framing =
get_bits(&gb, 1);
124 if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 ||
125 num_layers != 0) {
127 audio_mux_version, same_time_framing,
128 num_programs, num_layers);
131 }
136 }
139
143 }
144
147 char *attr,
char *
value)
148 {
149 int res;
150
151 if (!strcmp(attr, "config")) {
153 if (res < 0)
154 return res;
155 } else if (!strcmp(attr, "cpresent")) {
156 int cpresent = atoi(value);
157 if (cpresent != 0)
159 "RTP MP4A-LATM with in-band configuration");
160 }
161
162 return 0;
163 }
164
167 {
168 const char *p;
169
170 if (st_index < 0)
171 return 0;
172
175
176 return 0;
177 }
178
187 };