Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Marvin Scholz <epirat07@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Marvin Scholz <epirat07@gmail.com>
Subject: [FFmpeg-devel] [PATCH v3 28/54] avutil/bprint: Improve doxy documentation
Date: Sun, 25 Sep 2022 02:10:55 +0200
Message-ID: <20220925001121.37721-29-epirat07@gmail.com> (raw)
In-Reply-To: <20220925001121.37721-1-epirat07@gmail.com>

Declare proper group, add the file to that group,
group the defines and document them.

Use lists to represents lists of cases.
---
 libavutil/bprint.h | 78 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 55 insertions(+), 23 deletions(-)

diff --git a/libavutil/bprint.h b/libavutil/bprint.h
index c09b1ac1e1..f27d30f723 100644
--- a/libavutil/bprint.h
+++ b/libavutil/bprint.h
@@ -18,6 +18,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+/**
+ * @file
+ * @ingroup lavu_avbprint
+ * AVBPrint public header
+ */
+
 #ifndef AVUTIL_BPRINT_H
 #define AVUTIL_BPRINT_H
 
@@ -26,6 +32,14 @@
 #include "attributes.h"
 #include "avstring.h"
 
+/**
+ * @defgroup lavu_avbprint AVBPrint
+ * @ingroup lavu_data
+ *
+ * A buffer to print data progressively
+ * @{
+ */
+
 /**
  * Define a structure with extra padding to a fixed size
  * This helps ensuring binary compatibility with future versions.
@@ -48,14 +62,14 @@ typedef struct name { \
  * Small buffers are kept in the structure itself, and thus require no
  * memory allocation at all (unless the contents of the buffer is needed
  * after the structure goes out of scope). This is almost as lightweight as
- * declaring a local "char buf[512]".
+ * declaring a local `char buf[512]`.
  *
  * The length of the string can go beyond the allocated size: the buffer is
  * then truncated, but the functions still keep account of the actual total
  * length.
  *
- * In other words, buf->len can be greater than buf->size and records the
- * total length of what would have been to the buffer if there had been
+ * In other words, AVBPrint.len can be greater than AVBPrint.size and records
+ * the total length of what would have been to the buffer if there had been
  * enough memory.
  *
  * Append operations do not need to be tested for failure: if a memory
@@ -63,20 +77,17 @@ typedef struct name { \
  * is still updated. This situation can be tested with
  * av_bprint_is_complete().
  *
- * The size_max field determines several possible behaviours:
- *
- * size_max = -1 (= UINT_MAX) or any large value will let the buffer be
- * reallocated as necessary, with an amortized linear cost.
- *
- * size_max = 0 prevents writing anything to the buffer: only the total
- * length is computed. The write operations can then possibly be repeated in
- * a buffer with exactly the necessary size
- * (using size_init = size_max = len + 1).
- *
- * size_max = 1 is automatically replaced by the exact size available in the
- * structure itself, thus ensuring no dynamic memory allocation. The
- * internal buffer is large enough to hold a reasonable paragraph of text,
- * such as the current paragraph.
+ * The AVBPrint.size_max field determines several possible behaviours:
+ * - `size_max = -1` (= `UINT_MAX`) or any large value will let the buffer be
+ *   reallocated as necessary, with an amortized linear cost.
+ * - `size_max = 0` prevents writing anything to the buffer: only the total
+ *   length is computed. The write operations can then possibly be repeated in
+ *   a buffer with exactly the necessary size
+ *   (using `size_init = size_max = len + 1`).
+ * - `size_max = 1` is automatically replaced by the exact size available in the
+ *   structure itself, thus ensuring no dynamic memory allocation. The
+ *   internal buffer is large enough to hold a reasonable paragraph of text,
+ *   such as the current paragraph.
  */
 
 FF_PAD_STRUCTURE(AVBPrint, 1024,
@@ -88,12 +99,31 @@ FF_PAD_STRUCTURE(AVBPrint, 1024,
 )
 
 /**
+ * @name Max size special values
  * Convenience macros for special values for av_bprint_init() size_max
  * parameter.
+ * @{
+ */
+
+/**
+ * Buffer will be reallocated as necessary, with an amortized linear cost.
  */
 #define AV_BPRINT_SIZE_UNLIMITED  ((unsigned)-1)
+/**
+ * Use the exact size available in the AVBPrint structure itself.
+ *
+ * Thus ensuring no dynamic memory allocation. The internal buffer is large
+ * enough to hold a reasonable paragraph of text, such as the current paragraph.
+ */
 #define AV_BPRINT_SIZE_AUTOMATIC  1
+/**
+ * Do not write anything to the buffer, only calculate the total length.
+ *
+ * The write operations can then possibly be repeated in a buffer with
+ * exactly the necessary size (using `size_init = size_max = AVBPrint.len + 1`).
+ */
 #define AV_BPRINT_SIZE_COUNT_ONLY 0
+/** @} */
 
 /**
  * Init a print buffer.
@@ -101,12 +131,12 @@ FF_PAD_STRUCTURE(AVBPrint, 1024,
  * @param buf        buffer to init
  * @param size_init  initial size (including the final 0)
  * @param size_max   maximum size;
- *                   0 means do not write anything, just count the length;
- *                   1 is replaced by the maximum value for automatic storage;
- *                   any large value means that the internal buffer will be
- *                   reallocated as needed up to that limit; -1 is converted to
- *                   UINT_MAX, the largest limit possible.
- *                   Check also AV_BPRINT_SIZE_* macros.
+ *                   - `0` means do not write anything, just count the length
+ *                   - `1` is replaced by the maximum value for automatic storage
+ *                       any large value means that the internal buffer will be
+ *                       reallocated as needed up to that limit
+ *                   - `-1` is converted to `UINT_MAX`, the largest limit possible.
+ *                   Check also `AV_BPRINT_SIZE_*` macros.
  */
 void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max);
 
