diff options
| author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-09 20:40:24 +0200 |
|---|---|---|
| committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-09 20:40:24 +0200 |
| commit | 1836b8ffe31f393d256c8021aaf7a2308561a0c2 (patch) | |
| tree | 6a80efd3b4ed8a29d55a7b331a43ac7bd5ed4855 /contrib/ffmpeg/libavutil/mem.h | |
| parent | a89f36b0b3e9008cd7f8378e4fa40a3c37d7a23e (diff) | |
| parent | 199dc87abe65001f7ef9ec56bca7c3d80af39bcf (diff) | |
| download | xine-lib-1836b8ffe31f393d256c8021aaf7a2308561a0c2.tar.gz xine-lib-1836b8ffe31f393d256c8021aaf7a2308561a0c2.tar.bz2 | |
Merge the FFmpeg integration branch into the nopadding branch.
Diffstat (limited to 'contrib/ffmpeg/libavutil/mem.h')
| -rw-r--r-- | contrib/ffmpeg/libavutil/mem.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/contrib/ffmpeg/libavutil/mem.h b/contrib/ffmpeg/libavutil/mem.h new file mode 100644 index 000000000..4ebdad8f5 --- /dev/null +++ b/contrib/ffmpeg/libavutil/mem.h @@ -0,0 +1,65 @@ +/* + * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file mem.h + * Memory handling functions. + */ + +#ifndef AV_MEM_H +#define AV_MEM_H + +#ifdef __GNUC__ + #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n))) +#else + #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v +#endif + +/** + * Memory allocation of size byte with alignment suitable for all + * memory accesses (including vectors if available on the + * CPU). av_malloc(0) must return a non NULL pointer. + */ +void *av_malloc(unsigned int size); + +/** + * av_realloc semantics (same as glibc): if ptr is NULL and size > 0, + * identical to malloc(size). If size is zero, it is identical to + * free(ptr) and NULL is returned. + */ +void *av_realloc(void *ptr, unsigned int size); + +/** + * Free memory which has been allocated with av_malloc(z)() or av_realloc(). + * NOTE: ptr = NULL is explicetly allowed + * Note2: it is recommended that you use av_freep() instead + */ +void av_free(void *ptr); + +void *av_mallocz(unsigned int size); +char *av_strdup(const char *s); + +/** + * Frees memory and sets the pointer to NULL. + * @param ptr pointer to the pointer which should be freed + */ +void av_freep(void *ptr); + +#endif /* AV_MEM_H */ |
