summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libspeex/rockbox.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libspeex/rockbox.h')
-rw-r--r--lib/rbcodec/codecs/libspeex/rockbox.h119
1 files changed, 119 insertions, 0 deletions
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 @@
1/**************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 Dan Everton
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ***************************************************************************/
20
21#ifndef SPEEX_ROCKBOX_H
22#define SPEEX_ROCKBOX_H
23
24/* We don't want all this stuff if we're building encoder */
25#ifndef ROCKBOX_VOICE_ENCODER
26
27#include "codeclib.h"
28#include "debug.h"
29
30#if !defined(ROCKBOX_VOICE_CODEC)
31
32#if defined(DEBUG) || defined(SIMULATOR)
33#undef DEBUGF
34#define DEBUGF ci->debugf
35#endif
36
37
38#ifdef ROCKBOX_HAS_LOGF
39#undef LOGF
40#define LOGF ci->logf
41#endif
42
43#endif /* ROCKBOX_VOICE_CODEC */
44
45#define OVERRIDE_SPEEX_ALLOC 1
46static inline void *speex_alloc (int size)
47{
48 return codec_calloc(size, 1);
49}
50
51#define OVERRIDE_SPEEX_ALLOC_SCRATCH 1
52static inline void *speex_alloc_scratch (int size)
53{
54 return codec_calloc(size,1);
55}
56
57#define OVERRIDE_SPEEX_REALLOC 1
58static inline void *speex_realloc (void *ptr, int size)
59{
60 return codec_realloc(ptr, size);
61}
62
63#define OVERRIDE_SPEEX_FREE 1
64static inline void speex_free (void *ptr)
65{
66 codec_free(ptr);
67}
68
69#define OVERRIDE_SPEEX_FREE_SCRATCH 1
70static inline void speex_free_scratch (void *ptr)
71{
72 codec_free(ptr);
73}
74
75#define OVERRIDE_SPEEX_FATAL 1
76static inline void _speex_fatal(const char *str, const char *file, int line)
77{
78 (void)str;
79 (void)file;
80 (void)line;
81 DEBUGF("Fatal error: %s\n", str);
82 //exit(1);
83}
84
85#define OVERRIDE_SPEEX_WARNING 1
86static inline void speex_warning(const char *str)
87{
88 (void)str;
89 DEBUGF("warning: %s\n", str);
90}
91
92#define OVERRIDE_SPEEX_WARNING_INT 1
93static inline void speex_warning_int(const char *str, int val)
94{
95 (void)str;
96 (void)val;
97 DEBUGF("warning: %s %d\n", str, val);
98}
99
100#define OVERRIDE_SPEEX_NOTIFY 1
101static inline void speex_notify(const char *str)
102{
103 (void)str;
104 DEBUGF("notice: %s\n", str);
105}
106
107#define OVERRIDE_SPEEX_PUTC 1
108static inline void _speex_putc(int ch, void *file)
109{
110 (void)ch;
111 (void)file;
112 //FILE *f = (FILE *)file;
113 //printf("%c", ch);
114}
115
116#endif /* ROCKBOX_VOICE_ENCODER */
117
118#endif
119