diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 17:02:23 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 17:02:27 +0400 |
commit | 8878aef04882f1bb6db9f56a2b228865e1c2bb75 (patch) | |
tree | 468edd2d79b78c56fda6a5119009ba56e7ce699d /libavformat/avio_internal.h | |
parent | 7ed002d79136c2e24d12b432852a271b235fc3b9 (diff) | |
parent | daf1e0d3de03bd424016e2a7520e4e94ece5c0ac (diff) |
Merge commit 'daf1e0d3de03bd424016e2a7520e4e94ece5c0ac'
* commit 'daf1e0d3de03bd424016e2a7520e4e94ece5c0ac':
avio: Add an internal function for reading without copying
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avio_internal.h')
-rw-r--r-- | libavformat/avio_internal.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index 311e297e9a..4f4a428a4c 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -38,6 +38,23 @@ int ffio_init_context(AVIOContext *s, /** + * Read size bytes from AVIOContext, returning a pointer. + * Note that the data pointed at by the returned pointer is only + * valid until the next call that references the same IO context. + * @param s IO context + * @param buf pointer to buffer into which to assemble the requested + * data if it is not available in contiguous addresses in the + * underlying buffer + * @param size number of bytes requested + * @param data address at which to store pointer: this will be a + * a direct pointer into the underlying buffer if the requested + * number of bytes are available at contiguous addresses, otherwise + * will be a copy of buf + * @return number of bytes read or AVERROR + */ +int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data); + +/** * Read size bytes from AVIOContext into buf. * This reads at most 1 packet. If that is not enough fewer bytes will be * returned. |