[FFmpeg-devel] [PATCH] mp4a-latm rtp output & dynamic payload type from URL
Luca Abeni
lucabe72
Fri Oct 9 14:09:50 CEST 2009
After having a look at RFC3016, I have another question about
LATM in RTP:
Luca Abeni wrote:
[...]
> Finally, one doubt about the code:
> [...]
> +/* latm muxer */
> +void ff_rtp_send_aac_latm(AVFormatContext *s1, const uint8_t *buff, int
> size)
> +{
> + RTPMuxContext *s = s1->priv_data;
> + int len, max_packet_size;
> + uint8_t *p = s->buf;
> + int latmhdrsize;
> +
> + /* skip ADTS header, if present */
> + if ((s1->streams[0]->codec->extradata_size) == 0) {
> + size -= 7;
> + buff += 7;
> + }
> +
> + latmhdrsize = size/0xff + 1;
> + max_packet_size = s->max_payload_size - latmhdrsize;
> + s->timestamp = s->cur_timestamp;
> +
> + while (size > 0) {
> + len = FFMIN(size, max_packet_size);
> + memcpy(p + latmhdrsize, buff, len);
According to the RFC (Section 4.1), it seems that the LATM
stream is directly copied in the packet payload, without
any payload-specific header:
"... The first byte of each audioMuxElement SHALL be
located at the first payload location in an RTP packet..."
(also see Figure 4).
So, what is this "latmhdrsize" about? What am I missing?
Thanks,
Luca
More information about the ffmpeg-devel
mailing list