From patchwork Mon Feb 12 21:15:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 46223 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp921652pzc; Mon, 12 Feb 2024 13:16:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX/3+CpWbfbKfmcHHwLTdvxhskOvE5RcUvAimIGCzbelKp2r78xe4u0WFriz5EMw3e+SzIMF1v68/pbcwjQSB+UdUjDsodNQmBsoA== X-Google-Smtp-Source: AGHT+IHxaecea/nXG2SoSZPzvrXls8zjgjPxhV3N8x4MYgiU2g+QVk3/WXveH54PmkENFOSFAJdb X-Received: by 2002:a17:906:f208:b0:a38:6bf1:e4a3 with SMTP id gt8-20020a170906f20800b00a386bf1e4a3mr5366291ejb.64.1707772564268; Mon, 12 Feb 2024 13:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707772564; cv=none; d=google.com; s=arc-20160816; b=R4nQRYziI6abcSpeW2Br1g0yM7z9kWDlzzMQj1HZJ+siuTjKgsjLPYEhRL4RF8sc4n wN9gK4jZ1+GZCNFH+G2d3WdXc/U14PijA0Szr0PHO+6Jxa6n4caa7bAPb0RX70s0uLak p20F3GjM0g3XOSYbdzNP7csk1UiUZHBtCP5Us+MZgS0+fRX8Ek7PYYdn+mexWkfgMQ7O FUByiKj8a2pb9nDjJIyEYuVhE7Jpk8d2OsSXtJON0UM3AUHaqm1CAyerZyRyAPiyLdyh Q5FTZ9El+7WEEuSjC4e042VhVV5mNjOApWVN+VwF67lChX7C11O01wBUtwVuXYsWtK10 UJiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=mY7QvmuLcBehlYUDQ8Aycr+OJjXU1Du/TFhem0b1lE0=; fh=lD5tkCy+vCtY+9MpQ6KWCh3Y9DnO+he+763XUfQ1q9A=; b=0IHkNBVNLNor47f/LJEgEwI5UjU4r59alW80X/QgLeOzzhabhnG/WfwfvODUaeMnnK wBFYrA0qfRqsrLeYQCj6mo8Rue2MtlBQi2rbgugBj7YjrjN7xb9b9Lhaf+oIJnmJ/mgh 6StMMIAUJR5BDtGhg6z08prmkHNAYkcfh/4xdBIk/yAj4lURcVr9HOjc/tZ0LYRYizBC gKt4VNwPwAg7QYkA0NpdKmx10C8WhGipBx64VWC0f0PTFNey1V6f6rHWRjKABT9sDhBM YC5iyIInCRm3HPphI3Hu0rGcZsesQohYoSphjZY4/R50HHTRL1nKVwubJMqNPrgPzc0c hj0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 X-Forwarded-Encrypted: i=1; AJvYcCUFVVWdvwxCrTc4mPNhCl4Kbc19ucJf+mbz6QFO6EXdZ6dU3fWvMr0nsaIuxKNQGh//mP9gP6XNYFH+ncf2ratcm1uVtIl8ExYbxgjkAfV4gEXTRRoNowrWAIqu8etiT5Wf87/yN+MenQluvIPzZvMb00TA7+QspH0sVYxXxvfTSrHjx1koRFhz8W9hxxeO102BX9gn/b/aI0xjRvGC3V8apTDrxj9TAtP1UOZUIgJdVLDbTPbizGUf2bZC4R/pxj/HmItAU1PF+iF0ICHdaiZrtekKH31Ehmg6lr5lFCxSakR2e7oaXfvNEovUIElVKHddiMZjQVMIXLcyC45CHLnzHoS53DpKfkqIwEaW7Zd9HzOAg5Fuxij9qttE9hDw2k8DapUsSMo/xJgUY4oASR5CCEhzlVghVDUlguQ5IqApbQCvkK5lgUdvLumNU4kHPJ/kPL2/SKrYWaUhs7QI1vGUxVRqa32bW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z6btvhKtd86MWSSpTKBJ9RXaYCD+lg== Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kt21-20020a170906aad500b00a36695e60a0si544764ejb.640.2024.02.12.13.16.03; Mon, 12 Feb 2024 13:16:04 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DB37568D0CF; Mon, 12 Feb 2024 23:15:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9540968CD3F for ; Mon, 12 Feb 2024 23:15:53 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 880EBE9F59; Mon, 12 Feb 2024 22:15:52 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RsOJpMMv2wsE; Mon, 12 Feb 2024 22:15:50 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 4048BE9F3A; Mon, 12 Feb 2024 22:15:50 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Feb 2024 22:15:33 +0100 Message-Id: <20240212211537.18468-1-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avutil/channel_layout: change AV_CHAN_SILENCE to AV_CHAN_UNUSED in the docs 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: fwuQLGhZOAXZ It got renamed during the API design phase. Signed-off-by: Marton Balint --- libavutil/channel_layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h index 7ee5333ea8..b8bff6f365 100644 --- a/libavutil/channel_layout.h +++ b/libavutil/channel_layout.h @@ -119,7 +119,7 @@ enum AVChannelOrder { /** * The channel order does not correspond to any other predefined order and * is stored as an explicit map. For example, this could be used to support - * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_SILENCE) + * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_UNUSED) * channels at arbitrary positions. */ AV_CHANNEL_ORDER_CUSTOM, From patchwork Mon Feb 12 21:15:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 46224 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp921726pzc; Mon, 12 Feb 2024 13:16:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV89kF9RejGwflfMkzmbr2Xu+txxUeLc8tyxQO8v07pEhYXK8ZD6Z5YpLHG4l05oUpxPdCEqgQlG+0STTUafLf7ZlFeGcA8oPr2TA== X-Google-Smtp-Source: AGHT+IEC+rlQTgVs8gpQtB4og1HaIiLCEnOlamwmWyvK08NrbticToK44tQv8IRKVCtKSdqWso6X X-Received: by 2002:aa7:c748:0:b0:55f:ffb2:75ca with SMTP id c8-20020aa7c748000000b0055fffb275camr4883222eds.18.1707772573601; Mon, 12 Feb 2024 13:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707772573; cv=none; d=google.com; s=arc-20160816; b=qcW5Ms5G/kkafBqCRY26AAhGOqLtYNxYEmyxC7CQtD3QN8YBdFtrmOxaNxwS92OyGL nsNcSH0Fe2vbtJ8cKPvCBbtMag4x+BNSCwrv+2VTG8CLMTKyvM/7GaxYUKXJh9L0eA78 aEknM65tCYMLZlpkBah1kIkv9Krq2AQEgnnb6nmPM8ij7FYdlRb8sobk9TCF4GVHIeJY tKogvtbUfMm0GuLvNXdFAApdIHlHF8sR+zXSgz6HTdcQm8NlbKm/3pQwjUM9UEbnbRhP RvpJAPjxG0VCKoXuPqAEqPaYQs5YS02PUmEsj27L0+rSyt9TGqP5E5WXhVFuTUG1Ll5q zJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=breq8meStSf09y9WyxFVLjAWmX7tuhFlF6bR+OCf6ic=; fh=HnLyzDkUfA88chiegnWS6iEGfTOo4EQmZgOc56FtJvs=; b=AEdxJ/U7gmHxV9YhokLy9xPsKMjUdVirKVlrOks04pgpXzeFu0Lklka061VSvClYmT Ywst19CwOHIQ5kV1xEFLCOZUT872ii+Yng3Bd093Jf6baqyWM5dvGiZENgOXBc0w33ET UdbB+ZjVSkpgHttS2ZgUDjULHGlsNQCOk2iRtAQJPOeQWYCGbbYiU3i8GB9szfmlaP4n R5SXsvIv+0Pephg7SQ0YbvOSDpJgT9OHzGgVFrWYSoHOLqiGuv8pEjD9B2qiSSoGmoSX Db2bOAI3cLGWZ2gYd2xmg8JpegHJXz9x5DjPJMbxM/K6rJZvGXjdVE0hphB7BUQ4PVLO OiRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 X-Forwarded-Encrypted: i=1; AJvYcCX+101jJbBDIGBRZ3AJxtm0G0dZZBUej5lJhzbQx7KY5zChueFwKyUBIHN8KEl4s5TdfWhmx6ZIeHWszwFGJK/BAd6YEfbX35vLhMm5L2HqlFK6JtyiO+V80snSPXJb0lIrMsK1GLbj7D4mOeSIEIuUqUg1MI8tksD29gAj/bn5UVxXDjPr6jogSvqc3sbJJxtBwcnse6oMIxRiSoY19vD0hw2L7QLkU/nCf6gxmgjrhPfT75AyKcQMtnuUydK83u04a7PwoDlNiumQYkxl1Q+dUuAQjGuwzzBekeRoXukWQjDqHodCAB1o4m8VxC7ZIbGF0Gs6HRHsVF8UQz+a7MR3EH8RvlFfBuyhmcqxGfgPP5F0Rm64PWAkKYcICW7yHCjb+b7dZOtLklAA+cgZrk7iwbtvUTnmpGgoUzWDe8asQHV0Bk6VmkMxeeG0zgpS2lAT4mfdT+a2Dzu2/NBb4TJTFDM4TUjS3RPJstI5OQ2MF7rUa739DjU2qwrP6khYr5vZPj/bEGKsjlNHDYqLp5SUQtvoZJNV01wyD7Jv47k3UxYhCfq8Q6uDdr9zPQVfsRhxKtSFiU9A+QCc7xOTVPWCpyT9EUeV7aED3r7FVk9vsJs1mLjslZPOBmUOe9+0N7dy8tF4+ot0N/i/p2aUE5SkEhgDj+MThfsulk1uX5npnkvQVVd++kOO7UfSTigcKJEUYRmYgjgMF4BfDDzbAeUjUsl+LiGZnGbhsFqJGCewot0sNpf3mJJvzvN7i2WrzooPw2SLoXGgmAFB4TqvMrNb+2SSieey58L150REUO/scADF3tNxNm5xj4FmxKGa5u3tSyQ0Tym/5rzTK2NcCbxqjZY/lWjyHzLFrlsgBLCotMNTyJf2nBKjJHcTqbwkUyhrfi7H2kQ3QLPyCazxdzUPLh2VSVzoIg8XqtrP1VHh+SQH5rDpvfVAfDRs/cX/Qoe+DD akZtwGlml0qPe3eLGP6/Q4II/syPcAntkG2pME0j12cTCS8lpvLoQHg/0M0vZwU2RxkLNSvMlgLzLWFLS6LPxfBsAnkzy75VBoO/F+si68NKcVz0zW/qdfKgGu/oWoXv62z8x8PoTqyUPY5SZug3gkQH2fUK0FJfh6r/uyTHwqAEDCu+B5Cp8gTBE1Ch0euOX6mTW2zzuXmaWQCkpvWbnB7WzDy385e+GeL39qzvJ2ANihKY1Q2hW3E28fhNIbhNu4vthBPux5QrwHKDs1DKvUhiQl7MDnz9WLFBUFNDb2h8tLEbHZlt4V+JbmGwA2cu2FFVr+j5VSzcpLwy+cJc53EkWs5bb3d2qjRW2hs34uCOxJ6a9Ki9K7uciJX0eJ25E5ly893+obcgOoY7PywItfC0UcpjK2LyPEGn3rZ903WrqUG1RvIPkPHf/GAtoNwlCjnhvo7c0CnVIYGMsnm4gc9SzQXPTW28T0GnqGXPHiNec2R0NI3k8MFijqP5+l1pEicq/63eXInCDzw+zElNtR8WIqdI31JphnJL4K1lkmu91vKQjLt/BAnPtu5Pwtbu3R8ZV1z7NjnUn+8mLEbevcnzrJNa4xbahFIZef Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w6-20020aa7d286000000b00561282f16a3si2991394edq.244.2024.02.12.13.16.13; Mon, 12 Feb 2024 13:16:13 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C6BC68D128; Mon, 12 Feb 2024 23:16:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC2F468CD2D for ; Mon, 12 Feb 2024 23:15:56 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 8CF8AE9F63; Mon, 12 Feb 2024 22:15:56 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n1bJDF2sARwa; Mon, 12 Feb 2024 22:15:54 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 84759E9F3A; Mon, 12 Feb 2024 22:15:54 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Feb 2024 22:15:34 +0100 Message-Id: <20240212211537.18468-2-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212211537.18468-1-cus@passwd.hu> References: <20240212211537.18468-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/5] avutil/channel_layout: add AV_CHANNEL_ORDER_NB 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: eHLd90eh9ZO7 Signed-off-by: Marton Balint --- libavutil/channel_layout.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h index b8bff6f365..db0c005e87 100644 --- a/libavutil/channel_layout.h +++ b/libavutil/channel_layout.h @@ -146,6 +146,10 @@ enum AVChannelOrder { * as defined in AmbiX format $ 2.1. */ AV_CHANNEL_ORDER_AMBISONIC, + /** + * Number of channel orders, not part of ABI/API + */ + AV_CHANNEL_ORDER_NB }; From patchwork Mon Feb 12 21:15:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 46225 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp921777pzc; Mon, 12 Feb 2024 13:16:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVtOCFPBxEqQJDwm0gDfprGiOR8oZGT/TXBHloSuhWRUGArzgG9xh1F6Cqj6KSTZ9ow1AXNp5f7vvTKdyQuBfZGlZHJCbsjzgdQCw== X-Google-Smtp-Source: AGHT+IFyJbe3roTl2j4KJsov5ayLgNKjqU88omtVgg6xwJphnqRdC/ARxbwJ5FYlz+1E7D2J3x3t X-Received: by 2002:a05:651c:507:b0:2d0:d336:d144 with SMTP id o7-20020a05651c050700b002d0d336d144mr6277260ljp.14.1707772581977; Mon, 12 Feb 2024 13:16:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707772581; cv=none; d=google.com; s=arc-20160816; b=n03lFvNqNAmv16bQsfvgcG9/jiUpyZoTaicbVmYebdTbjB+oA1yZiZt6KtIlNpSieN KQZNfFVQBiwReaUtEYPxRfZiOzKiur1aqy8cGHoxxtzZgbwtB3AeU3Gi4K0dNloKG9NX mvWNoKb7uqF8dU5kfLYMYfux4Mw5gpOtPzhgG0fDR0sNz+JCmgH5kmafmE/i/qNHzQv4 abgWhV/bBPR4jR9l7d6kcnA4cdqKWPiRGAZDyf90oi2hbheez4Ys6adbBdrR22fjmCg6 2b+2Ie/tHj1lWDj6EuEUyOXvomOoM+7z5NVeNIemfUPlq+aEJTfoUMiVpJ3rIdPrlnv3 Qh/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=K6NmtLrAe5c87qgN6LtdoTGkEe1JSuKSEDpU7pU8h9E=; fh=GiUIPxNLnOjL9oPJ2DlcKC7AfbHUoE0M9cUANEUGN+4=; b=A0IYQkaxvVaZMiDI7G7dAjKdhU6W1+hxaRZZnxDVFWMBq2FpP1Kbdjk0piAPi2WfVP zmg8bEVuuusDAHerhZ0+ON+2l+IccrL8k36gvcjlIvdqt6Efvfut6BgzBJayO139x/qw IAzqdaCia693IyF92e2veroEb0CFOPeLiACxObt70Xi1/gXXB6DNgjnWBVeWUhWqlyjc yBV72r+5RBCHV2KVolea8+uziMcpQs+z8iCtL8CmSsjExaQ1kA22vFSG3S29UAE/ftcS gI+Bsudv6em3XlQ0w4Yk115KMTjhqHNG4VKOCICpZZ7kSU98FZERQqyUw55NDUYepMRH OgYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 X-Forwarded-Encrypted: i=1; AJvYcCW+O13bfjJA58w12p1VOTO9HUcWF8U0FF5bhRZqCe5jkWBjuDBSa+KQqPmnI/8WINsLMgY49tYvV8SXvh1SnkxS5XzMghQEufcats+4OYGd2XlIBfUsXWHO1XQSHm4YHJsOTVaKyq0vybUE0tULBRcoR0ZSQMWtjpph/sj4Uc1ObBW5YQIuWV/DGIl4cNbDziHlEXLnueew5CvF64XQnnWWl+1zje/p672uorViWKSTVUqd7g0aQak1Fwhf9dxE1+yD1wn4vUZbtc9zJF2ChlE7Anzi6hamijtUqXZPW6RRHqQYhEC59Z8v9V8i0MJZ0jl8hgEWUePc61uLGavOFceRzYssw6m7kr/8wvcPST+Jn4l+ej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UZUeyfEitqwyQhApZ7BhD/4zJtWf9GVt4HfctZ5jjGW0bUDdxE8/UUdNld56AqR/p+eehjWHjRf6IMyFbSmCmF+A/l5MSRT0ziv3zCbN1ZCJoGiGEcRp73a/CPe8nky Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j21-20020a508a95000000b005601ab7b947si3222826edj.111.2024.02.12.13.16.21; Mon, 12 Feb 2024 13:16:21 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 66FCF68D150; Mon, 12 Feb 2024 23:16:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8DF9268D119 for ; Mon, 12 Feb 2024 23:16:00 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 44A28E9F3A; Mon, 12 Feb 2024 22:16:00 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h_hwSHQ6TG2d; Mon, 12 Feb 2024 22:15:57 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 96379E9F6D; Mon, 12 Feb 2024 22:15:57 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Feb 2024 22:15:35 +0100 Message-Id: <20240212211537.18468-3-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212211537.18468-1-cus@passwd.hu> References: <20240212211537.18468-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] avutil/tests/channel_layout: add tests for av_channel_order_retype 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 7YedaIQDhkmx Signed-off-by: Marton Balint --- libavutil/tests/channel_layout.c | 63 ++++++++++++++++++++++++++++++++ tests/ref/fate/channel_layout | 27 ++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/libavutil/tests/channel_layout.c b/libavutil/tests/channel_layout.c index c537e7e710..d83839700c 100644 --- a/libavutil/tests/channel_layout.c +++ b/libavutil/tests/channel_layout.c @@ -24,6 +24,7 @@ #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/error.h" #include "libavutil/internal.h" #include "libavutil/mem.h" @@ -112,6 +113,53 @@ static void channel_layout_from_string(AVChannelLayout *layout, av_bprintf(bp, "fail"); } +static const char* channel_order_names[AV_CHANNEL_ORDER_NB] = {"UNSPEC", "NATIVE", "CUSTOM", "AMBI"}; + +static void describe_type(AVBPrint *bp, AVChannelLayout *layout) +{ + if (layout->order >= 0 && layout->order < AV_CHANNEL_ORDER_NB) { + av_bprintf(bp, "%-6s (", channel_order_names[layout->order]); + av_channel_layout_describe_bprint(layout, bp); + av_bprintf(bp, ")"); + } else { + av_bprintf(bp, "???"); + } +} + +static const char *channel_layout_retype(AVChannelLayout *layout, AVBPrint *bp, const char *channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_string(layout, channel_layout) && + av_channel_layout_check(layout)) { + describe_type(bp, layout); + for (int i = 0; i < AV_CHANNEL_ORDER_NB; i++) { + int ret; + AVChannelLayout copy = {0}; + av_bprintf(bp, "\n "); + if (av_channel_layout_copy(©, layout) < 0) + return "nomem"; + ret = av_channel_layout_retype(©, i, 0); + if (ret < 0 && (copy.order != layout->order || av_channel_layout_compare(©, layout))) + av_bprintf(bp, "failed to keep existing layout on failure "); + if (ret >= 0 && copy.order != i) + av_bprintf(bp, "returned success but did not change order "); + if (ret == AVERROR(ENOSYS)) { + av_bprintf(bp, " != %s", channel_order_names[i]); + } else if (ret < 0) { + av_bprintf(bp, "FAIL"); + } else { + av_bprintf(bp, " %s ", ret ? "~~" : "=="); + describe_type(bp, ©); + } + av_channel_layout_uninit(©); + } + } else { + av_bprintf(bp, "fail"); + } + return bp->str; +} + #define CHANNEL_NAME(x) \ channel_name(&bp, (x)); @@ -437,5 +485,20 @@ int main(void) av_channel_layout_uninit(&layout2); av_bprint_finalize(&bp, NULL); + printf("\nTesting av_channel_layout_retype\n"); + { + const char* layouts[] = { + "FL@Boo", + "stereo", + "FR+FL", + "ambisonic 2+stereo", + "2C", + NULL + }; + for (int i = 0; layouts[i]; i++) { + printf("With \"%s\": %s\n", layouts[i], channel_layout_retype(&layout, &bp, layouts[i])); + } + } + return 0; } diff --git a/tests/ref/fate/channel_layout b/tests/ref/fate/channel_layout index ab9bee947b..1d1f1cb082 100644 --- a/tests/ref/fate/channel_layout +++ b/tests/ref/fate/channel_layout @@ -185,3 +185,30 @@ On "ambisonic 2+stereo" layout with 11: -1 Testing av_channel_layout_subset On "ambisonic 2+stereo" layout with AV_CH_LAYOUT_STEREO: 0x3 On "ambisonic 2+stereo" layout with AV_CH_LAYOUT_QUAD: 0x3 + +Testing av_channel_layout_retype +With "FL@Boo": CUSTOM (1 channels (FL@Boo)) + ~~ UNSPEC (1 channels) + ~~ NATIVE (1 channels (FL)) + == CUSTOM (1 channels (FL@Boo)) + != AMBI +With "stereo": NATIVE (stereo) + ~~ UNSPEC (2 channels) + == NATIVE (stereo) + == CUSTOM (2 channels (FL+FR)) + != AMBI +With "FR+FL": CUSTOM (2 channels (FR+FL)) + ~~ UNSPEC (2 channels) + != NATIVE + == CUSTOM (2 channels (FR+FL)) + != AMBI +With "ambisonic 2+stereo": AMBI (ambisonic 2+stereo) + ~~ UNSPEC (11 channels) + != NATIVE + == CUSTOM (ambisonic 2+2 channels (FL+FR)) + == AMBI (ambisonic 2+stereo) +With "2C": UNSPEC (2 channels) + == UNSPEC (2 channels) + != NATIVE + == CUSTOM (2 channels (USR768+USR768)) + != AMBI From patchwork Mon Feb 12 21:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 46226 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp921838pzc; Mon, 12 Feb 2024 13:16:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHr+wXc+U/zD2oBlSUpBLmcO0HT8/DGJ9s67cc/RX/ndxKlga48RE9EDSizmIMPFObgWuv X-Received: by 2002:ac2:46da:0:b0:511:96d0:5ae1 with SMTP id p26-20020ac246da000000b0051196d05ae1mr317850lfo.40.1707772590629; Mon, 12 Feb 2024 13:16:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707772590; cv=none; d=google.com; s=arc-20160816; b=spV6cO0e3f1vBVHy+pADNUQKUy7cBlAU3PSgRlUaJfOYcq20nsvMGSi9d6zoo77R32 xB8ja15F9w/9kWyDbLAYYi9CXQhpCH5PVKpYwxrm5dxNxJbfZen4BLzP28f3FGdlWyWr jgFXrHlLsSsnhMlVvNskMqJOuxzZ44Ot6UZdS62jPvBJXrauaddWU3jYqBgg6bxf6ME3 /pif6L+w0XbQCiZsAagB3a/0tSJdzYZMFlDpwwWJYryCMAa9b8+wvRSvkdkCIn5uvyq0 gbvOvEsd9lVMytaw0aj9/WM0jNZ3DtkdD8xIUD2mS9kNoGhk9f53Cy64tts8dzBKE8AP hF5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=1+K+3kIhM9y+mQCyj/eWcXegMYC2n78BDbdoBOhBg/E=; fh=W/KuhEpuTsrv4ghP9NitVteR1Kxzu1NKFL/r6DPXRlM=; b=ExQ5IIEXY9rnTGpI0VY/D/SOpCiHEgBJKccJjv+yIZuLx8Tjp6ouHLX7yTT9SJZ+VW p0PSboWIq18+RfbM1xUyjS0mVYDgyHrIJBTE8Bzb/DaRCOIazRwAC4ujHEYWFp4Ynrz2 qRNRn3dIWr7xj703ceof8KaX2Rl0g/cipO0sMrYmXPl68K+CzZFAkdMA9qmWWTz8Ln6t c6kkfvJevex9McHoYtkCrWpEfpNEGZNeKI2DpV3zBCxFHsNhlcbmz7NNtLdlmCk5Z/jq fExoFUO6BsOgK0/ihyZUbBokZFUtp+W732eV1dTHTobRBDiJ7XhilfQ2MBMd9+0J9wUT xPRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 X-Forwarded-Encrypted: i=1; AJvYcCWy1cFeAVgTaqGQYz/P5AqNHdxnc7MwEjVImFbONySPntYAHOZA55mNjVsOPbYnh+1nJ00o/ehcyhhqWEDwC4vGTQAKzrCjKkKlYOET7vuRciOXESWouynTIOf2+jURBIGZKwCMKVnNEdnHAFjrojZnJeDEz55+lVkssECD5v2f1d9WwRzKQc717RgC8g5K8+V9Y+UE4EbA8YaNYZ20qt1kCvvzLgDqomTa51y4pgSZO8pTjPjg172h651jL32NT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gUrtb7N4dsy3MSJQvMEUfJQdxcvg1eF3KbYKmeEdROtVVFMmUOwUwyCdazn0gfUoS5Hu1pUMhCnNa6+AcgRnsiUCxt7f3v+Q/3rYR+hKItE15NaE/Gd1IkvlY/bgjqbvnrhjzRVrkiRvPW5v2PFOwrydk5E5IycyasmJ76UCJZdwVA+DB8JyXuZTD6M8I8AUaNeBT6uW/3eZ42+1Hr+Zjb60+UV9cTWorWyM3idb8Y7NML8iuV6e3w== Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v18-20020a170906489200b00a3cc8de6dfdsi551901ejq.26.2024.02.12.13.16.30; Mon, 12 Feb 2024 13:16:30 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8B52E68D16B; Mon, 12 Feb 2024 23:16:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B0C4068D147 for ; Mon, 12 Feb 2024 23:16:05 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 80EF4E9F63; Mon, 12 Feb 2024 22:16:05 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3uwIiwNPWIKC; Mon, 12 Feb 2024 22:16:03 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 863C1E9F59; Mon, 12 Feb 2024 22:16:03 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Feb 2024 22:15:36 +0100 Message-Id: <20240212211537.18468-4-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212211537.18468-1-cus@passwd.hu> References: <20240212211537.18468-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] avformat/mov: factorize reading the main part of the chnl atom to mov_chan 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZjyeoN7Bsv5v Signed-off-by: Marton Balint --- libavformat/mov.c | 58 +++-------------------------------------- libavformat/mov_chan.c | 59 ++++++++++++++++++++++++++++++++++++++++++ libavformat/mov_chan.h | 10 +++++++ 3 files changed, 73 insertions(+), 54 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 42b0135987..52436d71d6 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -953,9 +953,8 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_chnl(MOVContext *c, AVIOContext *pb, MOVAtom atom) { int64_t end = av_sat_add64(avio_tell(pb), atom.size); - int stream_structure; int version, flags; - int ret = 0; + int ret; AVStream *st; if (c->fc->nb_streams < 1) @@ -971,58 +970,9 @@ static int mov_read_chnl(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR_INVALIDDATA; } - stream_structure = avio_r8(pb); - - // stream carries channels - if (stream_structure & 1) { - int layout = avio_r8(pb); - - av_log(c->fc, AV_LOG_TRACE, "'chnl' layout %d\n", layout); - if (!layout) { - uint8_t *positions = av_malloc(st->codecpar->ch_layout.nb_channels); - - if (!positions) - return AVERROR(ENOMEM); - for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) { - int speaker_pos = avio_r8(pb); - - av_log(c->fc, AV_LOG_TRACE, "speaker_position %d\n", speaker_pos); - if (speaker_pos == 126) { // explicit position - avpriv_request_sample(c->fc, "explicit position"); - av_freep(&positions); - return AVERROR_PATCHWELCOME; - } else { - positions[i] = speaker_pos; - } - } - - ret = ff_mov_get_layout_from_channel_positions(positions, - st->codecpar->ch_layout.nb_channels, - &st->codecpar->ch_layout); - av_freep(&positions); - if (ret) { - av_log(c->fc, AV_LOG_ERROR, - "get channel layout from speaker positions failed, %s\n", - av_err2str(ret)); - return ret; - } - } else { - uint64_t omitted_channel_map = avio_rb64(pb); - - if (omitted_channel_map) { - avpriv_request_sample(c->fc, "omitted_channel_map 0x%" PRIx64 " != 0", - omitted_channel_map); - return AVERROR_PATCHWELCOME; - } - ff_mov_get_channel_layout_from_config(layout, &st->codecpar->ch_layout); - } - } - - // stream carries objects - if (stream_structure & 2) { - int obj_count = avio_r8(pb); - av_log(c->fc, AV_LOG_TRACE, "'chnl' with object_count %d\n", obj_count); - } + ret = ff_mov_read_chnl(c->fc, pb, st); + if (ret < 0) + return ret; if (avio_tell(pb) != end) { av_log(c->fc, AV_LOG_WARNING, "skip %" PRId64 " bytes of unknown data inside chnl\n", diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c index 79768bc210..cce9d7a697 100644 --- a/libavformat/mov_chan.c +++ b/libavformat/mov_chan.c @@ -863,3 +863,62 @@ error: av_channel_layout_uninit(layout); return ret; } + +int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st) +{ + int stream_structure = avio_r8(pb); + int ret; + + // stream carries channels + if (stream_structure & 1) { + int layout = avio_r8(pb); + + av_log(s, AV_LOG_TRACE, "'chnl' layout %d\n", layout); + if (!layout) { + uint8_t *positions = av_malloc(st->codecpar->ch_layout.nb_channels); + + if (!positions) + return AVERROR(ENOMEM); + for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) { + int speaker_pos = avio_r8(pb); + + av_log(s, AV_LOG_TRACE, "speaker_position %d\n", speaker_pos); + if (speaker_pos == 126) { // explicit position + avpriv_request_sample(s, "explicit position"); + av_freep(&positions); + return AVERROR_PATCHWELCOME; + } else { + positions[i] = speaker_pos; + } + } + + ret = ff_mov_get_layout_from_channel_positions(positions, + st->codecpar->ch_layout.nb_channels, + &st->codecpar->ch_layout); + av_freep(&positions); + if (ret) { + av_log(s, AV_LOG_ERROR, + "get channel layout from speaker positions failed, %s\n", + av_err2str(ret)); + return ret; + } + } else { + uint64_t omitted_channel_map = avio_rb64(pb); + + if (omitted_channel_map) { + avpriv_request_sample(s, "omitted_channel_map 0x%" PRIx64 " != 0", + omitted_channel_map); + return AVERROR_PATCHWELCOME; + } + ff_mov_get_channel_layout_from_config(layout, &st->codecpar->ch_layout); + } + } + + // stream carries objects + if (stream_structure & 2) { + int obj_count = avio_r8(pb); + av_log(s, AV_LOG_TRACE, "'chnl' with object_count %d\n", obj_count); + } + + return 0; +} diff --git a/libavformat/mov_chan.h b/libavformat/mov_chan.h index 8c807798ab..b7d435b99f 100644 --- a/libavformat/mov_chan.h +++ b/libavformat/mov_chan.h @@ -189,4 +189,14 @@ int ff_mov_get_channel_positions_from_layout(const AVChannelLayout *layout, int ff_mov_get_layout_from_channel_positions(const uint8_t *position, int position_num, AVChannelLayout *layout); +/** + * Read 'chnl' tag from the input stream. + * + * @param s AVFormatContext + * @param pb AVIOContext + * @param st The stream to set codec values for + * @return 0 if ok, or negative AVERROR code on failure + */ +int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st); + #endif /* AVFORMAT_MOV_CHAN_H */ From patchwork Mon Feb 12 21:15:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 46227 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9002:b0:19e:cdac:8cce with SMTP id d2csp921899pzc; Mon, 12 Feb 2024 13:16:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWsmALQpRkhhvpymuTzL5sDgkx9FMslOqeNMyFocaJm/QeCKSoBlDRp6oSkTHFETyBugfDzPySeKLyHOCt6KvCSyVLm/4fLp8H02g== X-Google-Smtp-Source: AGHT+IEkP/q65i0ev4418ZdktIlzlckx8Xk5nUZfATfcstxH4dMnwrW00EnTzigcTZE417cMSmhS X-Received: by 2002:a17:906:81c5:b0:a3c:edc4:4abd with SMTP id e5-20020a17090681c500b00a3cedc44abdmr419103ejx.33.1707772599087; Mon, 12 Feb 2024 13:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707772599; cv=none; d=google.com; s=arc-20160816; b=p3XNNZKtga9mUvWG+SoOwOARvG65e+8RnUKP8C5sFehzpZRWZjepJ7Oc4r1c6RLJaz JJQTt46O1oJyFg0WFFvXFpFNc293Rnw6TpW7y2NnK3i/HLU03p2sLnX9fqYFLqs2aMUI tMaGsFNhgzs757djA8mCWuupnsvidIIohNnwugUuyhLO1CGiW3jXdRumcmAmp/KCPGDK X2IF8XwQCPocpif+P7fIvxjnyg6W2+Rn6P9q5sTfS3C7KLFVHeqoUDwiXZN6UBs4VjlD 5WpzwJvMxGIY6rmYyQxrrnOpE6XWfhPp1EuLlbjBdY4aDTG9IvVJTxw1f+UNfB3zFy/I LGpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=eu0WrLUV8C9mQDXoTwg/2yClG7iFh0aFg8MGni953N0=; fh=N14Olm9UeodHp55+b9Q+ubaOsCjj23NQ3BzUjMiWcFc=; b=f/pB8rLVPMUoQdC/4JEjJfA6AJvQAH5h5FXdTqRivIo2qGooihuEFNKgMjD3ESXXgW zUkrLxAtI+EtbticZT3I49fwscvKa1hmVBFQQvehNF5Ub5Ih4ZK2JK9xhg0yhFz5G3Hf Vcta8Okexjl+n85EAFonqiQlAIx4fFU4vEdJ7qzZfJSxpKzSptVoat5SgXF11yDPsEJw yaHbbw1oORE7JsDqf+1dIdTfmqTgIfPghvPdLIebXwd4n1DziicdC6qp0WWhaYBLZiia wAX7Hi1kHmT65cF1X6ags1esSBaY0ilm+yVr7uFGbezeb2mt0+HXmV1QtAx9Ka0FlG67 4S+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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 X-Forwarded-Encrypted: i=1; AJvYcCUw9UzUPjjaZ/xjB/+vXv5agUcTp29cl6N4KOP5883qrgl2V9QHEcYbt3sji94rcDXSt1fssuxP1Eh+1p8ErE13mF4Xo86x3vE8AQRZZ/hZ4+zA1TJgLz3RINLewB631Z4PDChScLPwYOicvdCQ2nojn9rUtuzxF79SIFBJmR8O660hjcE1OtCJktFg2aIz2mS9UfQ5REt8KNU3lZRe68PXKyQbVXf8jt6eB0b0ZKSQdIjviXAVCiqJVZNlNWdFCGKOpYABE9oqnXN8yjSGGsZPrXoDvu0pr5G1aCf7/wdrK+hp4e0YVhGkKzdvnGu9QC/JBm1nnDSAji70ACjA+g6bpJJE4x07Zmh9X/pq9GX6uxZvmzjpjsK5o7gbjw26Ft13828xd5Q+18iUUiMQFCWzLs9nSoM3wdS82qzvHrK3koM6pPHrNJegeu3f2WLXfZErkJ7v5iWzpnumSRPZS5jXZTP+CkKtfedv/QRknBSJFm1ZVE4hyi89dqy3bh8N3sF9CW/zhPIzWCHhhPHbI0mCpbF6NRIQ+uuUk3/+81Y+XaIbude7jsHG7CriUvmIPaXh3U2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.org. [79.124.17.100]) by mx.google.com with ESMTP id e27-20020a1709062c1b00b00a3ce76f5e9csi292738ejh.884.2024.02.12.13.16.38; Mon, 12 Feb 2024 13:16:39 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9AA0568D155; Mon, 12 Feb 2024 23:16:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 854CC68D15C for ; Mon, 12 Feb 2024 23:16:08 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 59CBAE9F67; Mon, 12 Feb 2024 22:16:08 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GOX2X1WJ4-pX; Mon, 12 Feb 2024 22:16:07 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B8F50E9F59; Mon, 12 Feb 2024 22:16:06 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Feb 2024 22:15:37 +0100 Message-Id: <20240212211537.18468-5-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212211537.18468-1-cus@passwd.hu> References: <20240212211537.18468-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avformat/mov: rework ff_mov_read_chnl 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: J7Phl0Pg1jIQ A lot of changes and fixes to channel layout parsing, notably - get rid of dynamic allocation of channel positions - signal unimplemented speaker positions as unknown instead of failure, but warn the user about it - native order, and that a single channel only appears once was always assumed for less than 64 channels, obviously this was incorrect Signed-off-by: Marton Balint --- libavformat/mov_chan.c | 106 ++++++++++------------------------------- libavformat/mov_chan.h | 6 --- 2 files changed, 26 insertions(+), 86 deletions(-) diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c index cce9d7a697..3e186b0837 100644 --- a/libavformat/mov_chan.c +++ b/libavformat/mov_chan.c @@ -804,66 +804,6 @@ int ff_mov_get_channel_positions_from_layout(const AVChannelLayout *layout, return 0; } -int ff_mov_get_layout_from_channel_positions(const uint8_t *position, int position_num, - AVChannelLayout *layout) -{ - int ret; - enum AVChannel channel; - - av_channel_layout_uninit(layout); - - if (position_num <= 63) { - layout->order = AV_CHANNEL_ORDER_NATIVE; - layout->nb_channels = position_num; - for (int i = 0; i < position_num; i++) { - if (position[i] >= FF_ARRAY_ELEMS(iso_channel_position)) { - ret = AVERROR_PATCHWELCOME; - goto error; - } - - channel = iso_channel_position[position[i]]; - // unsupported layout - if (channel == AV_CHAN_NONE) { - ret = AVERROR_PATCHWELCOME; - goto error; - } - - layout->u.mask |= 1ULL << channel; - } - } else { - layout->order = AV_CHANNEL_ORDER_CUSTOM; - layout->nb_channels = position_num; - layout->u.map = av_calloc(position_num, sizeof(*layout->u.map)); - if (!layout->u.map) { - ret = AVERROR(ENOMEM); - goto error; - } - - for (int i = 0; i < position_num; i++) { - if (position[i] >= FF_ARRAY_ELEMS(iso_channel_position)) { - ret = AVERROR_PATCHWELCOME; - goto error; - } - - channel = iso_channel_position[position[i]]; - // unsupported layout - if (channel == AV_CHAN_NONE) { - ret = AVERROR_PATCHWELCOME; - goto error; - } - - layout->u.map[i].id = channel; - } - } - - - return 0; - -error: - av_channel_layout_uninit(layout); - return ret; -} - int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st) { int stream_structure = avio_r8(pb); @@ -875,33 +815,39 @@ int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st) av_log(s, AV_LOG_TRACE, "'chnl' layout %d\n", layout); if (!layout) { - uint8_t *positions = av_malloc(st->codecpar->ch_layout.nb_channels); + AVChannelLayout *ch_layout = &st->codecpar->ch_layout; + int nb_channels = ch_layout->nb_channels; + + av_channel_layout_uninit(ch_layout); + ret = av_channel_layout_custom_init(ch_layout, nb_channels); + if (ret < 0) + return ret; - if (!positions) - return AVERROR(ENOMEM); - for (int i = 0; i < st->codecpar->ch_layout.nb_channels; i++) { + for (int i = 0; i < nb_channels; i++) { int speaker_pos = avio_r8(pb); + enum AVChannel channel; + + if (speaker_pos == 126) // explicit position + avio_skip(pb, 3); // azimuth, elevation - av_log(s, AV_LOG_TRACE, "speaker_position %d\n", speaker_pos); - if (speaker_pos == 126) { // explicit position - avpriv_request_sample(s, "explicit position"); - av_freep(&positions); - return AVERROR_PATCHWELCOME; - } else { - positions[i] = speaker_pos; + if (speaker_pos >= FF_ARRAY_ELEMS(iso_channel_position)) + channel = AV_CHAN_NONE; + else + channel = iso_channel_position[speaker_pos]; + + if (channel == AV_CHAN_NONE) { + av_log(s, AV_LOG_WARNING, "speaker position %d is not implemented\n", speaker_pos); + channel = AV_CHAN_UNKNOWN; } + + ch_layout->u.map[i].id = channel; } - ret = ff_mov_get_layout_from_channel_positions(positions, - st->codecpar->ch_layout.nb_channels, - &st->codecpar->ch_layout); - av_freep(&positions); - if (ret) { - av_log(s, AV_LOG_ERROR, - "get channel layout from speaker positions failed, %s\n", - av_err2str(ret)); + ret = av_channel_layout_retype(ch_layout, AV_CHANNEL_ORDER_NATIVE, AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS); + if (ret == AVERROR(ENOSYS)) + ret = av_channel_layout_retype(ch_layout, AV_CHANNEL_ORDER_UNSPEC, AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS); + if (ret < 0 && ret != AVERROR(ENOSYS)) return ret; - } } else { uint64_t omitted_channel_map = avio_rb64(pb); diff --git a/libavformat/mov_chan.h b/libavformat/mov_chan.h index b7d435b99f..e480809c44 100644 --- a/libavformat/mov_chan.h +++ b/libavformat/mov_chan.h @@ -183,12 +183,6 @@ int ff_mov_get_channel_layout_from_config(int config, AVChannelLayout *layout); int ff_mov_get_channel_positions_from_layout(const AVChannelLayout *layout, uint8_t *position, int position_num); -/** - * Get AVChannelLayout from ISO/IEC 23001-8 OutputChannelPosition. - */ -int ff_mov_get_layout_from_channel_positions(const uint8_t *position, int position_num, - AVChannelLayout *layout); - /** * Read 'chnl' tag from the input stream. *