From f40bfc9267b13b54e6379dfe7539447662879d24 Mon Sep 17 00:00:00 2001 From: Sean Bartell Date: Sat, 25 Jun 2011 21:32:25 -0400 Subject: Add codecs to librbcodec. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97 Reviewed-on: http://gerrit.rockbox.org/137 Reviewed-by: Nils Wallménius Tested-by: Nils Wallménius --- lib/rbcodec/codecs/libspeex/rockbox.h | 119 ++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 lib/rbcodec/codecs/libspeex/rockbox.h (limited to 'lib/rbcodec/codecs/libspeex/rockbox.h') diff --git a/lib/rbcodec/codecs/libspeex/rockbox.h b/lib/rbcodec/codecs/libspeex/rockbox.h new file mode 100644 index 0000000000..459c8b532f --- /dev/null +++ b/lib/rbcodec/codecs/libspeex/rockbox.h @@ -0,0 +1,119 @@ +/************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2007 Dan Everton + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * 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 + +/* We don't want all this stuff if we're building encoder */ +#ifndef ROCKBOX_VOICE_ENCODER + +#include "codeclib.h" +#include "debug.h" + +#if !defined(ROCKBOX_VOICE_CODEC) + +#if defined(DEBUG) || defined(SIMULATOR) +#undef DEBUGF +#define DEBUGF ci->debugf +#endif + + +#ifdef ROCKBOX_HAS_LOGF +#undef LOGF +#define LOGF ci->logf +#endif + +#endif /* ROCKBOX_VOICE_CODEC */ + +#define OVERRIDE_SPEEX_ALLOC 1 +static inline void *speex_alloc (int size) +{ + return codec_calloc(size, 1); +} + +#define OVERRIDE_SPEEX_ALLOC_SCRATCH 1 +static inline void *speex_alloc_scratch (int size) +{ + return codec_calloc(size,1); +} + +#define OVERRIDE_SPEEX_REALLOC 1 +static inline void *speex_realloc (void *ptr, int size) +{ + return codec_realloc(ptr, size); +} + +#define OVERRIDE_SPEEX_FREE 1 +static inline void speex_free (void *ptr) +{ + codec_free(ptr); +} + +#define OVERRIDE_SPEEX_FREE_SCRATCH 1 +static inline void speex_free_scratch (void *ptr) +{ + codec_free(ptr); +} + +#define OVERRIDE_SPEEX_FATAL 1 +static inline void _speex_fatal(const char *str, const char *file, int line) +{ + (void)str; + (void)file; + (void)line; + DEBUGF("Fatal error: %s\n", str); + //exit(1); +} + +#define OVERRIDE_SPEEX_WARNING 1 +static inline void speex_warning(const char *str) +{ + (void)str; + DEBUGF("warning: %s\n", str); +} + +#define OVERRIDE_SPEEX_WARNING_INT 1 +static inline void speex_warning_int(const char *str, int val) +{ + (void)str; + (void)val; + DEBUGF("warning: %s %d\n", str, val); +} + +#define OVERRIDE_SPEEX_NOTIFY 1 +static inline void speex_notify(const char *str) +{ + (void)str; + DEBUGF("notice: %s\n", str); +} + +#define OVERRIDE_SPEEX_PUTC 1 +static inline void _speex_putc(int ch, void *file) +{ + (void)ch; + (void)file; + //FILE *f = (FILE *)file; + //printf("%c", ch); +} + +#endif /* ROCKBOX_VOICE_ENCODER */ + +#endif + -- cgit v1.2.3