[FFmpeg-devel] [PATCH 1/3] xtea: add API to allow allocating the context independant of the internal implementation.

Michael Niedermayer michaelni at gmx.at
Tue Sep 11 05:20:46 CEST 2012


The struct could be moved into xtea.c, theres no need to keep it in the header.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavutil/xtea.c |    2 ++
 libavutil/xtea.h |    8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/libavutil/xtea.c b/libavutil/xtea.c
index 0a5df1c..6301b18 100644
--- a/libavutil/xtea.c
+++ b/libavutil/xtea.c
@@ -27,6 +27,8 @@
 #include "common.h"
 #include "xtea.h"
 
+const int av_xtea_size = sizeof(AVXTEA);
+
 void av_xtea_init(AVXTEA *ctx, const uint8_t key[16])
 {
     int i;
diff --git a/libavutil/xtea.h b/libavutil/xtea.h
index 17fb47a..7313fb7 100644
--- a/libavutil/xtea.h
+++ b/libavutil/xtea.h
@@ -30,6 +30,14 @@
  * @{
  */
 
+extern const int av_xtea_size;
+
+/**
+ * AVXTEA context.
+ * the size of this structure and its layout are not part of the public API/ABI
+ * of xtea. Please use av_xtea_size for allocating this structure from outside
+ * libavutil.
+ */
 typedef struct AVXTEA {
     uint32_t key[16];
 } AVXTEA;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list