summaryrefslogtreecommitdiff
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2021-10-18 00:35:48 +0300
committerJan Ekström <jeebjp@gmail.com>2021-10-24 13:04:39 +0300
commit682bafdb12507ec8b049ecbbe2e48bf814927002 (patch)
treec2e7df981e2c02d9f5013d8f2d2242f131bfad77 /libavformat/avio.h
parenta5622ed16f8e22a80cecd8936799e61f61a74cd5 (diff)
downloadffmpeg-682bafdb12507ec8b049ecbbe2e48bf814927002.tar.gz
avformat/avio{,buf}: introduce public AVIOContext::bytes_{read,written}
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.
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 5e60c2e35c..cd63322a62 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -292,7 +292,9 @@ typedef struct AVIOContext {
#if FF_API_AVIOCONTEXT_WRITTEN
/**
- * @deprecated field utilized privately by libavformat.
+ * @deprecated field utilized privately by libavformat. For a public
+ * statistic of how many bytes were written out, see
+ * AVIOContext::bytes_written.
*/
attribute_deprecated
int64_t written;
@@ -303,6 +305,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;
/**