49 #define RTCP_SR_SIZE 28
161 if (frame_size == 0) {
178 switch(st->codec->codec_id) {
181 s->buf_ptr = s->buf + 4;
195 if (st->codec->extradata_size > 4 && st->codec->extradata[0] == 1) {
196 s->nal_length_size = (st->codec->extradata[4] & 0x03) + 1;
201 if (!s->max_frames_per_packet) s->max_frames_per_packet = 15;
202 s->max_frames_per_packet = av_clip(s->max_frames_per_packet, 1, 15);
203 s->max_payload_size -= 6;
212 if (st->codec->channels > 2) {
222 if (st->codec->block_align != 38 && st->codec->block_align != 50) {
226 if (!s->max_frames_per_packet)
227 s->max_frames_per_packet = 1;
228 s->max_frames_per_packet =
FFMIN(s->max_frames_per_packet,
229 s->max_payload_size / st->codec->block_align);
233 if (!s->max_frames_per_packet)
234 s->max_frames_per_packet = 12;
240 if (1 + s->max_frames_per_packet + n > s->max_payload_size) {
244 if (st->codec->channels != 1) {
276 s1->streams[0]->time_base) + s->base_timestamp;
282 avio_wb32(
s1->pb, ((ntp_time % 1000000) << 32) / 1000000);
288 int len =
FFMIN(strlen(s->cname), 255);
298 for (len = (7 + len) % 4; len % 4; len++)
311 av_dlog(s1,
"rtp_send_data size=%d\n", len);
323 s->
seq = (s->
seq + 1) & 0xffff;
331 const uint8_t *buf1,
int size,
int sample_size_bits)
334 int len, max_packet_size, n;
336 int aligned_samples_size = sample_size_bits/
av_gcd(sample_size_bits, 8);
338 max_packet_size = (s->
max_payload_size / aligned_samples_size) * aligned_samples_size;
340 if ((sample_size_bits % 8) == 0 && ((8 *
size) % sample_size_bits) != 0)
345 len =
FFMIN(max_packet_size, size);
363 int len, count, max_packet_size;
369 if ((len + size) > max_packet_size) {
380 if (size > max_packet_size) {
384 len = max_packet_size - 4;
390 s->
buf[2] = count >> 8;
392 memcpy(s->
buf + 4, buf1, len);
406 memcpy(s->
buf_ptr, buf1, size);
415 int len, max_packet_size;
420 len = max_packet_size;
439 while (size >= TS_PACKET_SIZE) {
471 memcpy(s->
buf_ptr, buf, n * frame_size);
552 int mb_info_size = 0;
579 "Packet size %d too large for max RTP payload size %d\n",
610 .priv_class = &rtp_muxer_class,