mbox series

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

Message ID 20211018124723.11497-1-jeebjp@gmail.com
Headers show
Series introduce public AVIOContext::bytes_{read, written}
Related show

Message

Jan Ekström Oct. 18, 2021, 12:47 p.m. UTC
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

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

 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(-)

Comments

Jan Ekström Oct. 24, 2021, 10:10 a.m. UTC | #1
On Mon, Oct 18, 2021 at 3:47 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> 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
>

Thanks for the comments, applied the set as
d39b58dc32b5fc7b480eeb9ef00a610732f02c2c
a5622ed16f8e22a80cecd8936799e61f61a74cd5
682bafdb12507ec8b049ecbbe2e48bf814927002

with one minor change, "point of truth" -> "source of truth" in the
first commit.

Jan