summaryrefslogtreecommitdiff
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorsoftworkz <softworkz@hotmail.com>2017-01-05 01:33:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-01-07 13:04:05 +0100
commit9488032e10b744335059b48e7a134efd5d9359c3 (patch)
tree765159ddabd70f2bb20dac7658a50a8088e4ac6b /libavformat/avio.h
parent90ac9f4094afc2aa7ee64a7b02df8fb05cbd7d8a (diff)
downloadffmpeg-9488032e10b744335059b48e7a134efd5d9359c3.tar.gz
libavformat/avio: Add avio_get_dyn_buf function
This commit adds the avio_get_dyn_buf function which allows accessing the content of a DynBuffer without destroying it. This is required in matroskaenc for preliminary writing (correct) mkv headers. Context for this change is fixing regression bug #5977. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index b1ce1d1c72..e2cb4af7a2 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -704,6 +704,18 @@ int avio_closep(AVIOContext **s);
int avio_open_dyn_buf(AVIOContext **s);
/**
+ * Return the written size and a pointer to the buffer.
+ * The AVIOContext stream is left intact.
+ * The buffer must NOT be freed.
+ * No padding is added to the buffer.
+ *
+ * @param s IO context
+ * @param pbuffer pointer to a byte buffer
+ * @return the length of the byte buffer
+ */
+int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
+
+/**
* Return the written size and a pointer to the buffer. The buffer
* must be freed with av_free().
* Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer.