[FFmpeg-devel] [PATCH v3 0/3] introduce public AVIOContext::bytes_{read, written}

Jan Ekström jeebjp at gmail.com
Mon Oct 18 15:47:20 EEST 2021

Changes compared to v2:
* Written was actually written_size, so it did not take into account any
  writes after a seek-back. Thus an initial attempt at implementing
  bytes_written was made.

After a brief discussion with Michael on IRC, this seems to be the idea of a
path forward that was agreed upon.

1. AVIOContext::written was supposed to be a private field [1], so move the
   value utilized internally to FFIOContext, and set the AVIOContext value
   from there.
2. Deprecate AVIOContext::written.
3. Introduce public AVIOContext::bytes_{read,written} statistics fields.

I was not sure whether deprecation or straight-out removal was the right thing
to do - since while the field was meant to be internal it was not marked as
such in FFmpeg's merged state of the struct (which is why it did not get
cleaned up into FFIOContext earlier) - but in order to not get stuck on that,
I am now posting this with the full deprecation changes. This way (hopefully)
this change will get more eyeballs and if someone thinks this could just be
removed the patches can be changed to do that instead.

[1] http://git.videolan.org/?p=ffmpeg.git;a=commit;h=3f75e5116b900f1428aa13041fc7d6301bf1988a

Best regards,

Jan Ekström (3):
  avformat/avio: privatize point of truth for AVIOContext::written
  avformat/avio{,buf}: deprecate AVIOContext::written
  avformat/avio{,buf}: introduce public

 doc/APIchanges              |  9 +++++++++
 libavformat/avio.h          | 18 ++++++++++++++++++
 libavformat/avio_internal.h | 11 +++++++++++
 libavformat/aviobuf.c       | 30 ++++++++++++++++++++++++------
 libavformat/version.h       |  5 ++++-
 5 files changed, 66 insertions(+), 7 deletions(-)


More information about the ffmpeg-devel mailing list