summaryrefslogtreecommitdiff
path: root/orkbasecxx/filters/g722codec
diff options
context:
space:
mode:
Diffstat (limited to 'orkbasecxx/filters/g722codec')
-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;