From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTP id C7FF24B400
	for <ffmpegdev@gitmailbox.com>; Wed,  5 Jun 2024 10:35:01 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA37168D499;
	Wed,  5 Jun 2024 13:34:58 +0300 (EEST)
Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com
 [209.85.208.41])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F416368D5BA
 for <ffmpeg-devel@ffmpeg.org>; Wed,  5 Jun 2024 13:34:51 +0300 (EEST)
Received: by mail-ed1-f41.google.com with SMTP id
 4fb4d7f45d1cf-57a44c2ce80so4835968a12.0
 for <ffmpeg-devel@ffmpeg.org>; Wed, 05 Jun 2024 03:34:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717583690; x=1718188490; darn=ffmpeg.org;
 h=user-agent:in-reply-to:content-disposition:mime-version:references
 :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc
 :subject:date:message-id:reply-to;
 bh=ifg1hKxGMiVrOcdjfnN9byRvAhI0gUuuDF8zYPlwH/Q=;
 b=mo1eHsXRYl/DdATqht9oHZz4RNquld6WCImXZ3tXWyH2Rg+yqzHU3JojtElAfiGPNq
 RY8etRZ3wDRTmIzVu7bZTPnFxA/MNQWX/pE70nwojMJCP0sG2a+OP1wtglb5OxKhtbul
 7E03sgbdNpj4RSgnJbKf1YMf+6tXtOoW2sBRAK0M0/w5r+GJI/5+gwHt8UvYuIuRCREd
 9cwQMbQdYxceAB8uRAO0GY6AH7shULCXtEcUEcmoX6XuIZHzrSpJfPKx9g6neRVaKote
 WD6gPkfux4a7I4Q/zOTl4er8jgoedshIEXR9GEtzQWvfwbslR14dk6tJorsTsjANaAmf
 lFyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717583690; x=1718188490;
 h=user-agent:in-reply-to:content-disposition:mime-version:references
 :mail-followup-to:message-id:subject:cc:to:from:date
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=ifg1hKxGMiVrOcdjfnN9byRvAhI0gUuuDF8zYPlwH/Q=;
 b=qBp42PiROsoaroLL+E2YWOBtnncMpFO2Yq6pbjufpgHZ/xGwv6WdIlcovSGRgGymJN
 ulmP0t8EWZxlIhAeWClYzEJwe06SWA/tMv9aEZYpJ83wVvzHEiQcul1EZSPlTlzg9sTi
 26c+Zi7ajMhWFA6zp9dB7qT1bzLifVAAhg6zkJAJnmheoCIOuNIHfw5QO96XEdFqeQcp
 zyG8nYfJAkr+Ex6cPQGEH6eHZ0hnKidxTdvjLVRH6ZoLeRGn0n5J0w6i+hUOJpkbepgE
 jjG5BAm1TU2PRWo3RMyfeLtpFu3LrVmEB/HJ6u/HKzEA+w0rSTPraQLVsfUTBpQAQxQz
 M9tQ==
X-Gm-Message-State: AOJu0YwswUroPTg+dhiQhcsuDMBk1qlIVlzHzu01VTGr5oulPj1NrNPO
 wtYvMBgto1VoyFltUby6x5c8NsBMfm+OtPXBeFgkkTcmbegGjQ8mXssCvQ==
X-Google-Smtp-Source: AGHT+IHp0UbJl0nSqRaH56/sAtvlR/K7kiiorPSJl7vb6KWayDPuAfho+IdrOn+i7/UJNrepDA1kyA==
X-Received: by 2002:a50:d7ca:0:b0:57a:4af6:319d with SMTP id
 4fb4d7f45d1cf-57a8b676fffmr1352467a12.9.1717583689711; 
 Wed, 05 Jun 2024 03:34:49 -0700 (PDT)
Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it.
 [84.220.189.10]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-57a85375486sm2534081a12.48.2024.06.05.03.34.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 05 Jun 2024 03:34:49 -0700 (PDT)
Received: by mariano (Postfix, from userid 1000)
 id 218A7BFCE8; Wed,  5 Jun 2024 12:34:48 +0200 (CEST)
Date: Wed, 5 Jun 2024 12:34:48 +0200
From: Stefano Sabatini <stefasab@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <ZmA/SDz/8M6YxFT7@mariano>
Mail-Followup-To: FFmpeg development discussions and patches
 <ffmpeg-devel@ffmpeg.org>, 
 Andrew Sayers <ffmpeg-devel@pileofstuff.org>
References: <20240418150614.3952107-1-ffmpeg-devel@pileofstuff.org>
 <20240604144919.213799-1-ffmpeg-devel@pileofstuff.org>
 <20240604144919.213799-3-ffmpeg-devel@pileofstuff.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20240604144919.213799-3-ffmpeg-devel@pileofstuff.org>
User-Agent: Mutt/2.1.4 (2021-12-11)
Subject: Re: [FFmpeg-devel] [PATCH v6 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 <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/ZmA%2FSDz%2F8M6YxFT7@mariano/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

On date Tuesday 2024-06-04 15:47:22 +0100, Andrew Sayers wrote:
> ---
>  libavutil/log.h | 16 +++++++++++++---
>  libavutil/opt.h | 26 +++++++++++++++++++++-----
>  2 files changed, 34 insertions(+), 8 deletions(-)
> 
> diff --git a/libavutil/log.h b/libavutil/log.h
> index ab7ceabe22..88b35897c6 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 facilities and configuration options

Generic logging and options handling facilities.

> + *
> + * Logging and AVOptions functions expect to be passed structs

Logging and options handling functions ...

> + * whose first member is a pointer-to-@ref AVClass.
> + *

> + * Structs that only use logging facilities are often referred to as
> + * "AVClass context structures", while those that provide configuration
> + * options are called "AVOptions-enabled structs".

A struct with an AVClass as its first member can be used for both
logging and options management, there is no difference between the
two. My take:
|Structs that use AVClass might be referred to as AVClass
|contexts/structures, those that in addition define options might be
|called AVOptions contexts/structures.

> + *
> + * @see
> + * * @ref lavu_log
> + * * @ref avoptions
> + * * @ref Context
>   */
>  typedef struct AVClass {
>      /**
> diff --git a/libavutil/opt.h b/libavutil/opt.h
> index 07e27a9208..cdee8f7d28 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.
> + *
> + * Inspection and configuration for AVClass context structures
> + *
> + * Provides a generic API 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 allow access to options in 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,11 +60,20 @@
>   * question is allowed to access the field. This allows us to extend the
>   * semantics of those fields without breaking API compatibility.
>   *

> + * Note that AVOptions is not reentrant, and that many FFmpeg functions access

... AVOptions access is not reeentrant ...

> + * options from separate threads.  Unless otherwise indicated, it is best to
> + * avoid modifying options once a struct has been initialized.

But this note is not relevant to the change, and should probably be
discussed separately

[...]
_______________________________________________
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".