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 670F440F21 for ; Sat, 3 Feb 2024 10:38:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0941368D05A; Sat, 3 Feb 2024 12:38:52 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9CCC868BDD5 for ; Sat, 3 Feb 2024 12:38:45 +0200 (EET) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=EfhKcpjU; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B1975240DA9 for ; Sat, 3 Feb 2024 11:38:44 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id RO7y9Js49xsl for ; Sat, 3 Feb 2024 11:38:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1706956723; bh=SvU9Rd9ARqj2GuCs9FIuSvfF/VETHPUGIgawjWoe8/8=; h=Subject:From:To:In-Reply-To:References:Date:From; b=EfhKcpjU14xFdJ5+ZFb4B6TzG0jZFGx2OSWsOHt2lhvfkBAyHbPn6GTx2it64nDvq KkzBYIVy/rwv8gwOKifZwSpAVHY5Sppoz8REiKXIYpis5fwf2x5Wnx2/Ho0PbQwziQ V1hfeINfiITh6udCfRdQe3xfrD9HuoL/h5K7r5VQCFG70APDYYt9Q1friSsXWat9YX fGyD3GVDqtPtPN1BDI/ySylnEGvmf0t1VdMTQUaRrmxI00+45ewqXXGPytMNXxcilS 4f+2JuufdkwXpk+TBQM4INgKUIQVioZ4U4lyuIHOB2sbOIGYg90fJM5TwsZifbjf6c pAh4+zJ4sLZMg== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id DA235240177 for ; Sat, 3 Feb 2024 11:38:43 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id B99F61601B9; Sat, 3 Feb 2024 11:38:43 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <3677f954-85ec-4098-a6da-5f3c5dd40873@gmail.com> References: <20240129232755.9622-1-cus@passwd.hu> <20240129232755.9622-4-cus@passwd.hu> <3677f954-85ec-4098-a6da-5f3c5dd40873@gmail.com> Mail-Followup-To: FFmpeg development discussions and patches Date: Sat, 03 Feb 2024 11:38:43 +0100 Message-ID: <170695672373.8914.9293325106328127368@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 4/5] avutil/channel_layout: add av_channel_layout_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 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: Quoting James Almer (2024-02-02 13:56:31) > I wrote a function like this some time ago, but i lost the patch by > accident during a migration. > > The way i approached it was making the return codes reflect if the > conversion was lossless or not, as in, custom -> native is lossless only > if channels have no custom names (and possible only if the ids are > within UINT64_MAX and in order). > Anything to Unspec is always lossy, etc. Unless the source is custom with every channel unknown. > Custom -> Ambi: Possible only if it contains ambi channels. Lossless. > Custom -> Native: Possible only if has no ambi channels and all ids < 64 > and in order. Lossy if it has custom names, otherwise lossless. > Ambi -> Custom: Lossless. > Ambi -> Native: Not possible. > Native -> Custom: Lossless. > Native -> Ambi: Not possible. > Any -> Unspec: Possible but lossy. > > So 0 for lossless, 1 for lossy, ENOSYS for not possible. That sounds good to me. Might also have a flags argument that forces lossless, and for future extensions. -- Anton Khirnov _______________________________________________ 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".