aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/internal.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-27 19:36:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-27 19:57:52 +0200
commite36db49b7b31cb17912895cb4d95b7b45d6f0882 (patch)
treee8cb205407627584f9d9eb6563a02dac3c4cfbd8 /libavcodec/internal.h
parent59216e0525a58714be4207be6ae8744750e62867 (diff)
downloadffmpeg-e36db49b7b31cb17912895cb4d95b7b45d6f0882.tar.gz
avcodec: Add a min size parameter to ff_alloc_packet2()
This parameter can be used to inform the allocation code about how much downsizing might occur, and can be used to optimize how to allocate the packet Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/internal.h')
-rw-r--r--libavcodec/internal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index e0b40f1cc4..1a15e6b443 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -217,9 +217,13 @@ int avpriv_unlock_avformat(void);
* avpkt->size is set to the specified size.
* All other AVPacket fields will be reset with av_init_packet().
* @param size the minimum required packet size
+ * @param min_size the smallest the packet might be down sized to, can be set to
+ * 0, setting this roughly correctly allows the allocation code
+ * to choose between several allocation stragies to improve
+ * speed slightly.
* @return non negative on success, negative error code on failure
*/
-int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size);
+int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size);
int ff_alloc_packet(AVPacket *avpkt, int size);