From patchwork Thu Nov 25 15:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 31670 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp891440iob; Thu, 25 Nov 2021 07:33:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJ+Wygh+8IbZQ+DCoDBllvAlPoYv6yMVR7QMqx6Ew025GDB8qOjahO45Ee66z0ZgFOOeSE X-Received: by 2002:a17:907:931:: with SMTP id au17mr33247692ejc.119.1637854432081; Thu, 25 Nov 2021 07:33:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637854432; cv=none; d=google.com; s=arc-20160816; b=lW6GJp8OHrWWy6NQp1O6piQCWhXzmCQw6cznoWZd9M4pgqLJxbv4FvkrFB5olGumOe M3aQbq2TxUGX1rApWQa836jFszagvJMNa6OPum59D1Qdb51EGqxZXkItswrVNhl0M00e bGBgx/Nh2wIFANhEBdxOtUDy+5Lrp5QhLao8DOmhzNrnCFkH02aTnTev+ibJCCP9y29h KKKWoHMSGI1Dg7NWg4TSkcN2+2P4Mwo8SuRt1hoGWSN+Axy53r0lsSGk8fH22DY6ZBN9 3RZUcsbl8Ky0/DYGP/uTsIEJF4YTVYVHmU2V4sDef6jpmMfZRcO3pah1yuU7joROpG61 hidQ== 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 :delivered-to; bh=Ie2rH8IhnuGpbyctNend+o8TjTRZIVOq7awKLKlAt/Y=; b=QdrrbvtlKLZIJeqIqECn5j9OlOwwhG+7RoZmi8eNgiSn7GCWM5d9CeOhNgd8FugIh0 oIFBM5GjCjUz5gMx9VQ8Mxa/5Vv4PpbeXAqbvXDRwocYvy+WOfwXasE0QqEhXz6zE+Rp DXkXdguC/BwO6kPCFG7dYAIQvOHWiQxdjXQqTIe9LZG7plTR/gc4BnmA3PnGZjUnQU+N Ir5yLhYUQoUpqPG/zO6TTTQ/V5Y1bREzwichpRtMnnG6wv7WlUzp/rFdvriBmNoXBiCA zQcFRUmj/wfiqWW++r6h3M8ize8tT9z21q7RXX9nVPgZfxXTkSRCUz5dzmu079LqazXz J8JQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f8si9672561edd.312.2021.11.25.07.33.51; Thu, 25 Nov 2021 07:33:52 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C610768ACFD; Thu, 25 Nov 2021 17:33:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54D1768A255 for ; Thu, 25 Nov 2021 17:33:41 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 047FC24017C for ; Thu, 25 Nov 2021 16:33:41 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id peDPEL3O6fuF for ; Thu, 25 Nov 2021 16:33:40 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 765C42400F5 for ; Thu, 25 Nov 2021 16:33:40 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 5B8F23A0631; Thu, 25 Nov 2021 16:33:40 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Nov 2021 16:33:14 +0100 Message-Id: <20211125153315.26506-1-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavu/frame: drop mentions of non-refcounted frames 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: A6scp+n0WOlC All frames we deal with should always be refcounted now. --- libavutil/frame.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavutil/frame.h b/libavutil/frame.h index 753234792e..f7be2340fd 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -314,6 +314,9 @@ typedef struct AVFrame { * This might be different from the first allocated byte. For video, * it could even point to the end of the image data. * + * All pointers in data and extended_data must point into one of the + * AVBufferRef in buf or extended_buf. + * * Some decoders access areas outside 0,0 - width,height, please * see avcodec_align_dimensions2(). Some filters and swscale can read * up to 16 bytes beyond the planes, if these filters are to be used, @@ -482,10 +485,10 @@ typedef struct AVFrame { uint64_t channel_layout; /** - * AVBuffer references backing the data for this frame. If all elements of - * this array are NULL, then this frame is not reference counted. This array - * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must - * also be non-NULL for all j < i. + * AVBuffer references backing the data for this frame. All the pointers in + * data and extended_data must point inside one of the buffers in buf or + * extended_buf. This array must be filled contiguously -- if buf[i] is + * non-NULL then buf[j] must also be non-NULL for all j < i. * * There may be at most one AVBuffer per data plane, so for video this array * always contains all the references. For planar audio with more than From patchwork Thu Nov 25 15:33:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 31671 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp892077iob; Thu, 25 Nov 2021 07:34:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdcWxQBvgcW4ocd9yv7uCzWc0Agtmx/3Y3zAD4HVybZ/voJYOPZlSERK3yhWm6ZtVB7VqH X-Received: by 2002:a05:6402:50c7:: with SMTP id h7mr39732976edb.277.1637854465012; Thu, 25 Nov 2021 07:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637854465; cv=none; d=google.com; s=arc-20160816; b=XYe9kfGUKgiMADshWdz6hiXDAyVRDNBjwBwkrZoxFIU1wFsvFCyqB1n0JOGflL3bSR pyVASs518p2Rn6rOgGeoWdBcv8kTIBV6+gVeN0chdL2hFXPUNdi2OBaO0fTSwpgq8+3A A6ku5z4Lj1MHP2OIitPvQplkA2MrkPHvTP5sGhz+xPaHd9z52XQVoBebkGmXiVM4nHVI ySd/Rwx8xwnPcMcJ9PshaMJwNT0RjewSNp5HiUaAtTvzUoxw22Lx/WUiubGRDr/9Gwlo djVpN4hkafrmaq4isPQCPLPTaEok0PWMJGJ4iL+Gi2rGuW28RQHZQjsBueAu2CY7q+eY NlQw== 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:delivered-to; bh=zuY0SYg+IbhFnu13ytXDqfCRfR0xvYrhgi5sWs41CBI=; b=HKH43qPVluvwaV5cJM6ftvfKi93z1WxPkW7jMAbZM6ajyTuIIIaNPGeNghgnJ7PYrh Oo3qPglWLTh8itm4sb/i+KjGnkQAYczRsRooUS/wvkZL/GwyK/fkllteiLhx0sS84hol OSUUybQB2UjbUedS1RqmP0R1hWTzZ5BLS9Svpk6o9X6bYEw1aofgzOetoSSU4PInptx2 ygXyiDPd41pOXuVXd0GsDBuQSbztpgVE2QVj5KEiXPhfG4ysg7KhS2E8ncEFHepR8gRu 24gIV2mvL3T+qSdC/YjrBn63RzNO0BKz63tlwiAA2ZFfruIe8x+1wm78EYsTvRMyKt5A ef+g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g9si9912968edz.166.2021.11.25.07.34.02; Thu, 25 Nov 2021 07:34:24 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A38BB68AEAA; Thu, 25 Nov 2021 17:33:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D883D68A75B for ; Thu, 25 Nov 2021 17:33:41 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 88CD52400F5 for ; Thu, 25 Nov 2021 16:33:41 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id NN8JNzISPDaW for ; Thu, 25 Nov 2021 16:33:40 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 7F81624017A for ; Thu, 25 Nov 2021 16:33:40 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 5D3053A0398; Thu, 25 Nov 2021 16:33:40 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Nov 2021 16:33:15 +0100 Message-Id: <20211125153315.26506-2-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211125153315.26506-1-anton@khirnov.net> References: <20211125153315.26506-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavu/frame: clarify doxy 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: vEc1yx+9nGpG AVFrame.data[] elements not used by the format should ALWAYS be null, hwaccel formats are not an exception. --- libavutil/frame.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavutil/frame.h b/libavutil/frame.h index f7be2340fd..b7be3fa441 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -322,8 +322,7 @@ typedef struct AVFrame { * up to 16 bytes beyond the planes, if these filters are to be used, * then 16 extra bytes must be allocated. * - * NOTE: Except for hwaccel formats, pointers not needed by the format - * MUST be set to NULL. + * NOTE: Pointers not needed by the format MUST be set to NULL. * * @attention In case of video, the data[] pointers can point to the * end of image data in order to reverse line order, when used in