summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libspeex/rockbox.h
blob: 459c8b532f0fa2d75ff86a9cca4877da2edf9c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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