Commit Graph

6 Commits

Author SHA1 Message Date
Martin Storsjö 4f6cd883f0 rtpenc: Don't set max_frames_per_packet based on the packet frame size or frame rate
Instead check the timestamps while muxing, to avoid buffering a
too long timestamp range into one single packet.

This makes the AMR and AAC packetization slightly less efficient,
since we set a possibly unnecessarily high max_frames_per_packet.
(These packetizers end up doing a memmove of the TOC bytes if
sending a packet before max_frames_per_packet is achieved, and
we end up setting max_frames_per_packet to a value that should
be high enough for most uses.)

All packetizers that use max_frames_per_packet now set it either
to a default value, or to a value calculated based on other
parameters, so none of them rely on the previous default setting.

For iLBC, copy one frame at a time, to allow checking the timestamp
range for each of them - basically doing potentially multiple
loops to simplify the code instead of trying to calculate the
number of frames to buffer while honoring s1->max_delay.

This is in preparation for reducing the coupling between libavformat
and libavcodec, by not having the muxers use the encoder field
frame_size (which may not be available during e.g. stream copy).

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-28 22:54:31 +02:00
Martin Storsjö bde2bba45c rtpenc: Restructure if statements in packetizers to simplify adding more conditions
Factorize out the s->num_frames check at the start of the if statements,
simplifying adding more alternative causes for sending the buffered
frames.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-28 22:54:26 +02:00
Martin Storsjö 12b3459979 rtpenc_amr: Use s->num_frames instead of s->buf_ptr - s->buf
This doesn't fix any bug, but makes the code simpler for later
patches, and more straightforward to read as is.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-28 22:53:42 +02:00
Alex Converse 7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Luca Abeni 22c1f65fa6 Rename the RTP muxer sources so that the packetisation functions are in
rtpenc_*.c files.

Originally committed as revision 21284 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-18 13:44:12 +00:00