diff options
author | Juan Carlos Rodriguez <ing.juancarlosrodriguez@hotmail.com> | 2011-05-18 15:00:03 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-06-10 10:49:20 +0300 |
commit | 0832122880fa50e66dfd62eb6aa5c814f83f68d9 (patch) | |
tree | d6584051af4edd2d15edd1c99a0524abc5aa67a3 /libavformat/rtpenc.c | |
parent | cb7c11cc9e7e05c819fff487a3f486f11ab4b860 (diff) | |
download | ffmpeg-0832122880fa50e66dfd62eb6aa5c814f83f68d9.tar.gz |
rtpenc: MP4A-LATM payload support
This is enabled with an AVOption on the RTP muxer. The SDP
generator looks for a latm flag in the rtpflags field.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r-- | libavformat/rtpenc.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 7cedff382e..c264b30a07 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -23,11 +23,25 @@ #include "mpegts.h" #include "internal.h" #include "libavutil/random_seed.h" +#include "libavutil/opt.h" #include "rtpenc.h" //#define DEBUG +static const AVOption options[] = { + { "rtpflags", "RTP muxer flags", offsetof(RTPMuxContext, flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, + { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, FF_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, + { NULL }, +}; + +static const AVClass rtp_muxer_class = { + .class_name = "RTP muxer", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + #define RTCP_SR_SIZE 28 static int is_supported(enum CodecID id) @@ -404,7 +418,10 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) ff_rtp_send_mpegvideo(s1, pkt->data, size); break; case CODEC_ID_AAC: - ff_rtp_send_aac(s1, pkt->data, size); + if (s->flags & FF_RTP_FLAG_MP4A_LATM) + ff_rtp_send_latm(s1, pkt->data, size); + else + ff_rtp_send_aac(s1, pkt->data, size); break; case CODEC_ID_AMR_NB: case CODEC_ID_AMR_WB: @@ -455,4 +472,5 @@ AVOutputFormat ff_rtp_muxer = { rtp_write_header, rtp_write_packet, rtp_write_trailer, + .priv_class = &rtp_muxer_class, }; |