From patchwork Sat Nov 24 03:31:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 11145 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E59BE44D841 for ; Sat, 24 Nov 2018 05:39:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 652D968A30B; Sat, 24 Nov 2018 05:39:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B941668A1CC for ; Sat, 24 Nov 2018 05:39:30 +0200 (EET) Received: by mail-pl1-f193.google.com with SMTP id y6-v6so11362610plt.3 for ; Fri, 23 Nov 2018 19:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yGBVmHp8AIZGqtawi4kenkqA8hZogK/oA8pwzZNZYY4=; b=eOCnTJqgp9lB/7uG7Id3s0IPe/f4sRy8ah5gBkPW++oqYLhw1WAcFXV5Wz3XF2Jbeq 5NsbWQWuiZqJ5qaa2cPTpK99pJM2qXEsIhBcCf0m0Uvx1on0jR1qB7+fycB7AOgFeB+c A4SGyjsgiVqulQ8rV5pNwLu7UvGdj1S3Ghp5km7LYrbyINBl94gAuENnHDGmMLFXmiGp cpD8UOkbiLbdAPjUWXI9tl9r90IUfm6tr+mORsU4fXKa1YzCq+bEyUS0EocaLdem1VyY e37W1Jyj6HJGcCCLDJY8NN1kyXfV/OANSdeHRjy3IZl6OcfoYtXkJ54uMBAeSvdz0f+I A8EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yGBVmHp8AIZGqtawi4kenkqA8hZogK/oA8pwzZNZYY4=; b=KUHJVj8SQEUqcdKL3ULg5c4Dqh/6HB3yXLMd43uQ2odB86XwrIpe6szRp0U6XBz5hO 1HnijJm3GtkVD71ec94FqgVlqrdAj0XCEMk7SK12sCat4h8E3XMciv+Rpio+2J6qahvz MpZW/+G8FI4d+CJRyE8Hgf3/g4lLQqp8ixwaFxSbW4r56InrLscWCoSS2WW15pWoDWoh cRplt5+Iy3fAkYh05/RoebGRw6zygqFBMXH8d4zNJvDVenLN2SzBNoqCOoTLArTmxdWw oo7nNHJvR6OEww07kOWV1Wd3qWBFyrBzqWkOhcBCF4cUATlAC4nsWUibgR3+O8qE3CIj JHmg== X-Gm-Message-State: AA+aEWaD6iGycowRizAMXeR5Inxpv2voFbdsWWJZfnCmt7JEuV05AMCQ VgqasOqVDcUDaW6MA+J02fCBdSof X-Google-Smtp-Source: AFSGD/XaPThl8OZwzOEKq7LQP5FryU/T3QEywl0m2NwpMAPSLjRIe11HH6B9j48CdNQpGw4aL7YjfA== X-Received: by 2002:a17:902:9698:: with SMTP id n24-v6mr18909854plp.9.1543030302494; Fri, 23 Nov 2018 19:31:42 -0800 (PST) Received: from localhost.localdomain ([47.90.47.25]) by smtp.gmail.com with ESMTPSA id z62sm40357912pfl.33.2018.11.23.19.31.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 19:31:41 -0800 (PST) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Sat, 24 Nov 2018 11:31:17 +0800 Message-Id: <1543030277-11374-7-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1543030277-11374-1-git-send-email-mypopydev@gmail.com> References: <1543030277-11374-1-git-send-email-mypopydev@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V4 6/6] fftools/ffprobe: fix max_bit_rate dump. 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 Cc: Jun Zhao Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" ‘codec’ is deprecated in AVStream, so used the side data to dump max_bit_rate in ffprobe. Clean the warning like: "warning: ‘codec’ is deprecated [-Wdeprecated-declarations]" Signed-off-by: Jun Zhao --- fftools/ffprobe.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index dea489d..29144a1 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2464,6 +2464,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id const AVCodecDescriptor *cd; int ret = 0; const char *profile = NULL; + AVCPBProperties *props = NULL; av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED); @@ -2611,6 +2612,10 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id } } + props = (AVCPBProperties *) av_stream_get_side_data(stream, + AV_PKT_DATA_CPB_PROPERTIES, + NULL); + if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS) print_fmt ("id", "0x%x", stream->id); else print_str_opt("id", "N/A"); print_q("r_frame_rate", stream->r_frame_rate, '/'); @@ -2622,10 +2627,8 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id print_time("duration", stream->duration, &stream->time_base); if (par->bit_rate > 0) print_val ("bit_rate", par->bit_rate, unit_bit_per_second_str); else print_str_opt("bit_rate", "N/A"); -#if FF_API_LAVF_AVCTX - if (stream->codec->rc_max_rate > 0) print_val ("max_bit_rate", stream->codec->rc_max_rate, unit_bit_per_second_str); - else print_str_opt("max_bit_rate", "N/A"); -#endif + if (props && props->max_bitrate > 0) print_val ("max_bit_rate", props->max_bitrate, unit_bit_per_second_str); + else print_str_opt("max_bit_rate", "N/A"); if (dec_ctx && dec_ctx->bits_per_raw_sample > 0) print_fmt("bits_per_raw_sample", "%d", dec_ctx->bits_per_raw_sample); else print_str_opt("bits_per_raw_sample", "N/A"); if (stream->nb_frames) print_fmt ("nb_frames", "%"PRId64, stream->nb_frames);