From patchwork Wed Oct 13 21:10:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 31104 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp6437945ioa; Wed, 13 Oct 2021 14:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmmOTKW26yBHgz1pJIrTucY/J9zIpobOW6WCdEIg/uOQAvQRUvPsmDZmRs5faBjKWFKDIp X-Received: by 2002:a50:9d85:: with SMTP id w5mr2577211ede.268.1634159486343; Wed, 13 Oct 2021 14:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634159486; cv=none; d=google.com; s=arc-20160816; b=FnbIK6Kz8ipi9nZbV+IPOZ82r8+RknNijAVZXeRgTh22Hg7tx7g0UWbVFg6yachx4H C6GGG6OuI4hW9Ar1CyuBT/3pt3Lc9sBr37UQ7esl3GxU88waTAlMysMkGGgYRYsZHKgF rurZAPPonIbHJ0h1h1fDYqayfo7pFrZdm2biPJtfApIYOMuJyyjKg6+taGUHzyxDVmoG iPRsniQadF/zalM/jC9+WNGZlUAERZaGi2Qs5Kp2peRKCIbJhcaZDy4ZhMnddb/9Wewk AmK+O9S8I/8zEs/ibVfn5hZN8028DiJ0qN5Sa/ZPXKWVv3JDTWZZHytq4v7PKEMR9SiD xmvg== 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=rZEej7SQzhy/Ink0zG3gUXYUhv3Hu11m0gSwZjGW5Wk=; b=0A1WlJiDVike/01ngY6FN3Xx70Mqj4EJEQ1hfh3Yz5i0805TomGIByzRjr017LpvoX YWx2poKs9tL1mReqasgVLtdXQQo0qUdrz9RNVkBCctnN1GfbZSQeOJeXI14+bTCB+UOF QAw6VObS6P/5tWvs2rv11zMrAMPl67Qgm8SoGCUgkSy7LBnm4CL21D9D2FSmGYLIyK7R KyhaNwLQzwrWD2QbTG4YysErr3Kgr2j6AL/LuB6BLrzbDiv3t4dKO+G23pu8XlCRJVzM qb5yvdWyCbRHlyIXB1cakCFZT8Sm7SKbiyVE9SlSoaqwZSpf1gE9gVfNnuaRwswy5xms PUeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=c0wLpQIj; 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 h18si939578eje.228.2021.10.13.14.11.26; Wed, 13 Oct 2021 14:11:26 -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=c0wLpQIj; 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 6469468A9FC; Thu, 14 Oct 2021 00:10:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A8B6E68A98D for ; Thu, 14 Oct 2021 00:10:45 +0300 (EEST) Received: by mail-lf1-f44.google.com with SMTP id x27so17714577lfu.5 for ; Wed, 13 Oct 2021 14:10:45 -0700 (PDT) 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=GhFdoFpKkRmZ7pO/AwicWtpybKXe0OzR9+qxHCh1zfQ=; b=c0wLpQIjfMh+Rc85YuiAOYOcx0dilVTBbYM+1uPGGOBA6JTVZf2fgfZOoFqLjzyxZn sT4XxmS86yVBLcrZT/pAkqdoiBDrYL7wwNfjyE/ops5Ryf+j+7Ugh4AyCHlKuQFACeJf HCE4wxTrmS6QQ2wsIorcgdWSlBkB9J+dQeet0AhMJR48KxBnWEM8MGwBSHW8HxTgLr44 6DjBv3a+irSBEGvDAWC+kI9ClTN4ZugBHMikeqRIJBs+OxPiptazGfhGcPEGhtgdX1NK 4CLn3vEOwOFvROpgYjYDSWI9E9ubbpn76mqfH3zIeCK5Rx+bpDr1ToABhoh+PK91uU0h jEdg== 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=GhFdoFpKkRmZ7pO/AwicWtpybKXe0OzR9+qxHCh1zfQ=; b=77tMSjhd6TqrJQQybiJ8wv59rLdLnklxuhh0gQvLf0twPvg/6Rauk2Q02nhPKVRZq2 Hwxmv+ku8EE/P8KrMZBuJpJD+/aZm7RcK6k1dpHaNvOGhzi/GRIvoxfTRy0BvsDSlGRQ y0+XevWDaMH0Uf1GvXd4I4SpFrYCSFzpt2bERa4+YWsjEeLCasL2+wv9FaFPy1z/v4K3 VGiM98/z97c5qCL7uxIL4pKcugy97O7fjCQWekYcOxorAxe+oD3oLM67EoBJ1ZcCbbAD J3XDP3QA+CxUggXJ+Zp/Tk0AMCYA6rusz2cy5kOdWLLPwKH/CqN0W/DmBpBgqwFzG8h+ F+JA== X-Gm-Message-State: AOAM530J85g1hvd5qB4zFBwDD1+JbDVQ5DWUWvQH3xOba+mejNE8duZF DgEatKM7z6lrXtu3LHzQWQCMMtgOeL0= X-Received: by 2002:ac2:5f96:: with SMTP id r22mr1315380lfe.266.1634159444960; Wed, 13 Oct 2021 14:10:44 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id s4sm49176lfd.103.2021.10.13.14.10.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 14:10:44 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 14 Oct 2021 00:10:38 +0300 Message-Id: <20211013211038.13391-4-jeebjp@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211013211038.13391-1-jeebjp@gmail.com> References: <20211013211038.13391-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/3] avformat/avio{, buf}: deprecate AVIOContext::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: v3DMV+DTHuxR Originally added as a private entry in commit 3f75e5116b900f1428aa13041fc7d6301bf1988a, but its grouping with the comment noting its private state was missed during merging of the field from Libav (most likely due to an already existing field in between). Users should migrate to the public field AVIOContext::bytes_written. --- doc/APIchanges | 9 +++++++++ libavformat/avio.h | 6 ++++++ libavformat/aviobuf.c | 9 +++++++++ libavformat/version.h | 5 ++++- 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 806eaf4c83..2fc964d80d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,15 @@ libavutil: 2021-04-27 API changes, most recent first: +2021-10-13 - xxxxxxxxxx - lavf 59.8.100 - avio.h + Deprecate AVIOContext.written. Originally added as a private entry in + commit 3f75e5116b900f1428aa13041fc7d6301bf1988a, but its grouping with + the comment noting its private state was missed during merging of the field + from Libav (most likely due to an already existing field in between). + + Users should migrate to the public field AVIOContext.bytes_written, which + returns the same value. + 2021-09-26 - xxxxxxxxxx - lavf 59.7.100 - avio.h Introduce public bytes_{read,written} statistic fields to AVIOContext. diff --git a/libavformat/avio.h b/libavformat/avio.h index 0f9a0f909f..7d33e971cb 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -290,7 +290,13 @@ typedef struct AVIOContext { */ int ignore_boundary_point; +#if FF_API_AVIOCONTEXT_WRITTEN + /** + * @deprecated AVIOContext::bytes_written should be utilized instead. + */ + attribute_deprecated int64_t written; +#endif /** * Maximum reached position before a backward seek in the write buffer, diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 436a264f83..7a0cd27151 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -22,6 +22,7 @@ #include "libavutil/bprint.h" #include "libavutil/crc.h" #include "libavutil/dict.h" +#include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/opt.h" @@ -124,7 +125,11 @@ void ffio_init_context(FFIOContext *ctx, ctx->current_type = AVIO_DATA_MARKER_UNKNOWN; ctx->last_time = AV_NOPTS_VALUE; ctx->short_seek_get = NULL; +#if FF_API_AVIOCONTEXT_WRITTEN +FF_DISABLE_DEPRECATION_WARNINGS s->written = 0; +FF_ENABLE_DEPRECATION_WARNINGS +#endif } AVIOContext *avio_alloc_context( @@ -166,7 +171,11 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len) } else { if (s->pos + len > ctx->bytes_written) { s->bytes_written = ctx->bytes_written = s->pos + len; +#if FF_API_AVIOCONTEXT_WRITTEN +FF_DISABLE_DEPRECATION_WARNINGS s->written = ctx->bytes_written; +FF_ENABLE_DEPRECATION_WARNINGS +#endif } } } diff --git a/libavformat/version.h b/libavformat/version.h index 474640bb78..81ed517609 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,7 +32,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 59 -#define LIBAVFORMAT_VERSION_MINOR 7 +#define LIBAVFORMAT_VERSION_MINOR 8 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ @@ -61,6 +61,9 @@ #ifndef FF_API_COMPUTE_PKT_FIELDS2 #define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60) #endif +#ifndef FF_API_AVIOCONTEXT_WRITTEN +#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60) +#endif #ifndef FF_API_R_FRAME_RATE