From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4984142E20 for ; Thu, 13 Jan 2022 02:22:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6447D68B3BB; Thu, 13 Jan 2022 03:58:54 +0200 (EET) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B190368B394 for ; Thu, 13 Jan 2022 03:58:50 +0200 (EET) Received: by mail-qv1-f52.google.com with SMTP id p12so5093978qvj.6 for ; Wed, 12 Jan 2022 17:58:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=cFsRBPtahaDuO+LWEXqlMraDltXYXWfxNrqWOOcXl4g=; b=fsdDdbva/vOJB74NAHC03EjvggmXAp/QXFilZcgubIqejIiTbzy8e+7nSijCE4yhiF Aw3u2OrLQ+njKJPIQY3Rot1YZQYPPGdtKDrRiCYnn/jEXue7Bt4ThKyp6hGK5AX9Utqz uvxAfTfO+jFSAj4mUlXO8SB0bGcyCoxQqYhHgVAJEFeCSln2+xQ8CJGuTFNtdjZ3k+Nv 8S3vats0XNhfwls+Veyasc+w+IbAIK+pl+IfJYm34iist7T1VPzgH5Xyn68SVnmii59Y qyOpHhqbITpYt8lsi/aSS9clu38TeNSgFv/37DctjdTp9PNnzPCI+jXfDZo5jb8N6pc1 Sftg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cFsRBPtahaDuO+LWEXqlMraDltXYXWfxNrqWOOcXl4g=; b=PWTKaJpERMIpL4pWurapZJy+yX43LmDDP0+Y0viQU1bb67bLtwIJwvw2CjqW2i88l6 mN6SKBMYuHVhneFERK+EJwJgwJaBWNq1PwXojCB0yVwNtqOlSB2WI7AfaELm0wa/h+YU DY1JvfjkmuLXghNSZrYQHxzjKvEmv9UGKvegspHlX3/JeTcbsmZ2fNN2YhyfSGSVvYKD ibhsQ+fY10diV0gV+HsuBvCmF7k/4DhCurKNp8SxDLRu8nFiiNioV7smD35jWjyXgjoJ Ux2yV+Dj6Q103X9+mZXl/E7lXjK8bLlYoqwu88JHng+IPTi1pdrTCE7U6qBFaNoVdrWh A0dQ== X-Gm-Message-State: AOAM532Rf/M2/A+lH5YnFTMxAbImKRwUZohpQvsXxEq1U4N9ER5Fbx7a yPYaSZfdjII1NEXewp7UPQcQ/ioNwE8= X-Google-Smtp-Source: ABdhPJzHpRj5Bip9qlywKUdZkgY8OMJYK3NNPrer3lPBuu8Nvoaq2L5MIvkDUV1TK3V/+88mRY9Khw== X-Received: by 2002:ad4:5dc6:: with SMTP id m6mr2089175qvh.1.1642039129237; Wed, 12 Jan 2022 17:58:49 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id u19sm893081qke.1.2022.01.12.17.58.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:58:48 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:57:55 -0300 Message-Id: <20220113015806.519-20-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113015101.4-1-jamrial@gmail.com> References: <20220113015101.4-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 138/281] sdp: convert to new channel layout API X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: Anton Khirnov Signed-off-by: James Almer --- libavformat/sdp.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libavformat/sdp.c b/libavformat/sdp.c index d63a0b34c4..0802b99af7 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -450,16 +450,16 @@ static int latm_context2profilelevel(const AVCodecParameters *par) * Different Object Types should implement different Profile Levels */ if (par->sample_rate <= 24000) { - if (par->channels <= 2) + if (par->ch_layout.nb_channels <= 2) profile_level = 0x28; // AAC Profile, Level 1 } else if (par->sample_rate <= 48000) { - if (par->channels <= 2) { + if (par->ch_layout.nb_channels <= 2) { profile_level = 0x29; // AAC Profile, Level 2 - } else if (par->channels <= 5) { + } else if (par->ch_layout.nb_channels <= 5) { profile_level = 0x2A; // AAC Profile, Level 4 } } else if (par->sample_rate <= 96000) { - if (par->channels <= 5) { + if (par->ch_layout.nb_channels <= 5) { profile_level = 0x2B; // AAC Profile, Level 5 } } @@ -491,7 +491,7 @@ static int latm_context2config(AVFormatContext *s, const AVCodecParameters *par, config_byte[0] = 0x40; config_byte[1] = 0; config_byte[2] = 0x20 | rate_index; - config_byte[3] = par->channels << 4; + config_byte[3] = par->ch_layout.nb_channels << 4; config_byte[4] = 0x3f; config_byte[5] = 0xc0; @@ -591,7 +591,7 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st, return ret; av_strlcatf(buff, size, "a=rtpmap:%d MP4A-LATM/%d/%d\r\n" "a=fmtp:%d profile-level-id=%d;cpresent=0;config=%s\r\n", - payload_type, p->sample_rate, p->channels, + payload_type, p->sample_rate, p->ch_layout.nb_channels, payload_type, latm_context2profilelevel(p), config); } else { if (p->extradata_size) { @@ -609,7 +609,7 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st, "a=fmtp:%d profile-level-id=1;" "mode=AAC-hbr;sizelength=13;indexlength=3;" "indexdeltalength=3%s\r\n", - payload_type, p->sample_rate, p->channels, + payload_type, p->sample_rate, p->ch_layout.nb_channels, payload_type, config); } break; @@ -617,36 +617,36 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st, if (payload_type >= RTP_PT_PRIVATE) av_strlcatf(buff, size, "a=rtpmap:%d L16/%d/%d\r\n", payload_type, - p->sample_rate, p->channels); + p->sample_rate, p->ch_layout.nb_channels); break; case AV_CODEC_ID_PCM_S24BE: if (payload_type >= RTP_PT_PRIVATE) av_strlcatf(buff, size, "a=rtpmap:%d L24/%d/%d\r\n", payload_type, - p->sample_rate, p->channels); + p->sample_rate, p->ch_layout.nb_channels); break; case AV_CODEC_ID_PCM_MULAW: if (payload_type >= RTP_PT_PRIVATE) av_strlcatf(buff, size, "a=rtpmap:%d PCMU/%d/%d\r\n", payload_type, - p->sample_rate, p->channels); + p->sample_rate, p->ch_layout.nb_channels); break; case AV_CODEC_ID_PCM_ALAW: if (payload_type >= RTP_PT_PRIVATE) av_strlcatf(buff, size, "a=rtpmap:%d PCMA/%d/%d\r\n", payload_type, - p->sample_rate, p->channels); + p->sample_rate, p->ch_layout.nb_channels); break; case AV_CODEC_ID_AMR_NB: av_strlcatf(buff, size, "a=rtpmap:%d AMR/%d/%d\r\n" "a=fmtp:%d octet-align=1\r\n", - payload_type, p->sample_rate, p->channels, + payload_type, p->sample_rate, p->ch_layout.nb_channels, payload_type); break; case AV_CODEC_ID_AMR_WB: av_strlcatf(buff, size, "a=rtpmap:%d AMR-WB/%d/%d\r\n" "a=fmtp:%d octet-align=1\r\n", - payload_type, p->sample_rate, p->channels, + payload_type, p->sample_rate, p->ch_layout.nb_channels, payload_type); break; case AV_CODEC_ID_VORBIS: @@ -661,7 +661,7 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st, av_strlcatf(buff, size, "a=rtpmap:%d vorbis/%d/%d\r\n" "a=fmtp:%d configuration=%s\r\n", - payload_type, p->sample_rate, p->channels, + payload_type, p->sample_rate, p->ch_layout.nb_channels, payload_type, config); break; case AV_CODEC_ID_THEORA: { @@ -754,7 +754,7 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st, if (payload_type >= RTP_PT_PRIVATE) av_strlcatf(buff, size, "a=rtpmap:%d G722/%d/%d\r\n", payload_type, - 8000, p->channels); + 8000, p->ch_layout.nb_channels); break; case AV_CODEC_ID_ADPCM_G726: { if (payload_type >= RTP_PT_PRIVATE) @@ -791,7 +791,7 @@ static int sdp_write_media_attributes(char *buff, int size, const AVStream *st, receivers MUST be able to receive and process stereo packets. */ av_strlcatf(buff, size, "a=rtpmap:%d opus/48000/2\r\n", payload_type); - if (p->channels == 2) { + if (p->ch_layout.nb_channels == 2) { av_strlcatf(buff, size, "a=fmtp:%d sprop-stereo=1\r\n", payload_type); } -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".