[FFmpeg-devel] [PATCH v2 2/3] avformat/avio{, buf}: introduce public AVIOContext::bytes_{read, written}
Michael Niedermayer
michael at niedermayer.cc
Fri Oct 15 16:09:35 EEST 2021
On Thu, Oct 14, 2021 at 12:10:37AM +0300, Jan Ekström wrote:
> Such fields can be seen as generally useful in cases where the
> API user is not implementing custom AVIO callbacks, but still would
> like to know if data is being read or written out, such as in case
> data is being read from input but no AVPacket has been received yet.
> ---
> doc/APIchanges | 3 +++
> libavformat/avio.h | 10 ++++++++++
> libavformat/aviobuf.c | 4 +++-
> libavformat/version.h | 2 +-
> 4 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 7b267a79ac..806eaf4c83 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -14,6 +14,9 @@ libavutil: 2021-04-27
>
> API changes, most recent first:
>
> +2021-09-26 - xxxxxxxxxx - lavf 59.7.100 - avio.h
> + Introduce public bytes_{read,written} statistic fields to AVIOContext.
> +
> 2021-09-21 - xxxxxxxxxx - lavu 57.7.100 - pixfmt.h
> Add AV_PIX_FMT_X2BGR10.
>
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index a7b56ab667..0f9a0f909f 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -297,6 +297,16 @@ typedef struct AVIOContext {
> * used keeping track of already written data for a later flush.
> */
> unsigned char *buf_ptr_max;
> +
> + /**
> + * Read-only statistic of bytes read for this AVIOContext.
> + */
> + int64_t bytes_read;
> +
> + /**
> + * Read-only statistic of bytes written for this AVIOContext.
> + */
> + int64_t bytes_written;
> } AVIOContext;
ok
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20211015/4026f227/attachment.sig>
More information about the ffmpeg-devel
mailing list