diff mbox

[FFmpeg-devel] lavf/rtpenc: Add support for little-endian G.726

Message ID CAB0OVGp+SQ264cojfA2O+-BvK+ZWEuuqgJK3EBJQc3XQkf3rRQ@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Aug. 26, 2017, 9:55 a.m. UTC
Hi!

Attached patch adds little-endian G.726 support to rtpenc, using the
MIME-type suggested by RFC 3551.

Please comment, Carl Eugen

Comments

Carl Eugen Hoyos Oct. 7, 2017, 1:47 a.m. UTC | #1
2017-08-26 11:55 GMT+02:00 Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> Hi!
>
> Attached patch adds little-endian G.726 support to rtpenc, using the
> MIME-type suggested by RFC 3551.

Anybody?

Thank you, Carl Eugen
Michael Niedermayer Oct. 7, 2017, 3:20 p.m. UTC | #2
On Sat, Aug 26, 2017 at 11:55:00AM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch adds little-endian G.726 support to rtpenc, using the
> MIME-type suggested by RFC 3551.
> 
> Please comment, Carl Eugen

>  rtpenc.c |    2 ++
>  sdp.c    |    8 ++++++++
>  2 files changed, 10 insertions(+)
> 78e9d392d1aa04b837fd97c6f8a08254039f7d5e  0002-lavf-rtpenc-Add-support-for-little-endian-G.726.patch
> From 5834684eb2692fbc10f9e70ced66cedab661a828 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Sat, 26 Aug 2017 11:49:46 +0200
> Subject: [PATCH 2/2] lavf/rtpenc: Add support for little-endian G.726.

if thats what the rfc says then its oviously ok

thx

[...]
Carl Eugen Hoyos Oct. 7, 2017, 6:51 p.m. UTC | #3
2017-10-07 17:20 GMT+02:00 Michael Niedermayer <michael@niedermayer.cc>:
> On Sat, Aug 26, 2017 at 11:55:00AM +0200, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch adds little-endian G.726 support to rtpenc, using the
>> MIME-type suggested by RFC 3551.
>>
>> Please comment, Carl Eugen
>
>>  rtpenc.c |    2 ++
>>  sdp.c    |    8 ++++++++
>>  2 files changed, 10 insertions(+)
>> 78e9d392d1aa04b837fd97c6f8a08254039f7d5e  0002-lavf-rtpenc-Add-support-for-little-endian-G.726.patch
>> From 5834684eb2692fbc10f9e70ced66cedab661a828 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Sat, 26 Aug 2017 11:49:46 +0200
>> Subject: [PATCH 2/2] lavf/rtpenc: Add support for little-endian G.726.
>
> if thats what the rfc says then its oviously ok

Patch applied with version bump and Changelog entry.

Thank you, Carl Eugen
diff mbox

Patch

From 5834684eb2692fbc10f9e70ced66cedab661a828 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sat, 26 Aug 2017 11:49:46 +0200
Subject: [PATCH 2/2] lavf/rtpenc: Add support for little-endian G.726.

---
 libavformat/rtpenc.c |    2 ++
 libavformat/sdp.c    |    8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index af631a8..573593f 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 7751e67..935b5a1 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",
-- 
1.7.10.4