90 int ident, fragmented, tdt, num_pkts, pkt_len;
122 fragmented = buf[3] >> 6;
123 tdt = (buf[3] >> 4) & 3;
124 num_pkts = buf[3] & 0xf;
127 if (pkt_len > len - 6) {
129 "Invalid packet length %d in %d byte packet\n", pkt_len,
134 if (ident != data->
ident) {
136 "Unimplemented Xiph SDP configuration change detected\n");
142 "Unimplemented RTP Xiph packet settings (%d,%d,%d)\n",
143 fragmented, tdt, num_pkts);
150 if (fragmented == 0) {
156 memcpy(pkt->
data, buf, pkt_len);
181 }
else if (fragmented == 1) {
205 "Received packet without a start fragment; dropping.\n");
212 if (fragmented == 3) {
217 "Error occurred when getting fragment buffer.");
234 for (; *buf < buf_end; ++*
buf) {
237 if (!(**buf & 0x80)) {
250 const uint8_t * packed_headers_end,
254 unsigned num_packed, num_headers,
length, length1, length2, extradata_alloc;
257 if (packed_headers_end - packed_headers < 9) {
260 packed_headers_end - packed_headers);
264 num_packed = bytestream_get_be32(&packed_headers);
265 xiph_data->
ident = bytestream_get_be24(&packed_headers);
266 length = bytestream_get_be16(&packed_headers);
267 num_headers =
get_base128(&packed_headers, packed_headers_end);
268 length1 =
get_base128(&packed_headers, packed_headers_end);
269 length2 =
get_base128(&packed_headers, packed_headers_end);
271 if (num_packed != 1 || num_headers > 3) {
273 "Unimplemented number of headers: %d packed headers, %d headers\n",
274 num_packed, num_headers);
278 if (packed_headers_end - packed_headers != length ||
279 length1 > length || length2 > length - length1) {
282 length2, packed_headers_end - packed_headers, length);
300 memcpy(ptr, packed_headers, length);
312 char *attr,
char *
value)
317 if (!strcmp(attr,
"sampling")) {
318 if (!strcmp(value,
"YCbCr-4:2:0")) {
320 }
else if (!strcmp(value,
"YCbCr-4:4:2")) {
322 }
else if (!strcmp(value,
"YCbCr-4:4:4")) {
326 "Unsupported pixel format %s\n", attr);
329 }
else if (!strcmp(attr,
"width")) {
332 codec->
width = atoi(value);
334 }
else if (!strcmp(attr,
"height")) {
337 codec->
height = atoi(value);
339 }
else if (!strcmp(attr,
"delivery-method")) {
342 }
else if (!strcmp(attr,
"configuration-uri")) {
347 }
else if (!strcmp(attr,
"configuration")) {
350 uint8_t *decoded_packet = NULL;
352 size_t decoded_alloc = strlen(value) / 4 * 3 + 4;
354 if (decoded_alloc <= INT_MAX) {
355 decoded_packet =
av_malloc(decoded_alloc);
356 if (decoded_packet) {
361 (decoded_packet, decoded_packet + packet_size, codec,
365 "Out of memory while decoding SDP configuration.\n");