From patchwork Sat Aug 26 09:55:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 4846 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp915775jao; Sat, 26 Aug 2017 02:55:31 -0700 (PDT) X-Received: by 10.223.164.197 with SMTP id h5mr799157wrb.38.1503741331556; Sat, 26 Aug 2017 02:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503741331; cv=none; d=google.com; s=arc-20160816; b=Q+qvr/mO/zFSfADcdIV6SmS+zuJd4pwzwh7NFweYwNjTZjK33IMD/y+cbT/LA9EJLL 048noJm7NHlYG4q7KaQqpz3CZ5PVtGWLurE9He4x8WuTIQIiS3rxB08s0Sv/DxgoiMoD bX5suBTkywHnrpKgUpdB8njg5R44ACuwnwxFveeUHcvLFn6yRe/qzPgSjJKCs79aFEqV 9BIhkvlYQCwJhPWhb+xhq2o6KCmWUxI2kxX6kFdzI394WLoH2adZbch3oBjefyLiweU6 vNr2Le1BcuVGURziEiCUbay5JJy5tt9FXyhlA48iyufwFfCUDD4lCaNN+wZLM2dzO7WN j8pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=ekVisszcAIFQINUmNtJgybCLa6ljgHm3LGkyzuQntAU=; b=fgYrfM4qC1O6atCqgGFtP4LRTUOlbnbzrz18RthGOfz05/7eE4Y7jO56JoAM9IbXng Cm+0ztq38tqcPGSUE3zYzyq3ivnsPW+ggHo+L//Ow+X7+0L5UJlL4AnE/6zIAbfEk8W/ m2J2ZryfRVjmusff6s8e+f42pc+IbgZRGdHbfyBNvsHFaJFqagRB1phGzcvq0L5xzDiS NEMXCkiGI/FWwl34Tyx5EtkiPpT9s0f/pB2AieG7iEkIOIf4Tn0swdPc8TdNhLu5OHPl 8qF+fdTvlLjXDv64nlmPYxuD68fCggRac/XBRDZzoHfw08505RrqmQ4njacW//ixr3Wz AY0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=SBzpbx/b; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y5si2731241wmy.143.2017.08.26.02.55.30; Sat, 26 Aug 2017 02:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=SBzpbx/b; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 17229689B64; Sat, 26 Aug 2017 12:55:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 216166805E8 for ; Sat, 26 Aug 2017 12:55:12 +0300 (EEST) Received: by mail-wm0-f42.google.com with SMTP id b79so5943146wmb.1 for ; Sat, 26 Aug 2017 02:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=N0IBqRKlqvP4gB+qGRp+ZzSJVuPXkxcTYUkHppgm9wc=; b=SBzpbx/bk+VqBm7aOAFMaJ46DCKYZFPjRuFL6L+QUneT8sazieDnNTWNODMGQRLdaK Qqb5jeZUJfetYhtq7HVGOyIvo7+WFOSgHlc3itspXP0IQu00zWdgCVCfyzJhnSYMAmkx lKsxqTSfbW8X33tPMI+J8cqUQdMW3zOFEd2yv9tbGT23X4DQ3rAHeyYQVRWdm3ZRz+uY nHnG1t1wj9QSkxBMV1tJD1OmjM5VXz6hJpGS2BK5Eu8GVLYnH7D1Bz5IIhKEOtl/ztLS gxUoQv+yoOU2EDyY0OxLxukorX/znCjKp+YIbI2uAO5cpMljvFmvrJSMDfGYXPyKsUyv qrAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=N0IBqRKlqvP4gB+qGRp+ZzSJVuPXkxcTYUkHppgm9wc=; b=jv+oUWfo88VTuRL/7fB6pqBgkZlUh/S0amr/4RmciHtzpV456fPUdHNkVRvbTUHlyr S+cNf3PRtRwxTPvEM+XEWkdiKyUMfvpeRxdHpHJGNKG59ePOv5xJ4io/WWAOLyihzSSF v4Dvh/spio+3ogDlWUkqG8SpkRxKp+9TzJS3Cv+dVxmwFHIGvXjC1Uy4vHZ561tynb6i MXvTyFwvpvCVh3Qt2daQbhp6aBWrGHOXXCEi03J9VOweDNOYTY4Y3rqP2B7HWa8MN9kb lMRrXP85VxABTUsAwnOBvJe+9HBps0aeGrGv+funf2/S2odUbQO8LFPcw6TWBu8CedZy 9epA== X-Gm-Message-State: AHYfb5joB2CWxQyz5mg0VfU3+Q+4oTQP33e/enUbvpQHpt+427EvRWyr 2FwIoCa5VUEtJNAfVXWAA+iAFxibjw== X-Received: by 10.80.175.133 with SMTP id h5mr1191281edd.179.1503741320680; Sat, 26 Aug 2017 02:55:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.132.6 with HTTP; Sat, 26 Aug 2017 02:55:00 -0700 (PDT) From: Carl Eugen Hoyos Date: Sat, 26 Aug 2017 11:55:00 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavf/rtpenc: Add support for little-endian G.726 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patch adds little-endian G.726 support to rtpenc, using the MIME-type suggested by RFC 3551. Please comment, Carl Eugen From 5834684eb2692fbc10f9e70ced66cedab661a828 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos 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