summaryrefslogtreecommitdiff
path: root/orkbasecxx/filters
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2009-01-10 18:59:09 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2009-01-10 18:59:09 +0000
commit650105c2e53d80741292d2752cb48b3d9625ca09 (patch)
tree201b2c042ba789958a9b0a643b423ba10d0483f6 /orkbasecxx/filters
parent99a4b62e59b63bfd232ace0b3768e10e0f47ceb3 (diff)
Made modifications to have G722 decoder compile in Windows.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@592 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/filters')
-rw-r--r--orkbasecxx/filters/g722codec/G722.h8
-rw-r--r--orkbasecxx/filters/g722codec/G722Codec.cpp23
2 files changed, 25 insertions, 6 deletions
diff --git a/orkbasecxx/filters/g722codec/G722.h b/orkbasecxx/filters/g722codec/G722.h
index 156d3de..d7a4a80 100644
--- a/orkbasecxx/filters/g722codec/G722.h
+++ b/orkbasecxx/filters/g722codec/G722.h
@@ -143,10 +143,16 @@ typedef struct
unsigned int out_buffer;
int out_bits;
} g722_decode_state_t;
+
+#ifdef WIN32
+#define int16_t short
+#define uint8_t unsigned char
+#define int32_t int
+#endif
#ifdef __cplusplus
extern "C" {
-#endif
+#endif
g722_decode_state_t *g722_decode_init(g722_decode_state_t *s, int rate, int options);
int g722_decode_release(g722_decode_state_t *s);
diff --git a/orkbasecxx/filters/g722codec/G722Codec.cpp b/orkbasecxx/filters/g722codec/G722Codec.cpp
index 00387f5..d2a72b7 100644
--- a/orkbasecxx/filters/g722codec/G722Codec.cpp
+++ b/orkbasecxx/filters/g722codec/G722Codec.cpp
@@ -16,10 +16,17 @@
#include "G722Codec.h"
-static log4cxx::LoggerPtr s_log;
+static log4cxx::LoggerPtr s_log;
+static bool s_initialized = false;
G722Decoder::G722Decoder()
-{
+{
+#ifdef WIN32
+ if(s_initialized == false)
+ {
+ s_log = log4cxx::Logger::getLogger("codec.g722");
+ }
+#endif
// Initialize decoder
memset(&m_ctx, 0, sizeof(m_ctx));
g722_decode_init(&m_ctx, 64000, G722_SAMPLE_RATE_8000);
@@ -150,8 +157,10 @@ extern "C"
/*! \file */
-#include <stdio.h>
-#include <inttypes.h>
+#include <stdio.h>
+#ifndef WIN32
+#include <inttypes.h>
+#endif
#include <memory.h>
#include <stdlib.h>
#if 0
@@ -165,7 +174,11 @@ extern "C"
#define TRUE (!FALSE)
#endif
-static __inline__ int16_t saturate(int32_t amp)
+#ifdef WIN32
+static inline int16_t saturate(int32_t amp)
+#else
+static __inline__ int16_t saturate(int32_t amp)
+#endif
{
int16_t amp16;