From patchwork Mon Oct 18 12:47:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 31142 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3261859ioa; Mon, 18 Oct 2021 05:47:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpQQUQuhQEfN7PyjM6tKtYXo9ySKTZ0yLzVgN7aZKnltbM2YlcYaHtkiK3cttNn6nlRYi0 X-Received: by 2002:a17:906:3956:: with SMTP id g22mr30066298eje.572.1634561262717; Mon, 18 Oct 2021 05:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634561262; cv=none; d=google.com; s=arc-20160816; b=sylqUqQf7SxBeoD7hh8c3t96XgpIZ/abp4fQdXd+WOm/6HU9gUi7Ov2PosKagMMRKc Zh2PWxcZ/fHkMoBFew42p4hvfDr1B/DmbEhsnTheTwEftQSdX9Hh6PRnStYoScl931MZ YgVz7Bhjld5J+32UeNYNZv6aciFMANIuQIHSJUl3dntqOawVuHDXDAq2NIjF7VcEALsw jWc1OzucDRy3rVnAvvUjgc9TrFlIN25kGvkvTXxAumus1c5M3WImzW2ZVtF1sH/FxT2m A40DyLIoNNGOlxQESAUKYTAbUQmD/T+S3xGQPyk4NBykV03vuIN/GWGk+6QW7CCBs66y UzUw== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=FisyXynBR/bYcWDPWNfma3SHNh0ZNMooCi4JGjVZSo8=; b=MLrJ2z3+cNncdOYnN1LLoq83dvc0yM+kjfFCN4KMVYUCZnmq+aQnm0jmRRCDMvkre8 p6NCpdWOOV+FwKa/YbBDcOGuxLX1U157wT55BcO937ZqsRdmsupWBA8rosnv2sTvu2z6 3xXIGJyfYBLWLigYK9krzwHFSlScXx6iRa7kEs5Xtn5Q3Up1nrg9FlvkdErOx1LSsrhm GcKIIZw0f50k2W3UqD6umeT1PfhAiHPPI4YgosKhG54U5oNGK6+HJ2lqrp1W1uq4BCGe lNVw2uhztqtJ6/PzY2H+oeYTz5vOek9O/USfzRO+LsLzb20VkmXE0cE6HJa3Z9G8KiUE q1jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=mJyTyqZP; 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 z39si19405626ede.176.2021.10.18.05.47.40; Mon, 18 Oct 2021 05:47:42 -0700 (PDT) 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=mJyTyqZP; 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 D8C1468A6C5; Mon, 18 Oct 2021 15:47:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 88A19689E05 for ; Mon, 18 Oct 2021 15:47:30 +0300 (EEST) Received: by mail-lj1-f172.google.com with SMTP id u5so3516980ljo.8 for ; Mon, 18 Oct 2021 05:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=io6M/WDBbMKusHcrFQkMRqihWp9SALCGJgjLoeZ2VCM=; b=mJyTyqZPx14lChDIq0CST7nSRWSZshzUlFlLkHW8JYPurAh4mBc7IUmL/Yliwwa5IC 27XE4aLmwje8AuGevnX1nFOie0sSuo9Go4njeDF0hbv+2dG6pV0h2zFSi0/XNtl2xhrS jE+SsFWpYI2qZPj0loteJJJ72GEzIKFbPLa9HSlksq1fD1jJQSJI19s70yHitWBrHc1F nyJTPnt5+cyPlwgC3CnAnUzdULDdiopqJDdpqRz3UF2HitZLC9s5mBMUj7+Cd6um+Rr8 6jnrRFbchZ32kS16oyDL0dmreFbjNLVnbdP5/b/3svb70rgGVwu5ev++ULkJBrHeTvEy J6Yg== 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:mime-version :content-transfer-encoding; bh=io6M/WDBbMKusHcrFQkMRqihWp9SALCGJgjLoeZ2VCM=; b=t6wmNjQucNV6q2iuPpw6i93peOKnF924DIIdPlmJAF4CqDIx4OwCUMTXOepyUYQET0 V2IdI40PbNQFy2Wb+71xlwlKYRQxOBqjZiJtRYsbCPFor9QFR6AFv2FsjOJvHY48R8uO fHVRCpjRaDNB6kEw6OE9y9s9jmbYZqw+k76SlU0/E8o5NlXYIeegXjaXbeZ2lU6Fopym Ag+fwTQR0FbdcM11qS3cuCm0L824T77iQ6oou0Yy93nXgtNJA1wc5SRuPPnctSClwMf5 j4IIBADgWoEBdiUIfIdMQ4EucBFiwWvaH+eKefAxw2b2oAtI72tzYiEcBlUq5rAJwymz HlEg== X-Gm-Message-State: AOAM5303l4kw7Lc0mqFczIPon1u69nsX16zev3pVi9LvOhpOtv5xYTGX y3kBc1KZQfkwEFrTTo+paMUXPPXaPvuyKHtg X-Received: by 2002:a2e:8041:: with SMTP id p1mr31649841ljg.158.1634561249734; Mon, 18 Oct 2021 05:47:29 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id m16sm1392779lfl.212.2021.10.18.05.47.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 05:47:29 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Oct 2021 15:47:20 +0300 Message-Id: <20211018124723.11497-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 0/3] introduce public AVIOContext::bytes_{read, written} 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: HaOfQJwNnS21 Changes compared to v2: * Written was actually written_size, so it did not take into account any writes after a seek-back. Thus an initial attempt at implementing bytes_written was made. After a brief discussion with Michael on IRC, this seems to be the idea of a path forward that was agreed upon. 1. AVIOContext::written was supposed to be a private field [1], so move the value utilized internally to FFIOContext, and set the AVIOContext value from there. 2. Deprecate AVIOContext::written. 3. Introduce public AVIOContext::bytes_{read,written} statistics fields. I was not sure whether deprecation or straight-out removal was the right thing to do - since while the field was meant to be internal it was not marked as such in FFmpeg's merged state of the struct (which is why it did not get cleaned up into FFIOContext earlier) - but in order to not get stuck on that, I am now posting this with the full deprecation changes. This way (hopefully) this change will get more eyeballs and if someone thinks this could just be removed the patches can be changed to do that instead. [1] http://git.videolan.org/?p=ffmpeg.git;a=commit;h=3f75e5116b900f1428aa13041fc7d6301bf1988a Best regards, Jan Jan Ekström (3): avformat/avio: privatize point of truth for AVIOContext::written avformat/avio{,buf}: deprecate AVIOContext::written avformat/avio{,buf}: introduce public AVIOContext::bytes_{read,written} doc/APIchanges | 9 +++++++++ libavformat/avio.h | 18 ++++++++++++++++++ libavformat/avio_internal.h | 11 +++++++++++ libavformat/aviobuf.c | 30 ++++++++++++++++++++++++------ libavformat/version.h | 5 ++++- 5 files changed, 66 insertions(+), 7 deletions(-)