From 9a92aea27bad2f5603ca85e0d0716c679a6b686c Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Thu, 11 Oct 2012 15:08:04 +0300 Subject: avutil: Add functions for allocating opaque contexts for algorithms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current API where the plain size is exposed is not of much use - in most cases it is allocated dynamically anyway. If allocated e.g. on the stack via an uint8_t array, there's no guarantee that the struct's members are aligned properly (unless the array is overallocated and the opaque pointer within it manually aligned to some unspecified alignment). Signed-off-by: Martin Storsjö --- libavutil/tree.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libavutil/tree.h') diff --git a/libavutil/tree.h b/libavutil/tree.h index 59ea01dbdb..623280f2b2 100644 --- a/libavutil/tree.h +++ b/libavutil/tree.h @@ -27,6 +27,9 @@ #ifndef AVUTIL_TREE_H #define AVUTIL_TREE_H +#include "attributes.h" +#include "version.h" + /** * @addtogroup lavu_tree AVTree * @ingroup lavu_data @@ -40,7 +43,14 @@ struct AVTreeNode; -extern const int av_tree_node_size; +#if FF_API_CONTEXT_SIZE +extern attribute_deprecated const int av_tree_node_size; +#endif + +/** + * Allocate an AVTreeNode. + */ +struct AVTreeNode *av_tree_node_alloc(void); /** * Find an element. -- cgit v1.2.3