@@ -216,4 +246,6 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str);
 void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars,
                       enum AVEscapeMode mode, int flags);
 
+/** @} */
+
 #endif /* AVUTIL_BPRINT_H */
-- 
2.37.0 (Apple Git-136)

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

  parent reply	other threads:[~2022-09-25  0:15 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  2:03 [FFmpeg-devel] [PATCH v2 1/7] avcodec: Fix Doxygen trailing brief comments Marvin Scholz
2022-09-22  2:03 ` [FFmpeg-devel] [PATCH v2 2/7] avdevice/avdevice: Fix mismatching argument name Marvin Scholz
2022-09-23  7:32   ` Michael Niedermayer
2022-09-22  2:03 ` [FFmpeg-devel] [PATCH v2 3/7] avformat/avformat: Fix mismatching argument names Marvin Scholz
2022-09-23  7:30   ` Michael Niedermayer
2022-09-22  2:03 ` [FFmpeg-devel] [PATCH v2 4/7] avutil: " Marvin Scholz
2022-09-23  7:28   ` Michael Niedermayer
2022-09-22  2:03 ` [FFmpeg-devel] [PATCH v2 5/7] swresample/swresample: " Marvin Scholz
2022-09-23  7:27   ` Michael Niedermayer
2022-09-22  2:03 ` [FFmpeg-devel] [PATCH v2 6/7] avformat/avformat: Improve doxy style Marvin Scholz
2022-09-22  2:04 ` [FFmpeg-devel] [PATCH v2 7/7] avcodec/avcodec: Escape Doxygen reference Marvin Scholz
2022-09-23  7:32 ` [FFmpeg-devel] [PATCH v2 1/7] avcodec: Fix Doxygen trailing brief comments Michael Niedermayer
2022-09-25  0:10 ` [FFmpeg-devel] [PATCH v3 00/54] Various Doxygen fixes Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 01/54] avcodec: Fix Doxygen trailing brief comments Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 02/54] avdevice/avdevice: Fix mismatching argument name Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 03/54] avformat/avformat: Fix mismatching argument names Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 04/54] avutil: " Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 05/54] swresample/swresample: " Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 06/54] avformat/avformat: Improve doxy style Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 07/54] avcodec/avcodec: Escape Doxygen reference Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 08/54] avutil/channel_layout: Remove bogus closing group Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 09/54] avutil/channel_layout: Move to its own group Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 10/54] avutil/channel_layout: Group deprecated functions Marvin Scholz
2022-10-16 13:11     ` Anton Khirnov
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 11/54] avutil/channel_layout: Group pre-defined channel layouts Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 12/54] avutil/twofish: Fix doxy @param typo Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 13/54] avcodec/vdpau: Fix doxy comment typo Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 14/54] avcodec/codec_par: Add missing doxy group opening Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 15/54] avcodec/videotoolbox: Add proper doxy group Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 16/54] avutil/aes_ctr: " Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 17/54] avutil/display: consolidate group doxy Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 18/54] avutil/display: Add file to doxy group Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 19/54] avutil/spherical: consolidate group doxy Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 20/54] avutil/spherical: Add file to doxy group Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 21/54] avutil/stereo3d: consolidate group doxy Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 22/54] avutil/stereo3d: Add file to doxy group Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 23/54] avutil/csp: Fix bogus doxy filename Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 24/54] swscale: Fix bogus doxy comment #ifdefs Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 25/54] avcodec/mediacodec: use inline code for coderefs Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 26/54] avcodec/mediacodec: link to related documentation Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 27/54] doc/Doxyfile: Add FF_PAD_STRUCTURE to PREDEFINED Marvin Scholz
2022-09-25  0:10   ` Marvin Scholz [this message]
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 29/54] swresample: Fix Doxy reference to AVOptions Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 30/54] avutil/camellia: Fix doxy @param typo Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 31/54] avutil/channel_layout: Use inline code for Doxy Marvin Scholz
2022-09-25  0:10   ` [FFmpeg-devel] [PATCH v3 32/54] avutil/channel_layout: Document missing arguments Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 33/54] avfilter: Fix doxy references Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 34/54] avformat/avio: Add doxy for missing argument Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 35/54] avutil/detection_bbox: " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 36/54] avutil/eval: Add doxy for missing arguments Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 37/54] avutil/file: " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 38/54] avutil/lfg: Add doxy for missing argument Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 39/54] avutil/lfg: Minor doxy improvements Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 40/54] avutil/hwcontext: Add doxy for missing argument Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 41/54] avutil/parseutils: Add doxy for missing arguments Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 42/54] avutil/parseutils: Use inline code and properly escape Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 43/54] avutil/uuid: Remove bogus doxy return doc Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 44/54] avutil/rc4: Add doxy for missing arguments Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 45/54] avutil/frame: Add doxy for missing argument Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 46/54] avutil/avstring: " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 47/54] avutil/des: Add doxy for missing arguments Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 48/54] avutil/crc: " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 49/54] avutil/imgutils: document some " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 50/54] swscale: " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 51/54] avcodec/bsf: document " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 52/54] avutil/aes: document some " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 53/54] avutil/aes_ctr: " Marvin Scholz
2022-09-25  0:11   ` [FFmpeg-devel] [PATCH v3 54/54] avutil/samplefmt: document missing argument Marvin Scholz
2022-10-17  8:48   ` [FFmpeg-devel] [PATCH v3 00/54] Various Doxygen fixes Anton Khirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220925001121.37721-29-epirat07@gmail.com \
    --to=epirat07@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git