From 2386cfc1ae2982101bee6024300c0af3113c4fd8 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 7 Oct 2017 20:47:10 +0200 Subject: lavf/rtpenc: Add support for little-endian G.726. --- Changelog | 1 + libavformat/rtpenc.c | 2 ++ libavformat/sdp.c | 8 ++++++++ libavformat/version.h | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 03686acef6..d6ec4ad1b5 100644 --- a/Changelog +++ b/Changelog @@ -52,6 +52,7 @@ version : - V4L2 mem2mem HW assisted codecs - Rockchip MPP hardware decoding - vmafmotion video filter +- use MIME type "G726" for little-endian G.726, "AAL2-G726" for big-endian G.726 version 3.3: diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index af631a883a..573593fa66 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -78,6 +78,7 @@ static int is_supported(enum AVCodecID id) case AV_CODEC_ID_VP9: case AV_CODEC_ID_ADPCM_G722: case AV_CODEC_ID_ADPCM_G726: + case AV_CODEC_ID_ADPCM_G726LE: case AV_CODEC_ID_ILBC: case AV_CODEC_ID_MJPEG: case AV_CODEC_ID_SPEEX: @@ -550,6 +551,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) * clock. */ return rtp_send_samples(s1, pkt->data, size, 8 * st->codecpar->channels); case AV_CODEC_ID_ADPCM_G726: + case AV_CODEC_ID_ADPCM_G726LE: return rtp_send_samples(s1, pkt->data, size, st->codecpar->bits_per_coded_sample * st->codecpar->channels); case AV_CODEC_ID_MP2: diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 1f1c28e378..0242ca379c 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -680,6 +680,14 @@ static char *sdp_write_media_attributes(char *buff, int size, AVStream *st, int p->sample_rate); break; } + case AV_CODEC_ID_ADPCM_G726LE: { + if (payload_type >= RTP_PT_PRIVATE) + av_strlcatf(buff, size, "a=rtpmap:%d G726-%d/%d\r\n", + payload_type, + p->bits_per_coded_sample*8, + p->sample_rate); + break; + } case AV_CODEC_ID_ILBC: av_strlcatf(buff, size, "a=rtpmap:%d iLBC/%d\r\n" "a=fmtp:%d mode=%d\r\n", diff --git a/libavformat/version.h b/libavformat/version.h index b5ad2101e0..caf85e8538 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -33,7 +33,7 @@ // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 57 #define LIBAVFORMAT_VERSION_MINOR 82 -#define LIBAVFORMAT_VERSION_MICRO 103 +#define LIBAVFORMAT_VERSION_MICRO 104 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ -- cgit v1.2.3