From patchwork Thu May 23 20:00:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Sayers X-Patchwork-Id: 49190 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp1292306vqf; Thu, 23 May 2024 13:02:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUTFQb8xOB1vVUGPoxlURZHDPwNuwTI9uuWhFoyh893o3OCAR5C4DapbSNRJCPcPpu+SU5Ch5lcMPJPznHvATFMOgaKrOUkXSgPxw== X-Google-Smtp-Source: AGHT+IE6kOGHv2QeZxdh1xFame52jSLY8GPcoQWAdG/KZZCxDj0wXpVN0N5iHcbhzfPMD8/yI7Ek X-Received: by 2002:a2e:960c:0:b0:2d8:654e:7027 with SMTP id 38308e7fff4ca-2e95b0cc8ffmr1115041fa.30.1716494531489; Thu, 23 May 2024 13:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716494531; cv=none; d=google.com; s=arc-20160816; b=0kM36Wo9XHIhuLJIoP92tiUnCVmb4+rSFlvWsh33IJeBObNNN7Irzporj5RKl/vEss tZ1w+ia1neLDxaTkVKHVxZ6L0h7lfDVT1ekU6+7ADbj1xT4OLlXCc057SRHmB32QDgna 8ecLldZtWaMdzHA21EXFJxgQGtAqAmaaMcG3wAXJLpQ5HwKACj1C/H4kiUF6kQGTjXGS //cqZmwY+cPpYeUZb9/JX1XxToZUvHbA7/y4rHcDsIUxXhUKNQIRnUR9PTpd7vN/C1l9 Sy86Yt7mnTFkKJa7mIKxC2BmrhsO8amUHEFw5KMKonPSwmsAGBfZf8ZVFg5UICyVWD1z 8png== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=QJvdykjmELAVb8xSyQJ56e/Y+tbcb7Oxa5NkwgmrC9g=; fh=73ExZnkQ8FYbu/qeQNmI0dtHCfShNh8/NmZJs1umltM=; b=CKB0Gv80N0us6mxL1L9hjdk7ghdArlPgtxDGMjYGXYxE6vD/2Z7bLCvnDL9EsBNgbb h4Ll6J7yNBJoe4quAvJxg9nyBNFTuzMbp/fKfaufYcy8LtUVfrdEJsKvHhT7oMItesv1 XL9p4+2qub/6KwthGDZdMaTrk0rG36bbHBVvfNFbqfPcf9nMWsei2iTcqvlka7Zh3fIo 1HFwUggnSDU8y+FiuBB3VcdpywAmrTadRwS/GKW/ZnLQyFBSmOMqHKtcn0HAFvzV0lZR oPOfm8yJAur22fXLkgg1XLYZg7bs9f0TjIETYg9HUvU9PCzA2/7D1z2V/L06UxNNZx3y n7nQ==; dara=google.com 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 38308e7fff4ca-2e4d1840113si94825611fa.501.2024.05.23.13.02.10; Thu, 23 May 2024 13:02:11 -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; 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 EE97768D274; Thu, 23 May 2024 23:01:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from alt2.a-painless.mh.aa.net.uk (alt2.a-painless.mh.aa.net.uk [81.187.30.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7075F68D274 for ; Thu, 23 May 2024 23:01:40 +0300 (EEST) Received: from 0.b.4.b.7.4.0.8.c.4.a.5.d.8.b.2.0.5.8.0.9.1.8.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:819:850:2b8d:5a4c:8047:b4b0] helo=andrews-2024-laptop.lan) by painless-a.thn.aa.net.uk with esmtp (Exim 4.96) (envelope-from ) id 1sAEd9-002Q1U-20; Thu, 23 May 2024 21:01:40 +0100 From: Andrew Sayers To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 May 2024 21:00:41 +0100 Message-ID: <20240523200116.740461-3-ffmpeg-devel@pileofstuff.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240523200116.740461-1-ffmpeg-devel@pileofstuff.org> References: <20240523200116.740461-1-ffmpeg-devel@pileofstuff.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 2/4] lavu: Clarify relationship between AVClass, AVOption and context 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 Cc: Andrew Sayers Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1ZX1JQSQDCLy --- libavutil/log.h | 16 +++++++++++++--- libavutil/opt.h | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/libavutil/log.h b/libavutil/log.h index ab7ceabe22..d599ab506e 100644 --- a/libavutil/log.h +++ b/libavutil/log.h @@ -59,9 +59,19 @@ typedef enum { struct AVOptionRanges; /** - * Describe the class of an AVClass context structure. That is an - * arbitrary struct of which the first field is a pointer to an - * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). + * Generic Logging and introspection facilities + * + * Logging and introspection functions expect to be passed structs + * whose first member is a pointer-to-@ref AVClass. + * + * Structs that only use the logging facilities are often referred to as + * "AVClass context structures", while those that use introspection facilities + * are called "AVOptions-enabled structs". + * + * @see + * * @ref lavu_log + * * @ref avoptions + * * @ref Context */ typedef struct AVClass { /** diff --git a/libavutil/opt.h b/libavutil/opt.h index 07e27a9208..b14c120e36 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -39,9 +39,16 @@ * @defgroup avoptions AVOptions * @ingroup lavu_data * @{ - * AVOptions provide a generic system to declare options on arbitrary structs - * ("objects"). An option can have a help text, a type and a range of possible - * values. Options may then be enumerated, read and written to. + * + * Generic introspection facilities for AVClass context structures + * + * Provides a generic system to declare and manage options on any struct + * whose first member is a pointer-to-@ref AVClass. Structs with private + * contexts can use that AVClass to return further @ref AVClass "AVClass"es + * that enable introspection of the private structs. + * + * Each option can have a help text, a type and a range of possible values. + * Options may be enumerated, read and written to. * * There are two modes of access to members of AVOption and its child structs. * One is called 'native access', and refers to access from the code that @@ -53,6 +60,10 @@ * question is allowed to access the field. This allows us to extend the * semantics of those fields without breaking API compatibility. * + * @see + * * @ref lavu_log + * * @ref Context + * * @section avoptions_scope Scope of AVOptions * * AVOptions is designed to support any set of multimedia configuration options