1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avutil: Add functions for allocating opaque contexts for algorithms

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ö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2012-10-11 15:08:04 +03:00
parent fb32f31af7
commit 9a92aea27b
10 changed files with 78 additions and 5 deletions

View File

@ -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.