virtualx-engine/thirdparty/speex/speex_bind.cpp
Rémi Verschelde 995dcb610c ogg/vorbis/opus/speex: Make them modules and unbundle thirdparty libs
Took the opportunity to undo the Godot changed made to the
opus source. The opus module should eventually be built in its
own environment to avoid polluting others with too many include
dirs and defines.

TODO: Fix the platform/ stuff for opus.
(cherry picked from commit d9a291f641)

speex module was only added while cherry-picking, as speex is removed
in the master branch but we don't want to break compatibility in 2.1.x.
Unbundling wasn't done as the module uses the internal speex_free,
so it would require some more work.
2016-10-30 14:51:31 +01:00

64 lines
945 B
C++

#include "memory.h"
#include "speex_bind.h"
#include
#ifdef __cplusplus
extern "C" {
#endif
void *speex_alloc (int size) {
uint8_t * mem = (uint8_t*)memalloc(size);
for(int i=0;i<size;i++)
mem[i]=0;
return mem;
}
void *speex_alloc_scratch (int size) {
return memalloc(size);
}
void *speex_realloc (void *ptr, int size) {
return memrealloc(ptr,size);
}
void speex_free (void *ptr) {
memfree(ptr);
}
void speex_free_scratch (void *ptr) {
memfree(ptr);
}
void _speex_fatal(const char *str, const char *file, int line) {
_err_print_error("SPEEX ERROR",p_file,p_line,str);
}
void speex_warning(const char *str) {
_err_print_error("SPEEX WARNING","",0,str);
}
void speex_warning_int(const char *str, int val) {
_err_print_error("SPEEX WARNING INT","Value",val,str);
}
void speex_notify(const char *str) {
print_line(str);
}
void _speex_putc(int ch, void *file) {
// will not putc, no.
}
#ifdef __cplusplus
}
#endif