66 int ident, fragmented, tdt, num_pkts, pkt_len;
98 fragmented = buf[3] >> 6;
99 tdt = (buf[3] >> 4) & 3;
100 num_pkts = buf[3] & 0xf;
103 if (pkt_len > len - 6) {
105 "Invalid packet length %d in %d byte packet\n", pkt_len,
110 if (ident != data->
ident) {
112 "Unimplemented Xiph SDP configuration change detected\n");
118 "Unimplemented RTP Xiph packet settings (%d,%d,%d)\n",
119 fragmented, tdt, num_pkts);
126 if (fragmented == 0) {
132 memcpy(pkt->
data, buf, pkt_len);
157 }
else if (fragmented == 1) {
181 "Received packet without a start fragment; dropping.\n");
188 if (fragmented == 3) {
193 "Error occurred when getting fragment buffer.");
210 for (; *buf < buf_end; ++*
buf) {
213 if (!(**buf & 0x80)) {
226 const uint8_t * packed_headers_end,
230 unsigned num_packed, num_headers,
length, length1, length2, extradata_alloc;
233 if (packed_headers_end - packed_headers < 9) {
236 packed_headers_end - packed_headers);
240 num_packed = bytestream_get_be32(&packed_headers);
241 xiph_data->
ident = bytestream_get_be24(&packed_headers);
242 length = bytestream_get_be16(&packed_headers);
243 num_headers =
get_base128(&packed_headers, packed_headers_end);
244 length1 =
get_base128(&packed_headers, packed_headers_end);
245 length2 =
get_base128(&packed_headers, packed_headers_end);
247 if (num_packed != 1 || num_headers > 3) {
249 "Unimplemented number of headers: %d packed headers, %d headers\n",
250 num_packed, num_headers);
254 if (packed_headers_end - packed_headers != length ||
255 length1 > length || length2 > length - length1) {
258 length2, packed_headers_end - packed_headers, length);
276 memcpy(ptr, packed_headers, length);
288 const char *attr,
const char *
value)
293 if (!strcmp(attr,
"sampling")) {
294 if (!strcmp(value,
"YCbCr-4:2:0")) {
296 }
else if (!strcmp(value,
"YCbCr-4:4:2")) {
298 }
else if (!strcmp(value,
"YCbCr-4:4:4")) {
302 "Unsupported pixel format %s\n", attr);
305 }
else if (!strcmp(attr,
"width")) {
308 codec->
width = atoi(value);
310 }
else if (!strcmp(attr,
"height")) {
313 codec->
height = atoi(value);
315 }
else if (!strcmp(attr,
"delivery-method")) {
318 }
else if (!strcmp(attr,
"configuration-uri")) {
323 }
else if (!strcmp(attr,
"configuration")) {
328 size_t decoded_alloc = strlen(value) / 4 * 3 + 4;
330 if (decoded_alloc <= INT_MAX) {
331 decoded_packet =
av_malloc(decoded_alloc);
332 if (decoded_packet) {
337 (decoded_packet, decoded_packet + packet_size, codec,
341 "Out of memory while decoding SDP configuration.\n");