From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter Date: Wed, 24 Aug 2022 17:59:22 +0200 Message-ID: <DB6PR0101MB2214BACAB8513F90E0B7ABFB8F739@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com> (raw) In-Reply-To: <20220824151828.24218-1-george@nsup.org> Nicolas George: > The actual implementation, tests and uses in the rest of > FFmpeg code will be committed separately once the API is > settled. > I think you misunderstood JB: He did not say that the headers are pushed without the implementation, he just said that the headers should be discussed and approved before you code the actual implementation: > > You provide a full header and documentation, and then get it discussed. > When there is a consensus for approval of the headers, then, you can code the core of it that matches the headers. > That avoids the "I spent time for nothing" issue. > diff --git a/libavutil/writer.h b/libavutil/writer.h > new file mode 100644 > index 0000000000..55e2cf3ea6 > --- /dev/null > +++ b/libavutil/writer.h > @@ -0,0 +1,484 @@ > +/* > + * Copyright (c) 2022 The FFmpeg project > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#ifndef AVUTIL_WRITER_H > +#define AVUTIL_WRITER_H > + > +#include <stdio.h> > +#include <stddef.h> > +#include <stdarg.h> > + > +#include "extendable.h" Where is this header? > +#include "bprint.h" > + > +/** > + * @defgroup av_writer AVWriter > + * > + * Object-oriented API to write strings and binary data. > + * > + * @{ > + */ > + > +typedef struct AVWriterMethods AVWriterMethods; > + > +/** > + * Opaque object to write strings and binary data. > + * > + * AVWriter is meant to allow to build and return strings (and blocks of > + * binary data) efficiently between functions. > + * For example, a function that serialize something into a string will > + * actually write into an AVWriter, and the caller will choose the way the > + * data will be stored or processed on the fly. > + * > + * For a quick introduction on how to use AVWriter in simple cases, see > + * doc/avwriter_intro.md. > + * > + * There are various pre-defined types of AVWriter, see below: > + * > + * - av_dynbuf_writer() writes the data into a buffer that is grown with > + * av_realloc() if it does not fit in the initial buffer; it is the > + * recommended choice. > + * > + * - av_buf_writer() writes the data into a pre-existing finite buffer. > + * > + * - av_stdio_writer() writes the data into a FILE*. > + * > + * - av_log_writer() writes the data to av_log(). > + * > + * AVWriter objects are passed by value. It allows creating a writer on the > + * fly, without extra variable or error checking. The structure can never > + * change. > + */ > +typedef struct AVWriter { > + const AVWriterMethods *methods; > + void *obj; > +} AVWriter; > + > +/** > + * Write a data buffer to an AVWriter. > + */ > +void av_writer_write(AVWriter wr, const char *buf, size_t size); > + > +/** > + * Write a 0-terminated string to an AVWriter. > + */ > +void av_writer_print(AVWriter wr, const char *str); > + > +/** > + * Write a formatted string to an AVWriter. > + * Note: do not use libc-specific extensions to the format string. > + */ > +void av_writer_printf(AVWriter wr, const char *fmt, ...); > + > +/** > + * Write a formatted to string an AVWriter using a va_list. s/to string/string to/ > + */ > +void av_writer_vprintf(AVWriter wr, const char *fmt, va_list va); _______________________________________________ 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".
next prev parent reply other threads:[~2022-08-24 15:59 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-24 15:18 Nicolas George 2022-08-24 15:45 ` Soft Works 2022-08-24 15:59 ` Andreas Rheinhardt [this message] 2022-08-24 16:01 ` Nicolas George 2022-08-30 17:08 ` Nicolas George 2022-08-30 19:33 ` Leo Izen 2022-08-30 19:37 ` Nicolas George 2022-08-31 3:13 ` Leo Izen 2022-08-31 3:23 ` Andreas Rheinhardt 2022-08-31 19:28 ` Nicolas George 2022-08-31 23:03 ` Stefano Sabatini 2022-09-01 13:01 ` Nicolas George 2022-09-01 21:33 ` Stefano Sabatini 2022-09-02 6:41 ` Anton Khirnov 2022-09-07 13:30 ` Nicolas George 2022-09-07 20:05 ` Jean-Baptiste Kempf 2022-09-07 21:13 ` Nicolas George 2022-09-08 16:18 ` Anton Khirnov 2022-09-14 21:29 ` Michael Niedermayer 2023-04-25 17:11 ` Nicolas George 2023-04-25 17:20 ` James Almer 2023-04-28 10:00 ` Nicolas George 2023-04-26 9:05 ` Anton Khirnov 2023-04-28 9:58 ` Nicolas George
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=DB6PR0101MB2214BACAB8513F90E0B7ABFB8F739@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com \ --to=andreas.rheinhardt@outlook.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