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 31081472DE for ; Mon, 4 Sep 2023 15:06:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0ED9668C820; Mon, 4 Sep 2023 18:04:42 +0300 (EEST) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 41DB868C7E1 for ; Mon, 4 Sep 2023 18:04:35 +0300 (EEST) Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3a86a0355dfso1014720b6e.0 for ; Mon, 04 Sep 2023 08:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693839874; x=1694444674; 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=dUWCRdlPahZDCTKxRsCTDBlogfLZmaSooYGR4PDPz84=; b=mRLX/jX3lH7TpHFZC+iz4iWaYQ3+pfzksNaf25FxHL9Ru1ZJeMBpN8FAFRwhLvPDzA NyUXbwq2EP6z/PJA/y2GyZUARWFSEZNp+JVKXio72gXgiNkarqIy4I5eEKbHds5thlv8 VXZLuCZfv9gu5OTWyeOrOjVo4v6a/W67HgqCXTo4E7Mnc5/JD75NYx+/dp0fmqMzTepe oQ2v6Y6JRcCEHrw3YZEzERIALtCBI5z2BCCZPa3WAVTqrmAyIW/YtTvdIdXVGLVX6kzs vel0i9RlJiGjL/1owvK1J7uwYA/u33XYYF2QgstI7RtLy1hxYi3qyuNzpEZUjbvtQ5FW BKtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693839874; x=1694444674; 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=dUWCRdlPahZDCTKxRsCTDBlogfLZmaSooYGR4PDPz84=; b=AkDHNxvr+8TBX53fKfLAsYASyGjKDzFcoGI3epqss68Hl8ivrZqBzG7xP/UgOhYZAD 7J5CEtoLm2VmKsw2WZh6+BmC6NbDFbc8siMO9cvKv+AmnTfIhb/9s+IzFpEuUrIbfnA0 ADXq2IeeRIzZMV3BcY7NmxYR7andZLgcgNYD2tjV/5UDEmDaT4QQQax2zvQOwWIf9cnW I26sibtlj49w3pe4O1JEhbWv8fxKguJbuyBZ25Z5g8ya5aC0exOh9Mx9QR5QxJSTTpk7 wuSPdWLiibOsf7EU5yV/HjhrgnXeVvVq98RxHif82qjmYHS2Vj6R7THBD9DaNP8KC1k9 ingA== X-Gm-Message-State: AOJu0YwaKBE63WapPZrooDVhiCLch8Zv2PZAQi1BudNFZQ2fxM86sXD8 bYhw7I5JEHApMMtywthyAjhRqauIplo= X-Google-Smtp-Source: AGHT+IGu6ugNckAXNuMK5s2/GKVOtmfi6IwMle95sLTeaAsZllLKxz6RPMSv7Wt9fe/V4rOqdQSLDw== X-Received: by 2002:a05:6808:1a1e:b0:3a7:6d4a:fd78 with SMTP id bk30-20020a0568081a1e00b003a76d4afd78mr13837860oib.24.1693839874298; Mon, 04 Sep 2023 08:04:34 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id z14-20020a54458e000000b003a9cd23980esm4946286oib.8.2023.09.04.08.04.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Sep 2023 08:04:34 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Sep 2023 12:04:05 -0300 Message-ID: <20230904150411.56777-13-jamrial@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230904150411.56777-1-jamrial@gmail.com> References: <20230904150411.56777-1-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: 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 553933a2b0..d7e34aad97 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); + } + } } #if FF_API_AVSTREAM_SIDE_DATA -- 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".