From patchwork Sun Aug 18 11:26:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51066 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:b6ca:0:b0:48e:c0f8:d0de with SMTP id s10csp1374389vqj; Sun, 18 Aug 2024 04:27:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVQrOhHNQVH0DJrsJPp3L80ORTzHinzXIcbJfHufcGjUlm4Z+Ka5FRL4x6hnDosvYoFtLfSB28y32IaBqKEOiDoxQDB4nsXVq5GmQ== X-Google-Smtp-Source: AGHT+IEjHIxya6RQUvwit33Zi8MUTyukgVXMBtOe4o1jrZkzzURTgE/B9FAEDDxUTphPHSMvBJ5x X-Received: by 2002:a2e:be07:0:b0:2ee:5ed4:792f with SMTP id 38308e7fff4ca-2f3be571fecmr67545251fa.2.1723980462128; Sun, 18 Aug 2024 04:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723980462; cv=none; d=google.com; s=arc-20160816; b=uC45OUNTp+R3pLQZyLZpQziKA2VJdkxPV5zo4df4YqqmbKi9cPjvCZVtUI3MgpsN7f s/V5j2EPPRgyyNKu2C1EJkUxsGqhzsPvX6D1egyS7tIUkoED1LIaBjxC1kQ9fJ4OEhWi opQ8YPzxuV5xOomeAbnGGyxsfdosO9ZCWLD4q4aTLptl/pnCUpcwfBS1XnVdG0t4FR9I I9tYdqeaZ9/C0Gnu10ei2v+uUMffT3WazSeB9FBdCWxI16unzjTCYiXQCgUOdkcp+738 Mc3w4xqa9Vz7BmUTCEMIcIgpr5NweMnO/9z4kFAu2ECVpXYQU3tQIsKNHOecUOFll+r7 zMTQ== 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=c336vOZ1WTL15llXOSEdAvFzN/GXolgFSL9M5ZTgmfE=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=KgxIqAl8y2zN01yq0zPNY/14qY9kcPZsS0HNBbTJMMdWED86/6H2PInJb1FQ0UT1Zw /LyY8AeuHf4vuLxZIzwZF49MWl+kbyNIVQzkCgZLTX72zShOjHKDjpHhVq5e7QdOa+uR kbKAYDPVnfJCwSjKZr/2cor1ZuUGKPfA/WmKQ9bfDuTx1I9Y0cgJqa5cqHeBOowV6Hnc ObEBJPyeDttngspa4wGFOL8oF/JhmWgkw2BUo1MNWlVCEq75vK2iEdUU0utod3gWLqfq S+Zsa+W14pX4ZbsjgD7cyNCBXgSC0RkdsROY4tUISSrb6rz5l3hEAZCUwWOr88wBnbp6 sbcQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=gg0wB9qL; 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-2f3b745e438si20045431fa.46.2024.08.18.04.27.41; Sun, 18 Aug 2024 04:27: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=@khirnov.net header.s=mail header.b=gg0wB9qL; 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 548DE68DDB9; Sun, 18 Aug 2024 14:27:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE06968DD45 for ; Sun, 18 Aug 2024 14:27:18 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=gg0wB9qL; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1EB82EFE for ; Sun, 18 Aug 2024 13:27:18 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id t8LEdBB46-se for ; Sun, 18 Aug 2024 13:27:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1723980436; bh=Ekc2FANT4V72NA28kDsTD5iv985YE2Hllvh53MQ4NBs=; h=From:To:Subject:Date:From; b=gg0wB9qL0EgTAYW0dQPj2ib7fVUwD2YqfUPEBDNRiSpfM7uwyEb+Ad6+aADnmbxtR 3fE9KDF9u8rUMzHAGBRaEB+BOhC38qa5sgJFkBJ5lqwk1iBQeUWv0rZQc7yjZ6OfkU 5rv7QmDDcqtatc5eOJl5bnJKzV70+eZks3C931ei/oi70efi2zJEey3YZOmfQTxdZY u8lK4WM12MYDnf3bbiVRqhoIrg5fCcn4JJ2fTyqqufMR6O8wMpWDZ4CAzk8iwR7hAb oOdgPRbxIW9suIf+KOBmqmzx1TRRgNVUmYqd7JMiImikLswUA/Pu6CUXKFRFjP4GfY K/AA0k6JkYW1w== 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 mail1.khirnov.net (Postfix) with ESMTPS id 8C2F84DEE for ; Sun, 18 Aug 2024 13:27:16 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 457A83A02CA for ; Sun, 18 Aug 2024 13:27:10 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Aug 2024 13:26:53 +0200 Message-ID: <20240818112655.18270-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] lavu/opt: document underlying C types for enum AVOptionType 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: MNBpeN9Y30HY --- libavutil/opt.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/libavutil/opt.h b/libavutil/opt.h index 07e27a9208..23bc495158 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -240,26 +240,98 @@ * before the file is actually opened. */ +/** + * An option type determines: + * - for native access, the underlying C type of the field that an AVOption + * refers to; + * - for foreign access, the semantics of accessing the option through this API, + * e.g. which av_opt_get_*() and av_opt_set_*() functions can be called, or + * what format will av_opt_get()/av_opt_set() expect/produce. + */ enum AVOptionType{ + /** + * Underlying C type is unsigned int. + */ AV_OPT_TYPE_FLAGS = 1, + /** + * Underlying C type is int. + */ AV_OPT_TYPE_INT, + /** + * Underlying C type is int64_t. + */ AV_OPT_TYPE_INT64, + /** + * Underlying C type is double. + */ AV_OPT_TYPE_DOUBLE, + /** + * Underlying C type is float. + */ AV_OPT_TYPE_FLOAT, + /** + * Underlying C type is a uint8_t* that is either NULL or points to a C + * string allocated with the av_malloc() family of functions. + */ AV_OPT_TYPE_STRING, + /** + * Underlying C type is AVRational. + */ AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + /** + * Underlying C type is a uint8_t* that is either NULL or points to an array + * allocated with the av_malloc() family of functions. The pointer is + * immediately followed by an int containing the array length in bytes. + */ + AV_OPT_TYPE_BINARY, + /** + * Underlying C type is AVDictionary*. + */ AV_OPT_TYPE_DICT, + /** + * Underlying C type is uint64_t. + */ AV_OPT_TYPE_UINT64, + /** + * Special option type for declaring named constants. Does not correspond to + * an actual field in the object, offset must be 0. + */ AV_OPT_TYPE_CONST, - AV_OPT_TYPE_IMAGE_SIZE, ///< offset must point to two consecutive ints + /** + * Underlying C type is two consecutive integers. + */ + AV_OPT_TYPE_IMAGE_SIZE, + /** + * Underlying C type is enum AVPixelFormat. + */ AV_OPT_TYPE_PIXEL_FMT, + /** + * Underlying C type is enum AVSampleFormat. + */ AV_OPT_TYPE_SAMPLE_FMT, - AV_OPT_TYPE_VIDEO_RATE, ///< offset must point to AVRational + /** + * Underlying C type is AVRational. + */ + AV_OPT_TYPE_VIDEO_RATE, + /** + * Underlying C type is int64_t. + */ AV_OPT_TYPE_DURATION, + /** + * Underlying C type is uint8_t[4]. + */ AV_OPT_TYPE_COLOR, + /** + * Underlying C type is int. + */ AV_OPT_TYPE_BOOL, + /** + * Underlying C type is AVChannelLayout. + */ AV_OPT_TYPE_CHLAYOUT, + /** + * Underlying C type is unsigned int. + */ AV_OPT_TYPE_UINT, /**