diff options
author | Martin Storsjö <martin@martin.st> | 2012-10-11 15:08:04 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-10-11 23:35:27 +0300 |
commit | 9a92aea27bad2f5603ca85e0d0716c679a6b686c (patch) | |
tree | a38dae27b4c15cc4a75c0a3745351b8c5b3fd122 /libavutil/md5.h | |
parent | fb32f31af76ce784c86c59c86c28e5653e223610 (diff) | |
download | ffmpeg-9a92aea27bad2f5603ca85e0d0716c679a6b686c.tar.gz |
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>
Diffstat (limited to 'libavutil/md5.h')
-rw-r--r-- | libavutil/md5.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavutil/md5.h b/libavutil/md5.h index c5b858a24b..29e4e7c2ba 100644 --- a/libavutil/md5.h +++ b/libavutil/md5.h @@ -23,16 +23,22 @@ #include <stdint.h> +#include "attributes.h" +#include "version.h" + /** * @defgroup lavu_md5 MD5 * @ingroup lavu_crypto * @{ */ -extern const int av_md5_size; +#if FF_API_CONTEXT_SIZE +extern attribute_deprecated const int av_md5_size; +#endif struct AVMD5; +struct AVMD5 *av_md5_alloc(void); void av_md5_init(struct AVMD5 *ctx); void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len); void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); |