From patchwork Thu Jan 13 02:09:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33538 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp47390iog; Wed, 12 Jan 2022 18:53:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJw063eDH9d2EzUEnYdeHdEHcQ3/QnFORMkHbu3SoOYubMuxlvcVedT3Smx1XtXpV07lz77E X-Received: by 2002:a05:6402:43ca:: with SMTP id p10mr462223edc.74.1642042407012; Wed, 12 Jan 2022 18:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642042407; cv=none; d=google.com; s=arc-20160816; b=AFPPzPLB+2k0/g4tgaUyZ0Rc0HWAcyvHxwq7ogSwxKmni95VYHEAuFFR5v0k7zTRb1 Jg97IdCZREtkCfdnCMdC9tQC1yS9VLTNRHfYSXBHBrIMsX3bY9lk0tGYNAtDk++7HpYI 5TS6kwiIZ87Pi183oksEra16jntxckbHSQB+0BjXlxJJ9LrO5IErGIEx447Ep+kESMHB jxLCBWa12B6t9S/w3WFfc9Oe8Bz9JNhxi3Sweb6DLL1UPTcgge9GsGnCtt+lAIFILjLw Jes4IPRL0w8MI7SaBUiLYjOPUViEm9Cvt/wGi+s+oLury6rTzEsxsibdt11GEeVAz2hY pz0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=TXe2sb07O/eAyAsZ5KAxAMja7OM4ilhdo0L2ErOQftg=; b=H4ffydqH5DJRxgsZHpXkGYBGHr/oI2uyMNmw4lDDqPCGyVtvbkoymyiNfa2uClJdh4 gviUhVvSlbJCKBDjYRknhxDkDRh4Nmm7OiGzPn+DtGltcDlRpVGJ+Gmghea5inMwoxt6 bJ8jN5nyZszrrc6Y+rhNUbyX5lOQVdy9kaHHbIVoPRLmEPr+sTwNx1pnAitkflNoLfnX DU8tMv1CwksfyZyvInPeNDC6jp8gMl+dk+Fn5QdCYywbYEbmXNaLNTG1QNC2aNY3DpUH KyYuoV5Zvi/p5fFj3ZxfvEUOJv8TxHdDMxSLTdhaTLolXRqSQnNNNNkvhkSYQ+ksJBqD p1Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=eLtRxllF; 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=QUARANTINE 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 gb35si784741ejc.517.2022.01.12.18.53.26; Wed, 12 Jan 2022 18:53:27 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=eLtRxllF; 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=QUARANTINE 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 39ED968A8C7; Thu, 13 Jan 2022 04:09:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 787F368BA83 for ; Thu, 13 Jan 2022 04:09:40 +0200 (EET) Received: by mail-qv1-f47.google.com with SMTP id kl12so5120064qvb.5 for ; Wed, 12 Jan 2022 18:09:40 -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=sbi5WL+o2jZlURapK1l8hcDArLplFL+1p2N3zJO8b1s=; b=eLtRxllFS30cNdgKD9ZztkI0hlgdqhOsy2LV8ZJ9Agpdq4XKBL/Sws1P92GfGljtix 4/pEzz7J30BzJgRfyGBkfFsB2FUQKGi2wabwVy93o1evBtwnrcaB6yDqyA+afUWWRehy pm6YSvGSSHFvQJ8r2C1y9OnQwRn26VsXWE9q2HyOcOLnMK/WNssVvgDep9hxRlxAGcr6 RNrqJe+EfPgNRRuFOsI/XTTo02t7rwuUYd2RbUuRITrChBs6wxoybba01fuK5+cdsjN9 oUvbkc7i4Je5WCPczn6TVBNUNTR+ilwecnf5ggPk5Ylf6tK6PKyICICh9bue2d3n8j1I HB3Q== 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=sbi5WL+o2jZlURapK1l8hcDArLplFL+1p2N3zJO8b1s=; b=pKU2AIoD4E0sT3ykxZn6mhh/FTI1qTSOV7S2l30FJYBFIoDwFwp/1Q18PVYGAWp873 jQHnjSP2Mlnqk5DiZ0OJhi6WYqWRU1EwGelQTO08qxtLapwGwW8LhTIC1P8xH2a+PN3s /wKJh0PEuOclBXMlc5RKO7cRIyYZiZxafwxEmPvrnnCiFzv+/0/nrXix0QFXLHtbK/fV MXZL4a+oMuU0+V1rN9CMyDI4N67Gl3qDbl8kbm7ZlhaoU2C/72f1opkt0Yg1668DW/nx 93bhlxjKtkqPrrJLuxqt1dfAm1pOt+KV9AX3BsRgqXIp0NzKa9qal5MWKFfpN1oYXc2q f7jA== X-Gm-Message-State: AOAM5336w25U4lUxDBRd0/OPGeOn/mnk/z29wKdy4PCia5KSPLMF01vJ Uq+z4tdRNKZ3bebYXwNliUcp2VoZbms= X-Received: by 2002:a05:6214:e65:: with SMTP id jz5mr2085548qvb.67.1642039779071; Wed, 12 Jan 2022 18:09:39 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id u6sm1068031qko.83.2022.01.12.18.09.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:09:38 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:09:10 -0300 Message-Id: <20220113020913.870-9-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 278/281] ffprobe: 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: thXpKpPgfTDa Signed-off-by: James Almer --- fftools/ffprobe.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 20582ca7ac..aff9b880cc 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2462,12 +2462,10 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, if (s) print_str ("sample_fmt", s); else print_str_opt("sample_fmt", "unknown"); print_int("nb_samples", frame->nb_samples); - print_int("channels", frame->channels); - if (frame->channel_layout) { - av_bprint_clear(&pbuf); - av_bprint_channel_layout(&pbuf, frame->channels, - frame->channel_layout); - print_str ("channel_layout", pbuf.str); + print_int("channels", frame->ch_layout.nb_channels); + if (frame->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) { + av_channel_layout_describe(&frame->ch_layout, val_str, sizeof(val_str)); + print_str ("channel_layout", val_str); } else print_str_opt("channel_layout", "unknown"); break; @@ -2873,12 +2871,11 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id if (s) print_str ("sample_fmt", s); else print_str_opt("sample_fmt", "unknown"); print_val("sample_rate", par->sample_rate, unit_hertz_str); - print_int("channels", par->channels); + print_int("channels", par->ch_layout.nb_channels); - if (par->channel_layout) { - av_bprint_clear(&pbuf); - av_bprint_channel_layout(&pbuf, par->channels, par->channel_layout); - print_str ("channel_layout", pbuf.str); + if (par->ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) { + av_channel_layout_describe(&par->ch_layout, val_str, sizeof(val_str)); + print_str ("channel_layout", val_str); } else { print_str_opt("channel_layout", "unknown"); }