diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-10-19 21:10:25 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-10-19 21:10:25 +0000 |
commit | 56db5597548d0e9b9733b556a5c14ab4e38547e6 (patch) | |
tree | 8846e7d3a15f264853e6ee238994e3522e3bcc5a /apps/codecs/libspeex/rockbox.h | |
parent | 6dc3a743addde6146b736ec5e1c71159c2150f95 (diff) | |
download | rockbox-56db5597548d0e9b9733b556a5c14ab4e38547e6.tar.gz rockbox-56db5597548d0e9b9733b556a5c14ab4e38547e6.zip |
Sync Speex to SVN. Add new header file to adapt to Speex' new way of doing wrapper functions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15209 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex/rockbox.h')
-rw-r--r-- | apps/codecs/libspeex/rockbox.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/apps/codecs/libspeex/rockbox.h b/apps/codecs/libspeex/rockbox.h new file mode 100644 index 0000000000..368f1fb2d2 --- /dev/null +++ b/apps/codecs/libspeex/rockbox.h @@ -0,0 +1,99 @@ +/************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2007 Dan Everton + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ + +#ifndef SPEEX_ROCKBOX_H +#define SPEEX_ROCKBOX_H + +#include "../codec.h" +#include "../lib/codeclib.h" + +#if defined(DEBUG) || defined(SIMULATOR) +#undef DEBUGF +#define DEBUGF ci->debugf +#else +#define DEBUGF(...) +#endif + +#ifdef ROCKBOX_HAS_LOGF +#undef LOGF +#define LOGF ci->logf +#else +#define LOGF(...) +#endif + +extern struct codec_api* ci; + +static inline void *speex_alloc (int size) +{ + return codec_calloc(size, 1); +} + +static inline void *speex_alloc_scratch (int size) +{ + return codec_calloc(size,1); +} + +static inline void *speex_realloc (void *ptr, int size) +{ + return codec_realloc(ptr, size); +} + +static inline void speex_free (void *ptr) +{ + codec_free(ptr); +} + +static inline void speex_free_scratch (void *ptr) +{ + codec_free(ptr); +} + +static inline void *speex_move (void *dest, void *src, int n) +{ + return memmove(dest,src,n); +} + +static inline void _speex_fatal(const char *str, const char *file, int line) +{ + DEBUGF("Fatal error: %s\n", str); + //exit(1); +} + +static inline void speex_warning(const char *str) +{ + DEBUGF("warning: %s\n", str); +} + +static inline void speex_warning_int(const char *str, int val) +{ + DEBUGF("warning: %s %d\n", str, val); +} + +static inline void speex_notify(const char *str) +{ + DEBUGF("notice: %s\n", str); +} + +static inline void _speex_putc(int ch, void *file) +{ + //FILE *f = (FILE *)file; + //printf("%c", ch); +} + +#endif + |