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 15010472FB for ; Mon, 4 Sep 2023 22:11:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 84E9168C7BC; Tue, 5 Sep 2023 01:11:32 +0300 (EEST) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B4B2568C4EC for ; Tue, 5 Sep 2023 01:11:26 +0300 (EEST) Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6bca3588edbso1177125a34.0 for ; Mon, 04 Sep 2023 15:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693865484; x=1694470284; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9dqRIjgJThbVFFxU/Hz9oZCLLCJaad/7FFdHU+jC7Uw=; b=R3tglJg7bG4I1eySb1JZc+X2oeWUXhs2P/qMau2BPiym3Bqbtx1Gy8hpuNgH3SmBbr CrFJzMbI3tAuvW63e48viDAzAQSdwPegrHh2s/SdXod0OGeW2UZEwZS1W/fUUeXZN1b1 oq413YWXOet9MKie97rF376k+Nr7uopibA9sqn/iAZEaNhT65dWCJhN6BZVwxD3LAB8u IGYdiOkpfUkDNsissj5N14keomFdSIvR7CcOy4j5tRdKeYYj92kJnsnLhSLS+ou4qpAF vErgaLaySfhgc6bZhX+11PEvgdO3ebj+RcuUJggDbw/9Bg8jMrkjdZ1jRs2n/tsoX2RD AJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693865484; x=1694470284; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9dqRIjgJThbVFFxU/Hz9oZCLLCJaad/7FFdHU+jC7Uw=; b=Z47HrCmzURlQNpXvRkH/l4KHy/VBXCEloUsou3EBem+GHK0mo48MVQFMNHxFpS7iVW 3Z2SSUyjJcztbMymeIqoq+xRDUbtYoHgja11kAREfeCscsjujVIgurdnVlSKaOGiK5yP zyJ/kqSdLbpfu/NW9k0OwcC8QLiAduduetdDJ8+HxtVrNRyTj8aKPbu0Ni6zvh5AfLOF LH/kiC8QserSnDw++Nzwdh9ECqX+MrEmnMhstT+hE/TUdYSUTdkoko1W0RleKHU6YAJm S8nplxepoLYKPw3PsSrkaIbFfAjrvOKHtrhWHzYKtU61anblLf/s7iWAnDxFPzeDqvdU UBZw== X-Gm-Message-State: AOJu0YzYGmY/jKR+1JcC+83TWh8sggNXqfl6wAeeknDlMiK3DAxBuMOV oG6FD+97XEHeI8zTyeBSloi5P5ati4g= X-Google-Smtp-Source: AGHT+IGbZ6WrwqVKDfzvxN1eJJiOCUfJ1X1MKRGd9KO+4uX1iJh6EaMfDFfzQK6ql3ZzpOi8uI9aVA== X-Received: by 2002:a05:6871:4985:b0:1c8:c27f:7db7 with SMTP id tx5-20020a056871498500b001c8c27f7db7mr8648165oab.40.1693865484624; Mon, 04 Sep 2023 15:11:24 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id v49-20020a056870957100b001c03d1a519fsm5917503oal.39.2023.09.04.15.11.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Sep 2023 15:11:24 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Sep 2023 19:11:16 -0300 Message-ID: <20230904221116.21933-1-jamrial@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230904150411.56777-13-jamrial@gmail.com> References: <20230904150411.56777-13-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/17] avformat/demux: propagate the internal decoder's bitrate properties 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: Muxers may access this information through cpb properties within the stream's side data. Signed-off-by: James Almer --- libavformat/demux.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libavformat/demux.c b/libavformat/demux.c index 94128b00bc..606ccbd180 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -2976,6 +2976,24 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) ret = add_coded_side_data(st, sti->avctx); if (ret < 0) goto find_stream_info_err; + + if (sti->avctx->rc_buffer_size > 0 || sti->avctx->rc_max_rate > 0 || + sti->avctx->rc_min_rate) { + size_t cpb_size; + AVCPBProperties *props = av_cpb_properties_alloc(&cpb_size); + if (props) { + if (sti->avctx->rc_buffer_size > 0) + props->buffer_size = sti->avctx->rc_buffer_size; + if (sti->avctx->rc_min_rate > 0) + props->min_bitrate = sti->avctx->rc_min_rate; + if (sti->avctx->rc_max_rate > 0) + props->max_bitrate = sti->avctx->rc_max_rate; + if (!av_packet_side_data_set_add(&st->codecpar->side_data, + AV_PKT_DATA_CPB_PROPERTIES, + (uint8_t *)props, cpb_size, 0)) + av_free(props); + } + } } sti->avctx_inited = 0; -- 2.42.0 _______________________________________________ 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".