mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-06 14:15:29 +01: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:
@@ -23,16 +23,26 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_sha SHA
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_sha_size;
|
||||
#if FF_API_CONTEXT_SIZE
|
||||
extern attribute_deprecated const int av_sha_size;
|
||||
#endif
|
||||
|
||||
struct AVSHA;
|
||||
|
||||
/**
|
||||
* Allocate an AVSHA context.
|
||||
*/
|
||||
struct AVSHA *av_sha_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize SHA-1 or SHA-2 hashing.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user