diff --git a/branches/2.0/doubango/bindings/_common/MediaSessionMgr.cxx b/branches/2.0/doubango/bindings/_common/MediaSessionMgr.cxx index 193f39f8..cc62ea43 100644 --- a/branches/2.0/doubango/bindings/_common/MediaSessionMgr.cxx +++ b/branches/2.0/doubango/bindings/_common/MediaSessionMgr.cxx @@ -156,6 +156,11 @@ uint32_t MediaSessionMgr::defaultsGetEchoTail() return tmedia_defaults_get_echo_tail(); } +bool MediaSessionMgr::defaultsSetEchoSkew(uint32_t echo_skew) +{ + return tmedia_defaults_set_echo_skew(echo_skew) == 0; +} + bool MediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled) { return tmedia_defaults_set_echo_supp_enabled(echo_supp_enabled) == 0; diff --git a/branches/2.0/doubango/bindings/_common/MediaSessionMgr.h b/branches/2.0/doubango/bindings/_common/MediaSessionMgr.h index a4c6273d..8e6db9d3 100644 --- a/branches/2.0/doubango/bindings/_common/MediaSessionMgr.h +++ b/branches/2.0/doubango/bindings/_common/MediaSessionMgr.h @@ -60,6 +60,7 @@ public: static tmedia_bandwidth_level_t defaultsGetBandwidthLevel(); static bool defaultsSetEchoTail(uint32_t echo_tail); static uint32_t defaultsGetEchoTail(); + static bool defaultsSetEchoSkew(uint32_t echo_skew); static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled); static bool defaultsGetEchoSuppEnabled(); static bool defaultsSetAgcEnabled(bool agc_enabled); diff --git a/branches/2.0/doubango/bindings/csharp/MediaSessionMgr.cs b/branches/2.0/doubango/bindings/csharp/MediaSessionMgr.cs index c28cd12f..4d2a7236 100644 --- a/branches/2.0/doubango/bindings/csharp/MediaSessionMgr.cs +++ b/branches/2.0/doubango/bindings/csharp/MediaSessionMgr.cs @@ -96,6 +96,11 @@ public class MediaSessionMgr : IDisposable { return ret; } + public static bool defaultsSetEchoSkew(uint echo_skew) { + bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetEchoSkew(echo_skew); + return ret; + } + public static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled) { bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetEchoSuppEnabled(echo_supp_enabled); return ret; diff --git a/branches/2.0/doubango/bindings/csharp/tinyWRAPPINVOKE.cs b/branches/2.0/doubango/bindings/csharp/tinyWRAPPINVOKE.cs index 45666cef..7d56bea8 100644 --- a/branches/2.0/doubango/bindings/csharp/tinyWRAPPINVOKE.cs +++ b/branches/2.0/doubango/bindings/csharp/tinyWRAPPINVOKE.cs @@ -290,6 +290,9 @@ class tinyWRAPPINVOKE { [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsGetEchoTail")] public static extern uint MediaSessionMgr_defaultsGetEchoTail(); + [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetEchoSkew")] + public static extern bool MediaSessionMgr_defaultsSetEchoSkew(uint jarg1); + [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetEchoSuppEnabled")] public static extern bool MediaSessionMgr_defaultsSetEchoSuppEnabled(bool jarg1); diff --git a/branches/2.0/doubango/bindings/csharp/tinyWRAP_wrap.cxx b/branches/2.0/doubango/bindings/csharp/tinyWRAP_wrap.cxx index c88ac132..6ef6f045 100644 --- a/branches/2.0/doubango/bindings/csharp/tinyWRAP_wrap.cxx +++ b/branches/2.0/doubango/bindings/csharp/tinyWRAP_wrap.cxx @@ -1566,6 +1566,18 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsGetEchoTail() } +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetEchoSkew(unsigned int jarg1) { + unsigned int jresult ; + uint32_t arg1 ; + bool result; + + arg1 = (uint32_t)jarg1; + result = (bool)MediaSessionMgr::defaultsSetEchoSkew(arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetEchoSuppEnabled(unsigned int jarg1) { unsigned int jresult ; bool arg1 ; diff --git a/branches/2.0/doubango/bindings/java/MediaSessionMgr.java b/branches/2.0/doubango/bindings/java/MediaSessionMgr.java index 9210ebcc..8df581ad 100644 --- a/branches/2.0/doubango/bindings/java/MediaSessionMgr.java +++ b/branches/2.0/doubango/bindings/java/MediaSessionMgr.java @@ -79,6 +79,10 @@ public class MediaSessionMgr { return tinyWRAPJNI.MediaSessionMgr_defaultsGetEchoTail(); } + public static boolean defaultsSetEchoSkew(long echo_skew) { + return tinyWRAPJNI.MediaSessionMgr_defaultsSetEchoSkew(echo_skew); + } + public static boolean defaultsSetEchoSuppEnabled(boolean echo_supp_enabled) { return tinyWRAPJNI.MediaSessionMgr_defaultsSetEchoSuppEnabled(echo_supp_enabled); } diff --git a/branches/2.0/doubango/bindings/java/android/MediaSessionMgr.java b/branches/2.0/doubango/bindings/java/android/MediaSessionMgr.java index 9210ebcc..8df581ad 100644 --- a/branches/2.0/doubango/bindings/java/android/MediaSessionMgr.java +++ b/branches/2.0/doubango/bindings/java/android/MediaSessionMgr.java @@ -79,6 +79,10 @@ public class MediaSessionMgr { return tinyWRAPJNI.MediaSessionMgr_defaultsGetEchoTail(); } + public static boolean defaultsSetEchoSkew(long echo_skew) { + return tinyWRAPJNI.MediaSessionMgr_defaultsSetEchoSkew(echo_skew); + } + public static boolean defaultsSetEchoSuppEnabled(boolean echo_supp_enabled) { return tinyWRAPJNI.MediaSessionMgr_defaultsSetEchoSuppEnabled(echo_supp_enabled); } diff --git a/branches/2.0/doubango/bindings/java/android/commercial.sh b/branches/2.0/doubango/bindings/java/android/commercial.sh index 8b102522..c93b93cd 100644 --- a/branches/2.0/doubango/bindings/java/android/commercial.sh +++ b/branches/2.0/doubango/bindings/java/android/commercial.sh @@ -6,6 +6,6 @@ export COMMERCIAL_PARAMS="LICENSE=lgpl FFMPEG=yes H264=no THEORA=yes OPENCORE_AM for IS_NEON in no yes do -../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $COMMERCIAL_PARAMS +../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $COMMERCIAL_PARAMS HAVE_WEBRTC=$IS_NEON HAVE_WEBRTC_DENOISE=$IS_NEON done diff --git a/branches/2.0/doubango/bindings/java/android/droid-makefile b/branches/2.0/doubango/bindings/java/android/droid-makefile index 1ed1cb31..d44592a7 100644 --- a/branches/2.0/doubango/bindings/java/android/droid-makefile +++ b/branches/2.0/doubango/bindings/java/android/droid-makefile @@ -42,6 +42,10 @@ ifeq ($(SPEEX), yes) SPEEX_LDFLAGS := -lspeex endif +ifeq ($(HAVE_WEBRTC), yes) + WEBRTC_LDFLAGS := -lwebrtc_aec_$(MARCH) -lwebrtc_apm_utility_$(MARCH) -lwebrtc_ns_$(MARCH) -lwebrtc_system_wrappers_$(MARCH) +endif + ifeq ($(ILBC), yes) ILBC_LDFLAGS := -liLBC endif @@ -68,7 +72,7 @@ else _LT=Bstatic endif -LDFLAGS := $(LDFLAGS_LIB) -L$(THIRDPARTIES_LIB) -L$(THIRDPARTIES_MARCH_LIB) $(FFMPEG_LDFLAGS) $(SPEEX_DSP_LDFLAGS) $(SPEEX_LDFLAGS) $(OPENCORE_ARM_LDFLAGS) $(BV16_LDFLAGS) $(ILBC_LDFLAGS) $(LIBGSM_LDFLAGS) $(G729_LDFLAGS)\ +LDFLAGS := $(LDFLAGS_LIB) -L$(THIRDPARTIES_LIB) -L$(THIRDPARTIES_MARCH_LIB) $(FFMPEG_LDFLAGS) $(WEBRTC_LDFLAGS) $(SPEEX_DSP_LDFLAGS) $(SPEEX_LDFLAGS) $(OPENCORE_ARM_LDFLAGS) $(BV16_LDFLAGS) $(ILBC_LDFLAGS) $(LIBGSM_LDFLAGS) $(G729_LDFLAGS)\ -Wl,-Bdynamic -lm -lstdc++ -lgcc -llog \ -Wl,-$(_LT) -ltinySAK_$(MARCH) -ltinyHTTP_$(MARCH) -ltinyXCAP_$(MARCH) -ltinyIPSec_$(MARCH) -ltinySIGCOMP_$(MARCH) -ltinySMS_$(MARCH) -ltinyNET_$(MARCH) -ltinySDP_$(MARCH) -ltinyRTP_$(MARCH) -ltinyMEDIA_$(MARCH) -ltinyMSRP_$(MARCH) -ltinyDAV_$(MARCH) -ltinySIP_$(MARCH) diff --git a/branches/2.0/doubango/bindings/java/android/gpl.sh b/branches/2.0/doubango/bindings/java/android/gpl.sh index 91d9744a..c3c53c3d 100644 --- a/branches/2.0/doubango/bindings/java/android/gpl.sh +++ b/branches/2.0/doubango/bindings/java/android/gpl.sh @@ -6,6 +6,6 @@ export GPL_PARAMS="LICENSE=gpl NO_FREE=yes FFMPEG=yes H264=yes THEORA=yes OPENCO for IS_NEON in no yes do -../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $GPL_PARAMS +../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $GPL_PARAMS HAVE_WEBRTC=$IS_NEON HAVE_WEBRTC_DENOISE=$IS_NEON done diff --git a/branches/2.0/doubango/bindings/java/android/lgpl.sh b/branches/2.0/doubango/bindings/java/android/lgpl.sh index f15761ef..368c757c 100644 --- a/branches/2.0/doubango/bindings/java/android/lgpl.sh +++ b/branches/2.0/doubango/bindings/java/android/lgpl.sh @@ -6,6 +6,6 @@ export LGPL_PARAMS="LICENSE=lgpl FFMPEG=yes H264=no THEORA=yes OPENCORE_AMR=yes for IS_NEON in no yes do -../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $LGPL_PARAMS +../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $LGPL_PARAMS HAVE_WEBRTC=$IS_NEON HAVE_WEBRTC_DENOISE=$IS_NEON done diff --git a/branches/2.0/doubango/bindings/java/android/minimal.sh b/branches/2.0/doubango/bindings/java/android/minimal.sh index a255d7a0..0a1cf6fb 100644 --- a/branches/2.0/doubango/bindings/java/android/minimal.sh +++ b/branches/2.0/doubango/bindings/java/android/minimal.sh @@ -6,5 +6,5 @@ export MINIMAL_PARAMS="FFMPEG=no H264=no THEORA=no OPENCORE_AMR=no SPEEX_DSP=yes for IS_NEON in no yes do -../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $MINIMAL_PARAMS +../bindings/java/android/buildAll.sh $@ NEON=$IS_NEON $MINIMAL_PARAMS HAVE_WEBRTC=$IS_NEON HAVE_WEBRTC_DENOISE=$IS_NEON done diff --git a/branches/2.0/doubango/bindings/java/android/tinyWRAPJNI.java b/branches/2.0/doubango/bindings/java/android/tinyWRAPJNI.java index 763af6a6..9f45d02d 100644 --- a/branches/2.0/doubango/bindings/java/android/tinyWRAPJNI.java +++ b/branches/2.0/doubango/bindings/java/android/tinyWRAPJNI.java @@ -45,6 +45,7 @@ class tinyWRAPJNI { public final static native int MediaSessionMgr_defaultsGetBandwidthLevel(); public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1); public final static native long MediaSessionMgr_defaultsGetEchoTail(); + public final static native boolean MediaSessionMgr_defaultsSetEchoSkew(long jarg1); public final static native boolean MediaSessionMgr_defaultsSetEchoSuppEnabled(boolean jarg1); public final static native boolean MediaSessionMgr_defaultsGetEchoSuppEnabled(); public final static native boolean MediaSessionMgr_defaultsSetAgcEnabled(boolean jarg1); diff --git a/branches/2.0/doubango/bindings/java/android/tinyWRAP_wrap.cxx b/branches/2.0/doubango/bindings/java/android/tinyWRAP_wrap.cxx index eda6de11..a1610397 100644 --- a/branches/2.0/doubango/bindings/java/android/tinyWRAP_wrap.cxx +++ b/branches/2.0/doubango/bindings/java/android/tinyWRAP_wrap.cxx @@ -2464,6 +2464,20 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_ } +SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetEchoSkew(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jboolean jresult = 0 ; + uint32_t arg1 ; + bool result; + + (void)jenv; + (void)jcls; + arg1 = (uint32_t)jarg1; + result = (bool)MediaSessionMgr::defaultsSetEchoSkew(arg1); + jresult = (jboolean)result; + return jresult; +} + + SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetEchoSuppEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) { jboolean jresult = 0 ; bool arg1 ; diff --git a/branches/2.0/doubango/bindings/java/tinyWRAPJNI.java b/branches/2.0/doubango/bindings/java/tinyWRAPJNI.java index 763af6a6..9f45d02d 100644 --- a/branches/2.0/doubango/bindings/java/tinyWRAPJNI.java +++ b/branches/2.0/doubango/bindings/java/tinyWRAPJNI.java @@ -45,6 +45,7 @@ class tinyWRAPJNI { public final static native int MediaSessionMgr_defaultsGetBandwidthLevel(); public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1); public final static native long MediaSessionMgr_defaultsGetEchoTail(); + public final static native boolean MediaSessionMgr_defaultsSetEchoSkew(long jarg1); public final static native boolean MediaSessionMgr_defaultsSetEchoSuppEnabled(boolean jarg1); public final static native boolean MediaSessionMgr_defaultsGetEchoSuppEnabled(); public final static native boolean MediaSessionMgr_defaultsSetAgcEnabled(boolean jarg1); diff --git a/branches/2.0/doubango/bindings/java/tinyWRAP_wrap.cxx b/branches/2.0/doubango/bindings/java/tinyWRAP_wrap.cxx index e1c8ed0e..1dd25e42 100644 --- a/branches/2.0/doubango/bindings/java/tinyWRAP_wrap.cxx +++ b/branches/2.0/doubango/bindings/java/tinyWRAP_wrap.cxx @@ -2464,6 +2464,20 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_ } +SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetEchoSkew(JNIEnv *jenv, jclass jcls, jlong jarg1) { + jboolean jresult = 0 ; + uint32_t arg1 ; + bool result; + + (void)jenv; + (void)jcls; + arg1 = (uint32_t)jarg1; + result = (bool)MediaSessionMgr::defaultsSetEchoSkew(arg1); + jresult = (jboolean)result; + return jresult; +} + + SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetEchoSuppEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) { jboolean jresult = 0 ; bool arg1 ; diff --git a/branches/2.0/doubango/bindings/perl/tinyWRAP.pm b/branches/2.0/doubango/bindings/perl/tinyWRAP.pm index f0cf0cc0..6be9cce1 100644 --- a/branches/2.0/doubango/bindings/perl/tinyWRAP.pm +++ b/branches/2.0/doubango/bindings/perl/tinyWRAP.pm @@ -202,6 +202,7 @@ sub DESTROY { *defaultsGetBandwidthLevel = *tinyWRAPc::MediaSessionMgr_defaultsGetBandwidthLevel; *defaultsSetEchoTail = *tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail; *defaultsGetEchoTail = *tinyWRAPc::MediaSessionMgr_defaultsGetEchoTail; +*defaultsSetEchoSkew = *tinyWRAPc::MediaSessionMgr_defaultsSetEchoSkew; *defaultsSetEchoSuppEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetEchoSuppEnabled; *defaultsGetEchoSuppEnabled = *tinyWRAPc::MediaSessionMgr_defaultsGetEchoSuppEnabled; *defaultsSetAgcEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetAgcEnabled; diff --git a/branches/2.0/doubango/bindings/perl/tinyWRAP_wrap.cxx b/branches/2.0/doubango/bindings/perl/tinyWRAP_wrap.cxx index 02a52aa3..f50b15b1 100644 --- a/branches/2.0/doubango/bindings/perl/tinyWRAP_wrap.cxx +++ b/branches/2.0/doubango/bindings/perl/tinyWRAP_wrap.cxx @@ -3455,6 +3455,34 @@ XS(_wrap_MediaSessionMgr_defaultsGetEchoTail) { } +XS(_wrap_MediaSessionMgr_defaultsSetEchoSkew) { + { + uint32_t arg1 ; + unsigned int val1 ; + int ecode1 = 0 ; + int argvi = 0; + bool result; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: MediaSessionMgr_defaultsSetEchoSkew(echo_skew);"); + } + ecode1 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetEchoSkew" "', argument " "1"" of type '" "uint32_t""'"); + } + arg1 = static_cast< uint32_t >(val1); + result = (bool)MediaSessionMgr::defaultsSetEchoSkew(arg1); + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_MediaSessionMgr_defaultsSetEchoSuppEnabled) { { bool arg1 ; @@ -21269,6 +21297,7 @@ static swig_command_info swig_commands[] = { {"tinyWRAPc::MediaSessionMgr_defaultsGetBandwidthLevel", _wrap_MediaSessionMgr_defaultsGetBandwidthLevel}, {"tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail}, {"tinyWRAPc::MediaSessionMgr_defaultsGetEchoTail", _wrap_MediaSessionMgr_defaultsGetEchoTail}, +{"tinyWRAPc::MediaSessionMgr_defaultsSetEchoSkew", _wrap_MediaSessionMgr_defaultsSetEchoSkew}, {"tinyWRAPc::MediaSessionMgr_defaultsSetEchoSuppEnabled", _wrap_MediaSessionMgr_defaultsSetEchoSuppEnabled}, {"tinyWRAPc::MediaSessionMgr_defaultsGetEchoSuppEnabled", _wrap_MediaSessionMgr_defaultsGetEchoSuppEnabled}, {"tinyWRAPc::MediaSessionMgr_defaultsSetAgcEnabled", _wrap_MediaSessionMgr_defaultsSetAgcEnabled}, diff --git a/branches/2.0/doubango/bindings/python/tinyWRAP.py b/branches/2.0/doubango/bindings/python/tinyWRAP.py index 62e9edc0..086b0fa9 100644 --- a/branches/2.0/doubango/bindings/python/tinyWRAP.py +++ b/branches/2.0/doubango/bindings/python/tinyWRAP.py @@ -161,6 +161,8 @@ class MediaSessionMgr(_object): if _newclass:defaultsSetEchoTail = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetEchoTail) __swig_getmethods__["defaultsGetEchoTail"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsGetEchoTail if _newclass:defaultsGetEchoTail = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsGetEchoTail) + __swig_getmethods__["defaultsSetEchoSkew"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetEchoSkew + if _newclass:defaultsSetEchoSkew = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetEchoSkew) __swig_getmethods__["defaultsSetEchoSuppEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetEchoSuppEnabled if _newclass:defaultsSetEchoSuppEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetEchoSuppEnabled) __swig_getmethods__["defaultsGetEchoSuppEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsGetEchoSuppEnabled @@ -210,6 +212,10 @@ def MediaSessionMgr_defaultsGetEchoTail(): return _tinyWRAP.MediaSessionMgr_defaultsGetEchoTail() MediaSessionMgr_defaultsGetEchoTail = _tinyWRAP.MediaSessionMgr_defaultsGetEchoTail +def MediaSessionMgr_defaultsSetEchoSkew(*args): + return _tinyWRAP.MediaSessionMgr_defaultsSetEchoSkew(*args) +MediaSessionMgr_defaultsSetEchoSkew = _tinyWRAP.MediaSessionMgr_defaultsSetEchoSkew + def MediaSessionMgr_defaultsSetEchoSuppEnabled(*args): return _tinyWRAP.MediaSessionMgr_defaultsSetEchoSuppEnabled(*args) MediaSessionMgr_defaultsSetEchoSuppEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetEchoSuppEnabled diff --git a/branches/2.0/doubango/bindings/python/tinyWRAP_wrap.cxx b/branches/2.0/doubango/bindings/python/tinyWRAP_wrap.cxx index 86a1573f..76e219fe 100644 --- a/branches/2.0/doubango/bindings/python/tinyWRAP_wrap.cxx +++ b/branches/2.0/doubango/bindings/python/tinyWRAP_wrap.cxx @@ -6159,6 +6159,28 @@ fail: } +SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetEchoSkew(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + uint32_t arg1 ; + unsigned int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetEchoSkew",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetEchoSkew" "', argument " "1"" of type '" "uint32_t""'"); + } + arg1 = static_cast< uint32_t >(val1); + result = (bool)MediaSessionMgr::defaultsSetEchoSkew(arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetEchoSuppEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; bool arg1 ; @@ -20763,6 +20785,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"MediaSessionMgr_defaultsGetBandwidthLevel", _wrap_MediaSessionMgr_defaultsGetBandwidthLevel, METH_VARARGS, NULL}, { (char *)"MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail, METH_VARARGS, NULL}, { (char *)"MediaSessionMgr_defaultsGetEchoTail", _wrap_MediaSessionMgr_defaultsGetEchoTail, METH_VARARGS, NULL}, + { (char *)"MediaSessionMgr_defaultsSetEchoSkew", _wrap_MediaSessionMgr_defaultsSetEchoSkew, METH_VARARGS, NULL}, { (char *)"MediaSessionMgr_defaultsSetEchoSuppEnabled", _wrap_MediaSessionMgr_defaultsSetEchoSuppEnabled, METH_VARARGS, NULL}, { (char *)"MediaSessionMgr_defaultsGetEchoSuppEnabled", _wrap_MediaSessionMgr_defaultsGetEchoSuppEnabled, METH_VARARGS, NULL}, { (char *)"MediaSessionMgr_defaultsSetAgcEnabled", _wrap_MediaSessionMgr_defaultsSetAgcEnabled, METH_VARARGS, NULL}, diff --git a/branches/2.0/doubango/thirdparties/android/include/webrtc/echo_cancellation.h b/branches/2.0/doubango/thirdparties/android/include/webrtc/echo_cancellation.h new file mode 100644 index 00000000..883357da --- /dev/null +++ b/branches/2.0/doubango/thirdparties/android/include/webrtc/echo_cancellation.h @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ + +#include "typedefs.h" + +// Errors +#define AEC_UNSPECIFIED_ERROR 12000 +#define AEC_UNSUPPORTED_FUNCTION_ERROR 12001 +#define AEC_UNINITIALIZED_ERROR 12002 +#define AEC_NULL_POINTER_ERROR 12003 +#define AEC_BAD_PARAMETER_ERROR 12004 + +// Warnings +#define AEC_BAD_PARAMETER_WARNING 12050 + +enum { + kAecNlpConservative = 0, + kAecNlpModerate, + kAecNlpAggressive +}; + +enum { + kAecFalse = 0, + kAecTrue +}; + +typedef struct { + WebRtc_Word16 nlpMode; // default kAecNlpModerate + WebRtc_Word16 skewMode; // default kAecFalse + WebRtc_Word16 metricsMode; // default kAecFalse + //float realSkew; +} AecConfig; + +typedef struct { + WebRtc_Word16 instant; + WebRtc_Word16 average; + WebRtc_Word16 max; + WebRtc_Word16 min; +} AecLevel; + +typedef struct { + AecLevel rerl; + AecLevel erl; + AecLevel erle; + AecLevel aNlp; +} AecMetrics; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Allocates the memory needed by the AEC. The memory needs to be initialized + * separately using the WebRtcAec_Init() function. + * + * Inputs Description + * ------------------------------------------------------------------- + * void **aecInst Pointer to the AEC instance to be created + * and initilized + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Create(void **aecInst); + +/* + * This function releases the memory allocated by WebRtcAec_Create(). + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Free(void *aecInst); + +/* + * Initializes an AEC instance. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * WebRtc_Word32 sampFreq Sampling frequency of data + * WebRtc_Word32 scSampFreq Soundcard sampling frequency + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Init(void *aecInst, + WebRtc_Word32 sampFreq, + WebRtc_Word32 scSampFreq); + +/* + * Inserts an 80 or 160 sample block of data into the farend buffer. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * WebRtc_Word16 *farend In buffer containing one frame of + * farend signal for L band + * WebRtc_Word16 nrOfSamples Number of samples in farend buffer + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_BufferFarend(void *aecInst, + const WebRtc_Word16 *farend, + WebRtc_Word16 nrOfSamples); + +/* + * Runs the echo canceller on an 80 or 160 sample blocks of data. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * WebRtc_Word16 *nearend In buffer containing one frame of + * nearend+echo signal for L band + * WebRtc_Word16 *nearendH In buffer containing one frame of + * nearend+echo signal for H band + * WebRtc_Word16 nrOfSamples Number of samples in nearend buffer + * WebRtc_Word16 msInSndCardBuf Delay estimate for sound card and + * system buffers + * WebRtc_Word16 skew Difference between number of samples played + * and recorded at the soundcard (for clock skew + * compensation) + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word16 *out Out buffer, one frame of processed nearend + * for L band + * WebRtc_Word16 *outH Out buffer, one frame of processed nearend + * for H band + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Process(void *aecInst, + const WebRtc_Word16 *nearend, + const WebRtc_Word16 *nearendH, + WebRtc_Word16 *out, + WebRtc_Word16 *outH, + WebRtc_Word16 nrOfSamples, + WebRtc_Word16 msInSndCardBuf, + WebRtc_Word32 skew); + +/* + * This function enables the user to set certain parameters on-the-fly. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * AecConfig config Config instance that contains all + * properties to be set + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_set_config(void *aecInst, AecConfig config); + +/* + * Gets the on-the-fly paramters. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * AecConfig *config Pointer to the config instance that + * all properties will be written to + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_get_config(void *aecInst, AecConfig *config); + +/* + * Gets the current echo status of the nearend signal. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word16 *status 0: Almost certainly nearend single-talk + * 1: Might not be neared single-talk + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_get_echo_status(void *aecInst, WebRtc_Word16 *status); + +/* + * Gets the current echo metrics for the session. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * AecMetrics *metrics Struct which will be filled out with the + * current echo metrics. + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_GetMetrics(void *aecInst, AecMetrics *metrics); + +/* + * Gets the last error code. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 11000-11100: error code + */ +WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst); + +/* + * Gets a version string. + * + * Inputs Description + * ------------------------------------------------------------------- + * char *versionStr Pointer to a string array + * WebRtc_Word16 len The maximum length of the string + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word8 *versionStr Pointer to a string array + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_get_version(WebRtc_Word8 *versionStr, WebRtc_Word16 len); + +#ifdef __cplusplus +} +#endif +#endif /* WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ */ diff --git a/branches/2.0/doubango/thirdparties/android/include/webrtc/noise_suppression.h b/branches/2.0/doubango/thirdparties/android/include/webrtc/noise_suppression.h new file mode 100644 index 00000000..b8983b07 --- /dev/null +++ b/branches/2.0/doubango/thirdparties/android/include/webrtc/noise_suppression.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ + +#include "typedefs.h" + +typedef struct NsHandleT NsHandle; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This function returns the version number of the code. + * + * Input: + * - version : Pointer to a character array where the version + * info is stored. + * - length : Length of version. + * + * Return value : 0 - Ok + * -1 - Error (probably length is not sufficient) + */ +int WebRtcNs_get_version(char *version, short length); + + +/* + * This function creates an instance to the noise reduction structure + * + * Input: + * - NS_inst : Pointer to noise reduction instance that should be + * created + * + * Output: + * - NS_inst : Pointer to created noise reduction instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_Create(NsHandle **NS_inst); + + +/* + * This function frees the dynamic memory of a specified Noise Reduction + * instance. + * + * Input: + * - NS_inst : Pointer to NS instance that should be freed + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_Free(NsHandle *NS_inst); + + +/* + * This function initializes a NS instance + * + * Input: + * - NS_inst : Instance that should be initialized + * - fs : sampling frequency + * + * Output: + * - NS_inst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_Init(NsHandle *NS_inst, WebRtc_UWord32 fs); + +/* + * This changes the aggressiveness of the noise suppression method. + * + * Input: + * - NS_inst : Instance that should be initialized + * - mode : 0: Mild, 1: Medium , 2: Aggressive + * + * Output: + * - NS_inst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_set_policy(NsHandle *NS_inst, int mode); + + +/* + * This functions does Noise Suppression for the inserted speech frame. The + * input and output signals should always be 10ms (80 or 160 samples). + * + * Input + * - NS_inst : VAD Instance. Needs to be initiated before call. + * - spframe : Pointer to speech frame buffer for L band + * - spframe_H : Pointer to speech frame buffer for H band + * - fs : sampling frequency + * + * Output: + * - NS_inst : Updated NS instance + * - outframe : Pointer to output frame for L band + * - outframe_H : Pointer to output frame for H band + * + * Return value : 0 - OK + * -1 - Error + */ +int WebRtcNs_Process(NsHandle *NS_inst, + short *spframe, + short *spframe_H, + short *outframe, + short *outframe_H); + +#ifdef __cplusplus +} +#endif + +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ diff --git a/branches/2.0/doubango/thirdparties/android/include/webrtc/noise_suppression_x.h b/branches/2.0/doubango/thirdparties/android/include/webrtc/noise_suppression_x.h new file mode 100644 index 00000000..35fea2f0 --- /dev/null +++ b/branches/2.0/doubango/thirdparties/android/include/webrtc/noise_suppression_x.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ + +#include "signal_processing_library.h" + +typedef struct NsxHandleT NsxHandle; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This function returns the version number of the code. + * + * Input: + * - version : Pointer to a character array where the version + * info is stored. + * - length : Length of version. + * + * Return value : 0 - Ok + * -1 - Error (probably length is not sufficient) + */ +int WebRtcNsx_get_version(char *version, short length); + + +/* + * This function creates an instance to the noise reduction structure + * + * Input: + * - nsxInst : Pointer to noise reduction instance that should be + * created + * + * Output: + * - nsxInst : Pointer to created noise reduction instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_Create(NsxHandle **nsxInst); + + +/* + * This function frees the dynamic memory of a specified Noise Suppression + * instance. + * + * Input: + * - nsxInst : Pointer to NS instance that should be freed + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_Free(NsxHandle *nsxInst); + + +/* + * This function initializes a NS instance + * + * Input: + * - nsxInst : Instance that should be initialized + * - fs : sampling frequency + * + * Output: + * - nsxInst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_Init(NsxHandle *nsxInst, WebRtc_UWord32 fs); + +/* + * This changes the aggressiveness of the noise suppression method. + * + * Input: + * - nsxInst : Instance that should be initialized + * - mode : 0: Mild, 1: Medium , 2: Aggressive + * + * Output: + * - nsxInst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_set_policy(NsxHandle *nsxInst, int mode); + +/* + * This functions does noise suppression for the inserted speech frame. The + * input and output signals should always be 10ms (80 or 160 samples). + * + * Input + * - nsxInst : NSx instance. Needs to be initiated before call. + * - speechFrame : Pointer to speech frame buffer for L band + * - speechFrameHB : Pointer to speech frame buffer for H band + * - fs : sampling frequency + * + * Output: + * - nsxInst : Updated NSx instance + * - outFrame : Pointer to output frame for L band + * - outFrameHB : Pointer to output frame for H band + * + * Return value : 0 - OK + * -1 - Error + */ +int WebRtcNsx_Process(NsxHandle *nsxInst, + short *speechFrame, + short *speechFrameHB, + short *outFrame, + short *outFrameHB); + +#ifdef __cplusplus +} +#endif + +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ diff --git a/branches/2.0/doubango/thirdparties/android/include/webrtc/typedefs.h b/branches/2.0/doubango/thirdparties/android/include/webrtc/typedefs.h new file mode 100644 index 00000000..ae71690f --- /dev/null +++ b/branches/2.0/doubango/thirdparties/android/include/webrtc/typedefs.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * + * This file contains type definitions used in all WebRtc APIs. + * + */ + +/* Reserved words definitions */ +#define WEBRTC_EXTERN extern +#define G_CONST const +#define WEBRTC_INLINE extern __inline + +#ifndef WEBRTC_TYPEDEFS_H +#define WEBRTC_TYPEDEFS_H + +/* Define WebRtc preprocessor identifiers based on the current build platform */ +#if defined(WIN32) + // Windows & Windows Mobile + #if !defined(WEBRTC_TARGET_PC) + #define WEBRTC_TARGET_PC + #endif +#elif defined(__APPLE__) + // Mac OS X + #if defined(__LITTLE_ENDIAN__ ) //TODO: is this used? + #if !defined(WEBRTC_TARGET_MAC_INTEL) + #define WEBRTC_TARGET_MAC_INTEL + #endif + #else + #if !defined(WEBRTC_TARGET_MAC) + #define WEBRTC_TARGET_MAC + #endif + #endif +#else + // Linux etc. + #if !defined(WEBRTC_TARGET_PC) + #define WEBRTC_TARGET_PC + #endif +#endif + +#if defined(WEBRTC_TARGET_PC) + +#if !defined(_MSC_VER) + #include +#else + // Define C99 equivalent types. + // Since MSVC doesn't include these headers, we have to write our own + // version to provide a compatibility layer between MSVC and the WebRTC + // headers. + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef signed long long int64_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long uint64_t; +#endif + +#if defined(WIN32) + typedef __int64 WebRtc_Word64; + typedef unsigned __int64 WebRtc_UWord64; +#else + typedef int64_t WebRtc_Word64; + typedef uint64_t WebRtc_UWord64; +#endif + typedef int32_t WebRtc_Word32; + typedef uint32_t WebRtc_UWord32; + typedef int16_t WebRtc_Word16; + typedef uint16_t WebRtc_UWord16; + typedef char WebRtc_Word8; + typedef uint8_t WebRtc_UWord8; + + /* Define endian for the platform */ + #define WEBRTC_LITTLE_ENDIAN + +#elif defined(WEBRTC_TARGET_MAC_INTEL) + #include + + typedef int64_t WebRtc_Word64; + typedef uint64_t WebRtc_UWord64; + typedef int32_t WebRtc_Word32; + typedef uint32_t WebRtc_UWord32; + typedef int16_t WebRtc_Word16; + typedef char WebRtc_Word8; + typedef uint16_t WebRtc_UWord16; + typedef uint8_t WebRtc_UWord8; + + /* Define endian for the platform */ + #define WEBRTC_LITTLE_ENDIAN + +#else + + #error "No platform defined for WebRtc type definitions (webrtc_typedefs.h)" + +#endif + + +#endif // WEBRTC_TYPEDEFS_H diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_aec_armv5te.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_aec_armv5te.a new file mode 100644 index 00000000..d0edb451 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_aec_armv5te.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_aec_armv7-a.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_aec_armv7-a.a new file mode 100644 index 00000000..5ae96bf3 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_aec_armv7-a.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_apm_utility_armv5te.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_apm_utility_armv5te.a new file mode 100644 index 00000000..75eaf811 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_apm_utility_armv5te.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_apm_utility_armv7-a.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_apm_utility_armv7-a.a new file mode 100644 index 00000000..620eade1 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_apm_utility_armv7-a.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_ns_armv5te.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_ns_armv5te.a new file mode 100644 index 00000000..5463f992 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_ns_armv5te.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_ns_armv7-a.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_ns_armv7-a.a new file mode 100644 index 00000000..d96b0c1f Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_ns_armv7-a.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_system_wrappers_armv5te.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_system_wrappers_armv5te.a new file mode 100644 index 00000000..4c5c7ba5 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_system_wrappers_armv5te.a differ diff --git a/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_system_wrappers_armv7-a.a b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_system_wrappers_armv7-a.a new file mode 100644 index 00000000..f95321e7 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/android/lib/libwebrtc_system_wrappers_armv7-a.a differ diff --git a/branches/2.0/doubango/thirdparties/win32/include/webrtc/echo_cancellation.h b/branches/2.0/doubango/thirdparties/win32/include/webrtc/echo_cancellation.h new file mode 100644 index 00000000..883357da --- /dev/null +++ b/branches/2.0/doubango/thirdparties/win32/include/webrtc/echo_cancellation.h @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ + +#include "typedefs.h" + +// Errors +#define AEC_UNSPECIFIED_ERROR 12000 +#define AEC_UNSUPPORTED_FUNCTION_ERROR 12001 +#define AEC_UNINITIALIZED_ERROR 12002 +#define AEC_NULL_POINTER_ERROR 12003 +#define AEC_BAD_PARAMETER_ERROR 12004 + +// Warnings +#define AEC_BAD_PARAMETER_WARNING 12050 + +enum { + kAecNlpConservative = 0, + kAecNlpModerate, + kAecNlpAggressive +}; + +enum { + kAecFalse = 0, + kAecTrue +}; + +typedef struct { + WebRtc_Word16 nlpMode; // default kAecNlpModerate + WebRtc_Word16 skewMode; // default kAecFalse + WebRtc_Word16 metricsMode; // default kAecFalse + //float realSkew; +} AecConfig; + +typedef struct { + WebRtc_Word16 instant; + WebRtc_Word16 average; + WebRtc_Word16 max; + WebRtc_Word16 min; +} AecLevel; + +typedef struct { + AecLevel rerl; + AecLevel erl; + AecLevel erle; + AecLevel aNlp; +} AecMetrics; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Allocates the memory needed by the AEC. The memory needs to be initialized + * separately using the WebRtcAec_Init() function. + * + * Inputs Description + * ------------------------------------------------------------------- + * void **aecInst Pointer to the AEC instance to be created + * and initilized + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Create(void **aecInst); + +/* + * This function releases the memory allocated by WebRtcAec_Create(). + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Free(void *aecInst); + +/* + * Initializes an AEC instance. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * WebRtc_Word32 sampFreq Sampling frequency of data + * WebRtc_Word32 scSampFreq Soundcard sampling frequency + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Init(void *aecInst, + WebRtc_Word32 sampFreq, + WebRtc_Word32 scSampFreq); + +/* + * Inserts an 80 or 160 sample block of data into the farend buffer. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * WebRtc_Word16 *farend In buffer containing one frame of + * farend signal for L band + * WebRtc_Word16 nrOfSamples Number of samples in farend buffer + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_BufferFarend(void *aecInst, + const WebRtc_Word16 *farend, + WebRtc_Word16 nrOfSamples); + +/* + * Runs the echo canceller on an 80 or 160 sample blocks of data. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * WebRtc_Word16 *nearend In buffer containing one frame of + * nearend+echo signal for L band + * WebRtc_Word16 *nearendH In buffer containing one frame of + * nearend+echo signal for H band + * WebRtc_Word16 nrOfSamples Number of samples in nearend buffer + * WebRtc_Word16 msInSndCardBuf Delay estimate for sound card and + * system buffers + * WebRtc_Word16 skew Difference between number of samples played + * and recorded at the soundcard (for clock skew + * compensation) + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word16 *out Out buffer, one frame of processed nearend + * for L band + * WebRtc_Word16 *outH Out buffer, one frame of processed nearend + * for H band + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_Process(void *aecInst, + const WebRtc_Word16 *nearend, + const WebRtc_Word16 *nearendH, + WebRtc_Word16 *out, + WebRtc_Word16 *outH, + WebRtc_Word16 nrOfSamples, + WebRtc_Word16 msInSndCardBuf, + WebRtc_Word32 skew); + +/* + * This function enables the user to set certain parameters on-the-fly. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * AecConfig config Config instance that contains all + * properties to be set + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_set_config(void *aecInst, AecConfig config); + +/* + * Gets the on-the-fly paramters. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * AecConfig *config Pointer to the config instance that + * all properties will be written to + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_get_config(void *aecInst, AecConfig *config); + +/* + * Gets the current echo status of the nearend signal. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word16 *status 0: Almost certainly nearend single-talk + * 1: Might not be neared single-talk + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_get_echo_status(void *aecInst, WebRtc_Word16 *status); + +/* + * Gets the current echo metrics for the session. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * AecMetrics *metrics Struct which will be filled out with the + * current echo metrics. + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_GetMetrics(void *aecInst, AecMetrics *metrics); + +/* + * Gets the last error code. + * + * Inputs Description + * ------------------------------------------------------------------- + * void *aecInst Pointer to the AEC instance + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word32 return 11000-11100: error code + */ +WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst); + +/* + * Gets a version string. + * + * Inputs Description + * ------------------------------------------------------------------- + * char *versionStr Pointer to a string array + * WebRtc_Word16 len The maximum length of the string + * + * Outputs Description + * ------------------------------------------------------------------- + * WebRtc_Word8 *versionStr Pointer to a string array + * WebRtc_Word32 return 0: OK + * -1: error + */ +WebRtc_Word32 WebRtcAec_get_version(WebRtc_Word8 *versionStr, WebRtc_Word16 len); + +#ifdef __cplusplus +} +#endif +#endif /* WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_INTERFACE_ECHO_CANCELLATION_H_ */ diff --git a/branches/2.0/doubango/thirdparties/win32/include/webrtc/noise_suppression.h b/branches/2.0/doubango/thirdparties/win32/include/webrtc/noise_suppression.h new file mode 100644 index 00000000..b8983b07 --- /dev/null +++ b/branches/2.0/doubango/thirdparties/win32/include/webrtc/noise_suppression.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ + +#include "typedefs.h" + +typedef struct NsHandleT NsHandle; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This function returns the version number of the code. + * + * Input: + * - version : Pointer to a character array where the version + * info is stored. + * - length : Length of version. + * + * Return value : 0 - Ok + * -1 - Error (probably length is not sufficient) + */ +int WebRtcNs_get_version(char *version, short length); + + +/* + * This function creates an instance to the noise reduction structure + * + * Input: + * - NS_inst : Pointer to noise reduction instance that should be + * created + * + * Output: + * - NS_inst : Pointer to created noise reduction instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_Create(NsHandle **NS_inst); + + +/* + * This function frees the dynamic memory of a specified Noise Reduction + * instance. + * + * Input: + * - NS_inst : Pointer to NS instance that should be freed + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_Free(NsHandle *NS_inst); + + +/* + * This function initializes a NS instance + * + * Input: + * - NS_inst : Instance that should be initialized + * - fs : sampling frequency + * + * Output: + * - NS_inst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_Init(NsHandle *NS_inst, WebRtc_UWord32 fs); + +/* + * This changes the aggressiveness of the noise suppression method. + * + * Input: + * - NS_inst : Instance that should be initialized + * - mode : 0: Mild, 1: Medium , 2: Aggressive + * + * Output: + * - NS_inst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNs_set_policy(NsHandle *NS_inst, int mode); + + +/* + * This functions does Noise Suppression for the inserted speech frame. The + * input and output signals should always be 10ms (80 or 160 samples). + * + * Input + * - NS_inst : VAD Instance. Needs to be initiated before call. + * - spframe : Pointer to speech frame buffer for L band + * - spframe_H : Pointer to speech frame buffer for H band + * - fs : sampling frequency + * + * Output: + * - NS_inst : Updated NS instance + * - outframe : Pointer to output frame for L band + * - outframe_H : Pointer to output frame for H band + * + * Return value : 0 - OK + * -1 - Error + */ +int WebRtcNs_Process(NsHandle *NS_inst, + short *spframe, + short *spframe_H, + short *outframe, + short *outframe_H); + +#ifdef __cplusplus +} +#endif + +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_H_ diff --git a/branches/2.0/doubango/thirdparties/win32/include/webrtc/noise_suppression_x.h b/branches/2.0/doubango/thirdparties/win32/include/webrtc/noise_suppression_x.h new file mode 100644 index 00000000..35fea2f0 --- /dev/null +++ b/branches/2.0/doubango/thirdparties/win32/include/webrtc/noise_suppression_x.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ + +#include "signal_processing_library.h" + +typedef struct NsxHandleT NsxHandle; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This function returns the version number of the code. + * + * Input: + * - version : Pointer to a character array where the version + * info is stored. + * - length : Length of version. + * + * Return value : 0 - Ok + * -1 - Error (probably length is not sufficient) + */ +int WebRtcNsx_get_version(char *version, short length); + + +/* + * This function creates an instance to the noise reduction structure + * + * Input: + * - nsxInst : Pointer to noise reduction instance that should be + * created + * + * Output: + * - nsxInst : Pointer to created noise reduction instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_Create(NsxHandle **nsxInst); + + +/* + * This function frees the dynamic memory of a specified Noise Suppression + * instance. + * + * Input: + * - nsxInst : Pointer to NS instance that should be freed + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_Free(NsxHandle *nsxInst); + + +/* + * This function initializes a NS instance + * + * Input: + * - nsxInst : Instance that should be initialized + * - fs : sampling frequency + * + * Output: + * - nsxInst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_Init(NsxHandle *nsxInst, WebRtc_UWord32 fs); + +/* + * This changes the aggressiveness of the noise suppression method. + * + * Input: + * - nsxInst : Instance that should be initialized + * - mode : 0: Mild, 1: Medium , 2: Aggressive + * + * Output: + * - nsxInst : Initialized instance + * + * Return value : 0 - Ok + * -1 - Error + */ +int WebRtcNsx_set_policy(NsxHandle *nsxInst, int mode); + +/* + * This functions does noise suppression for the inserted speech frame. The + * input and output signals should always be 10ms (80 or 160 samples). + * + * Input + * - nsxInst : NSx instance. Needs to be initiated before call. + * - speechFrame : Pointer to speech frame buffer for L band + * - speechFrameHB : Pointer to speech frame buffer for H band + * - fs : sampling frequency + * + * Output: + * - nsxInst : Updated NSx instance + * - outFrame : Pointer to output frame for L band + * - outFrameHB : Pointer to output frame for H band + * + * Return value : 0 - OK + * -1 - Error + */ +int WebRtcNsx_Process(NsxHandle *nsxInst, + short *speechFrame, + short *speechFrameHB, + short *outFrame, + short *outFrameHB); + +#ifdef __cplusplus +} +#endif + +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_NS_MAIN_INTERFACE_NOISE_SUPPRESSION_X_H_ diff --git a/branches/2.0/doubango/thirdparties/win32/include/webrtc/typedefs.h b/branches/2.0/doubango/thirdparties/win32/include/webrtc/typedefs.h new file mode 100644 index 00000000..ae71690f --- /dev/null +++ b/branches/2.0/doubango/thirdparties/win32/include/webrtc/typedefs.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/* + * + * This file contains type definitions used in all WebRtc APIs. + * + */ + +/* Reserved words definitions */ +#define WEBRTC_EXTERN extern +#define G_CONST const +#define WEBRTC_INLINE extern __inline + +#ifndef WEBRTC_TYPEDEFS_H +#define WEBRTC_TYPEDEFS_H + +/* Define WebRtc preprocessor identifiers based on the current build platform */ +#if defined(WIN32) + // Windows & Windows Mobile + #if !defined(WEBRTC_TARGET_PC) + #define WEBRTC_TARGET_PC + #endif +#elif defined(__APPLE__) + // Mac OS X + #if defined(__LITTLE_ENDIAN__ ) //TODO: is this used? + #if !defined(WEBRTC_TARGET_MAC_INTEL) + #define WEBRTC_TARGET_MAC_INTEL + #endif + #else + #if !defined(WEBRTC_TARGET_MAC) + #define WEBRTC_TARGET_MAC + #endif + #endif +#else + // Linux etc. + #if !defined(WEBRTC_TARGET_PC) + #define WEBRTC_TARGET_PC + #endif +#endif + +#if defined(WEBRTC_TARGET_PC) + +#if !defined(_MSC_VER) + #include +#else + // Define C99 equivalent types. + // Since MSVC doesn't include these headers, we have to write our own + // version to provide a compatibility layer between MSVC and the WebRTC + // headers. + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef signed long long int64_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long uint64_t; +#endif + +#if defined(WIN32) + typedef __int64 WebRtc_Word64; + typedef unsigned __int64 WebRtc_UWord64; +#else + typedef int64_t WebRtc_Word64; + typedef uint64_t WebRtc_UWord64; +#endif + typedef int32_t WebRtc_Word32; + typedef uint32_t WebRtc_UWord32; + typedef int16_t WebRtc_Word16; + typedef uint16_t WebRtc_UWord16; + typedef char WebRtc_Word8; + typedef uint8_t WebRtc_UWord8; + + /* Define endian for the platform */ + #define WEBRTC_LITTLE_ENDIAN + +#elif defined(WEBRTC_TARGET_MAC_INTEL) + #include + + typedef int64_t WebRtc_Word64; + typedef uint64_t WebRtc_UWord64; + typedef int32_t WebRtc_Word32; + typedef uint32_t WebRtc_UWord32; + typedef int16_t WebRtc_Word16; + typedef char WebRtc_Word8; + typedef uint16_t WebRtc_UWord16; + typedef uint8_t WebRtc_UWord8; + + /* Define endian for the platform */ + #define WEBRTC_LITTLE_ENDIAN + +#else + + #error "No platform defined for WebRtc type definitions (webrtc_typedefs.h)" + +#endif + + +#endif // WEBRTC_TYPEDEFS_H diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/CNG.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/CNG.lib new file mode 100644 index 00000000..a66ec9ec Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/CNG.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/G711.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/G711.lib new file mode 100644 index 00000000..1694a55f Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/G711.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/G722.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/G722.lib new file mode 100644 index 00000000..a23ef2c2 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/G722.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/NetEq.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/NetEq.lib new file mode 100644 index 00000000..603c10e5 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/NetEq.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/PCM16B.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/PCM16B.lib new file mode 100644 index 00000000..142784ac Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/PCM16B.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/aec.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/aec.lib new file mode 100644 index 00000000..bb4cb4c1 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/aec.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/aecm.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/aecm.lib new file mode 100644 index 00000000..bb33ea74 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/aecm.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/agc.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/agc.lib new file mode 100644 index 00000000..b42ecac2 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/agc.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/apm_util.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/apm_util.lib new file mode 100644 index 00000000..9731f9d3 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/apm_util.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_coding_module.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_coding_module.lib new file mode 100644 index 00000000..f107e6ba Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_coding_module.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_conference_mixer.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_conference_mixer.lib new file mode 100644 index 00000000..4b35db24 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_conference_mixer.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_device.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_device.lib new file mode 100644 index 00000000..325e5ed6 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_device.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_processing.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_processing.lib new file mode 100644 index 00000000..539de664 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/audio_processing.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/expat.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/expat.lib new file mode 100644 index 00000000..36f42363 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/expat.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iLBC.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iLBC.lib new file mode 100644 index 00000000..a2bc9365 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iLBC.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iSAC.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iSAC.lib new file mode 100644 index 00000000..f045c772 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iSAC.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iSACFix.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iSACFix.lib new file mode 100644 index 00000000..93ee0dfa Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/iSACFix.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/jsoncpp.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/jsoncpp.lib new file mode 100644 index 00000000..13a47a78 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/jsoncpp.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle.lib new file mode 100644 index 00000000..894441e3 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle_app.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle_app.lib new file mode 100644 index 00000000..f2a45224 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle_app.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle_p2p.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle_p2p.lib new file mode 100644 index 00000000..47d6916f Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjingle_p2p.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjpeg.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjpeg.lib new file mode 100644 index 00000000..8372b526 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libjpeg.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libvpx.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libvpx.lib new file mode 100644 index 00000000..eb06e988 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/libvpx.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/media_file.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/media_file.lib new file mode 100644 index 00000000..ec02afc4 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/media_file.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/ns.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/ns.lib new file mode 100644 index 00000000..e13d0818 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/ns.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/resampler.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/resampler.lib new file mode 100644 index 00000000..25528654 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/resampler.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/rtp_rtcp.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/rtp_rtcp.lib new file mode 100644 index 00000000..aaee9ce3 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/rtp_rtcp.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/spl.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/spl.lib new file mode 100644 index 00000000..4b8c4d85 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/spl.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/system_wrappers.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/system_wrappers.lib new file mode 100644 index 00000000..e77fa274 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/system_wrappers.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/udp_transport.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/udp_transport.lib new file mode 100644 index 00000000..b4108860 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/udp_transport.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/vad.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/vad.lib new file mode 100644 index 00000000..6d74a74b Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/vad.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_capture_module.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_capture_module.lib new file mode 100644 index 00000000..682f2be1 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_capture_module.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_engine_core.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_engine_core.lib new file mode 100644 index 00000000..2ced6b51 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_engine_core.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_processing.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_processing.lib new file mode 100644 index 00000000..3d4ee0fd Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_processing.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_render_module.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_render_module.lib new file mode 100644 index 00000000..ba218c1c Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/video_render_module.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/voice_engine_core.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/voice_engine_core.lib new file mode 100644 index 00000000..8cae256c Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/voice_engine_core.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_i420.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_i420.lib new file mode 100644 index 00000000..82d8ce7c Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_i420.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_jpeg.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_jpeg.lib new file mode 100644 index 00000000..7599a4eb Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_jpeg.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_utility.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_utility.lib new file mode 100644 index 00000000..482766a6 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_utility.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_video_coding.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_video_coding.lib new file mode 100644 index 00000000..9e87d002 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_video_coding.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_vp8.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_vp8.lib new file mode 100644 index 00000000..f097665e Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_vp8.lib differ diff --git a/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_vplib.lib b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_vplib.lib new file mode 100644 index 00000000..9b7e3206 Binary files /dev/null and b/branches/2.0/doubango/thirdparties/win32/lib/webrtc/webrtc_vplib.lib differ diff --git a/branches/2.0/doubango/tinyDAV/droid-makefile b/branches/2.0/doubango/tinyDAV/droid-makefile index 1b909503..44c01957 100644 --- a/branches/2.0/doubango/tinyDAV/droid-makefile +++ b/branches/2.0/doubango/tinyDAV/droid-makefile @@ -82,6 +82,18 @@ else SPEEX_CFLAGS := -DHAVE_LIB_SPEEX=0 endif +# Google WebRTC (Default: enabled) +ifeq ($(HAVE_WEBRTC), yes) + WEBRTC_CFLAGS := -DHAVE_WEBRTC=1 + WEBRTC_LDFLAGS := -lwebrtc_aec_$(MARCH) -lwebrtc_apm_utility_$(MARCH) -lwebrtc_ns_$(MARCH) -lwebrtc_system_wrappers_$(MARCH) +else + WEBRTC_CFLAGS := -DHAVE_WEBRTC=0 +endif + +ifeq ($(HAVE_WEBRTC_DENOISE), yes) + WEBRTC_CFLAGS += -DHAVE_WEBRTC_DENOISE=1 +endif + # ILBC (Default: disabled) ifeq ($(ILBC), yes) @@ -122,12 +134,12 @@ endif ################################ CFLAGS := $(CFLAGS_LIB) -I$(THIRDPARTIES_INC) $(ILBC_CFLAGS) $(LIBGSM_CFLAGS) \ - $(FFMPEG_CFLAGS) $(SPEEX_CFLAGS) $(SPEEX_DSP_CFLAGS) $(OPENCORE_AMR_CFLAGS) $(BV16_CFLAGS) $(G729_CFLAGS) \ + $(FFMPEG_CFLAGS) $(SPEEX_CFLAGS) $(SPEEX_DSP_CFLAGS) $(WEBRTC_CFLAGS) $(OPENCORE_AMR_CFLAGS) $(BV16_CFLAGS) $(G729_CFLAGS) \ -I../tinySAK/src -I../tinyNET/src -I../tinySDP/include -I../tinyRTP/include -I../tinyMEDIA/include -I../tinyMSRP/include -I./include \ -DJB_HISTORY_SIZE=500 LDFLAGS := $(LDFLAGS_LIB) -L$(THIRDPARTIES_LIB) -L$(THIRDPARTIES_MARCH_LIB) \ - $(FFMPEG_LDFLAGS) $(SPEEX_LDFLAGS) $(SPEEX_DSP_LDFLAGS) $(OPENCORE_AMR_LDFLAGS) $(ILBC_LDFLAGS) $(LIBGSM_LDFLAGS) $(BV16_LDFLAGS) $(G729_LDFLAGS)\ + $(FFMPEG_LDFLAGS) $(SPEEX_LDFLAGS) $(SPEEX_DSP_LDFLAGS) $(WEBRTC_LDFLAGS) $(OPENCORE_AMR_LDFLAGS) $(ILBC_LDFLAGS) $(LIBGSM_LDFLAGS) $(BV16_LDFLAGS) $(G729_LDFLAGS)\ -ltinySAK_$(MARCH) -ltinyNET_$(MARCH) -ltinySDP_$(MARCH) -ltinyRTP_$(MARCH) -ltinyMEDIA_$(MARCH) -ltinyMSRP_$(MARCH) -lm -lgcc all: $(APP) @@ -143,7 +155,8 @@ OBJS += src/audio/tdav_consumer_audio.o \ src/audio/tdav_session_audio.o \ src/audio/tdav_speex_denoise.o \ src/audio/tdav_speex_jitterbuffer.o \ - src/audio/tdav_speex_resampler.o + src/audio/tdav_speex_resampler.o \ + src/audio/tdav_webrtc_denoise.o ### video OBJS += src/video/tdav_converter_video.o \ diff --git a/branches/2.0/doubango/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h b/branches/2.0/doubango/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h new file mode 100644 index 00000000..c5b8a6f8 --- /dev/null +++ b/branches/2.0/doubango/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h @@ -0,0 +1,79 @@ +/* +* Copyright (C) 2011 Doubango Telecom +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO 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 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tdav_webrtc_denoise.h + * @brief Google WebRTC Denoiser (Noise suppression, AGC, AEC) Plugin + * + * @author Mamadou Diop + * + + */ +#ifndef TINYDAV_WEBRTC_DENOISE_H +#define TINYDAV_WEBRTC_DENOISE_H + +#include "tinydav_config.h" + +#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE) + +#include "tinymedia/tmedia_denoise.h" + +#include +#include + +#if !defined(PREFER_SPEEX_DENOISER) +# define PREFER_SPEEX_DENOISER 0 +#endif + +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER /* Speex denoiser works better than WebRTC's denoiser */ +# include +#endif + +TDAV_BEGIN_DECLS + +/** Speex denoiser*/ +typedef struct tdav_webrtc_denoise_s +{ + TMEDIA_DECLARE_DENOISE; + + void *AEC_inst; +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER + SpeexPreprocessState *SpeexDenoiser_proc; +#else + NsHandle *NS_inst; +#endif + + uint32_t sound_card_buffer_len; + uint32_t echo_skew; + uint32_t frame_size; + uint32_t sampling_rate; + + WebRtc_Word16 *temp_rec_out; +} +tdav_webrtc_denoise_t; + +const tmedia_denoise_plugin_def_t *tdav_webrtc_denoise_plugin_def_t; + +TDAV_END_DECLS + +#endif /* #if HAVE_WEBRTC */ + +#endif /* TINYDAV_WEBRTC_DENOISE_H */ diff --git a/branches/2.0/doubango/tinyDAV/src/audio/tdav_speex_denoise.c b/branches/2.0/doubango/tinyDAV/src/audio/tdav_speex_denoise.c index dc64d718..19737691 100644 --- a/branches/2.0/doubango/tinyDAV/src/audio/tdav_speex_denoise.c +++ b/branches/2.0/doubango/tinyDAV/src/audio/tdav_speex_denoise.c @@ -53,7 +53,7 @@ static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t frame_size, if(!denoiser->echo_state && TMEDIA_DENOISE(denoiser)->echo_supp_enabled){ TSK_DEBUG_INFO("Init Aec frame_size[%d] filter_length[%d] SampleRate[%d]", frame_size* sizeof(spx_int16_t),TMEDIA_DENOISE(denoiser)->echo_tail*frame_size,sampling_rate); - if((denoiser->echo_state = speex_echo_state_init(frame_size, TMEDIA_DENOISE(denoiser)->echo_tail*frame_size))){ + if((denoiser->echo_state = speex_echo_state_init(frame_size, TMEDIA_DENOISE(denoiser)->echo_tail))){ speex_echo_ctl(denoiser->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &sampling_rate); } } diff --git a/branches/2.0/doubango/tinyDAV/src/audio/tdav_webrtc_denoise.c b/branches/2.0/doubango/tinyDAV/src/audio/tdav_webrtc_denoise.c new file mode 100644 index 00000000..f89d4194 --- /dev/null +++ b/branches/2.0/doubango/tinyDAV/src/audio/tdav_webrtc_denoise.c @@ -0,0 +1,362 @@ +/* +* Copyright (C) 2011 Doubango Telecom +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO 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 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tdav_webrtc_denoise.c +* @brief Google WebRTC Denoiser (Noise suppression, AGC, AEC) Plugin +* +* @author Mamadou Diop +* + +*/ +#include "tinydav/audio/tdav_webrtc_denoise.h" + +#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE) + +#include "tsk_memory.h" +#include "tsk_debug.h" + +#include "tinymedia/tmedia_defaults.h" + +#include + +#define WEBRTC_MAX_ECHO_TAIL 500 + +#if !defined(WEBRTC_HAVE_SPL) +# define WEBRTC_HAVE_SPL 0 // To avoid linking against libspl +#endif + +#if !WEBRTC_HAVE_SPL + +#define WEBRTC_SPL_MAX_SEED_USED 0x80000000L + +static WebRtc_UWord32 WebRtcSpl_IncreaseSeed(WebRtc_UWord32 *seed) +{ + seed[0] = (seed[0] * ((WebRtc_Word32)69069) + 1) & (WEBRTC_SPL_MAX_SEED_USED - 1); + return seed[0]; +} + +static WebRtc_Word16 WebRtcSpl_RandU(WebRtc_UWord32 *seed) +{ + return (WebRtc_Word16)(WebRtcSpl_IncreaseSeed(seed) >> 16); +} + +// Creates an array of uniformly distributed variables +WebRtc_Word16 WebRtcSpl_RandUArray(WebRtc_Word16* vector, + WebRtc_Word16 vector_length, + WebRtc_UWord32* seed) +{ + int i; + for (i = 0; i < vector_length; i++) + { + vector[i] = WebRtcSpl_RandU(seed); + } + return vector_length; +} + +#endif /* WEBRTC_HAVE_SPL */ + + +static int tdav_webrtc_denoise_set(tmedia_denoise_t* self, const tmedia_param_t* param) +{ + /* tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self; */ + return tmedia_denoise_set(self, param); +} + +static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size, uint32_t sampling_rate) +{ + tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self; + int ret; + + if(!denoiser){ + TSK_DEBUG_ERROR("Invalid parameter"); + return -1; + } + + if(denoiser->AEC_inst || +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER + denoiser->SpeexDenoiser_proc +#else + denoiser->NS_inst +#endif + ){ + TSK_DEBUG_ERROR("Denoiser already initialized"); + return -2; + } + + denoiser->sound_card_buffer_len = TSK_MIN(TMEDIA_DENOISE(denoiser)->echo_tail, WEBRTC_MAX_ECHO_TAIL); + denoiser->echo_skew = TMEDIA_DENOISE(denoiser)->echo_skew; + denoiser->frame_size = frame_size; + denoiser->sampling_rate = sampling_rate; + + // + // AEC instance + // + if((ret = WebRtcAec_Create(&denoiser->AEC_inst))){ + TSK_DEBUG_ERROR("WebRtcAec_Create failed with error code = %d", ret); + return ret; + } + if((ret = WebRtcAec_Init(denoiser->AEC_inst, denoiser->sampling_rate, denoiser->sampling_rate))){ + TSK_DEBUG_ERROR("WebRtcAec_Init failed with error code = %d", ret); + return ret; + } + + // + // Noise Suppression instance + // + if(TMEDIA_DENOISE(denoiser)->noise_supp_enabled){ +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER + if((denoiser->SpeexDenoiser_proc = speex_preprocess_state_init(denoiser->frame_size, denoiser->sampling_rate))){ + int i = 1; + speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_DENOISE, &i); + i = TMEDIA_DENOISE(denoiser)->noise_supp_level; + speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_NOISE_SUPPRESS, &i); + } +#else + if((ret = WebRtcNs_Create(&denoiser->NS_inst))){ + TSK_DEBUG_ERROR("WebRtcNs_Create failed with error code = %d", ret); + return ret; + } + if((ret = WebRtcNs_Init(denoiser->NS_inst, denoiser->sampling_rate))){ + TSK_DEBUG_ERROR("WebRtcNs_Init failed with error code = %d", ret); + return ret; + } +#endif + } + + // allocate temp buffer for record processing + if(!(denoiser->temp_rec_out = tsk_realloc(denoiser->temp_rec_out, denoiser->frame_size * sizeof(WebRtc_Word16)))){ + TSK_DEBUG_ERROR("Failed to allocate new buffer"); + return -3; + } + + TSK_DEBUG_INFO("WebRTC denoiser opened"); + + return ret; +} + +static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame) +{ + tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self; + if(denoiser->AEC_inst){ + int ret; + const WebRtc_Word16 *pEchoFrame = (const WebRtc_Word16 *)echo_frame; + switch(denoiser->sampling_rate){ + case 8000: + { + if((ret = WebRtcAec_BufferFarend(denoiser->AEC_inst, pEchoFrame, denoiser->frame_size))){ + TSK_DEBUG_ERROR("WebRtcAec_BufferFarend failed with error code = %d", ret); + return ret; + } + break; + } + // 32Hz and 16Khz work but produce very ugly results + case 16000: + case 32000: + { + uint32_t i; + for(i = 0; iframe_size; i+=denoiser->frame_size/2){ + if((ret = WebRtcAec_BufferFarend(denoiser->AEC_inst, &pEchoFrame[i], denoiser->frame_size/2))){ + TSK_DEBUG_ERROR("WebRtcAec_BufferFarend failed with error code = %d", ret); + return ret; + } + } + break; + } + default: + { + TSK_DEBUG_ERROR("%d Hz not supported by WebRTC AEC", denoiser->sampling_rate); + return -2; + } + } + } + return 0; +} + + + +static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk_bool_t* silence_or_noise) +{ + tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self; + + *silence_or_noise = tsk_false; + + if(denoiser->AEC_inst){ + int ret; + WebRtc_Word16 *pAudioFrame = audio_frame; + + // Noise suppression +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER + speex_preprocess_run(denoiser->SpeexDenoiser_proc, pAudioFrame); +#else + + // WebRTC NoiseSupp only accept 10ms frames + // Our encoder will always output 20ms frames ==> execute 2x noise_supp + if( + (ret = WebRtcNs_Process(denoiser->NS_inst, pAudioFrame, tsk_null, denoiser->temp_rec_out, tsk_null)) || + (ret = WebRtcNs_Process(denoiser->NS_inst, &pAudioFrame[denoiser->frame_size/2], tsk_null, &denoiser->temp_rec_out[denoiser->frame_size/2], tsk_null)) + ) + { + TSK_DEBUG_ERROR("WebRtcNs_Process with error code = %d", ret); + return ret; + } +#endif + + // AEC + switch(denoiser->sampling_rate){ + case 8000: + { + if((ret = WebRtcAec_Process(denoiser->AEC_inst, denoiser->temp_rec_out, tsk_null, pAudioFrame, tsk_null, denoiser->frame_size, denoiser->sound_card_buffer_len, denoiser->echo_skew))){ + TSK_DEBUG_ERROR("WebRtcAec_Process with error code = %d", ret); + return ret; + } + break; + } + // 32Hz and 16Khz work but produce very ugly results + case 16000: + case 3200: + { + uint32_t i; + for(i = 0; iframe_size; i+=denoiser->frame_size/2){ + if((ret = WebRtcAec_Process(denoiser->AEC_inst, &denoiser->temp_rec_out[i], tsk_null, &pAudioFrame[i], tsk_null, denoiser->frame_size/2, denoiser->sound_card_buffer_len, denoiser->echo_skew))){ + TSK_DEBUG_ERROR("WebRtcAec_Process with error code = %d", ret); + return ret; + } + + } + break; + } + default: + { + TSK_DEBUG_ERROR("%d Hz not supported by WebRTC AEC", denoiser->sampling_rate); + return -2; + } + } + } + + return 0; +} + +WebRtc_Word16 test[]; +static int tdav_webrtc_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame) +{ + tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self; + + // Not mandatory but we could denoise the audio data sent from an encoder without denoiser + // All Doubango clients support noise suppression + return 0; +} + +static int tdav_webrtc_denoise_close(tmedia_denoise_t* self) +{ + tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self; + + if(denoiser->AEC_inst){ + WebRtcAec_Free(denoiser->AEC_inst); + denoiser->AEC_inst = tsk_null; + } +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER + if(denoiser->SpeexDenoiser_proc){ + speex_preprocess_state_destroy(denoiser->SpeexDenoiser_proc); + denoiser->SpeexDenoiser_proc = tsk_null; + } +#else + if(denoiser->NS_inst){ + WebRtcNs_Free(denoiser->NS_inst); + denoiser->NS_inst = tsk_null; + } +#endif + TSK_FREE(denoiser->temp_rec_out); + + return 0; +} + + +// +// Speex denoiser Plugin definition +// + +/* constructor */ +static tsk_object_t* tdav_webrtc_denoise_ctor(tsk_object_t * self, va_list * app) +{ + tdav_webrtc_denoise_t *denoise = self; + if(denoise){ + /* init base */ + tmedia_denoise_init(TMEDIA_DENOISE(denoise)); + /* init self */ + } + return self; +} +/* destructor */ +static tsk_object_t* tdav_webrtc_denoise_dtor(tsk_object_t * self) +{ + tdav_webrtc_denoise_t *denoise = self; + if(denoise){ + /* deinit base */ + tmedia_denoise_deinit(TMEDIA_DENOISE(denoise)); + /* deinit self */ + if(denoise->AEC_inst){ + WebRtcAec_Free(denoise->AEC_inst); + denoise->AEC_inst = tsk_null; + } + +#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER + if(denoise->SpeexDenoiser_proc){ + speex_preprocess_state_destroy(denoise->SpeexDenoiser_proc); + denoise->SpeexDenoiser_proc = tsk_null; + } +#else + if(denoise->NS_inst){ + WebRtcNs_Free(denoise->NS_inst); + denoise->NS_inst = tsk_null; + } +#endif + TSK_FREE(denoise->temp_rec_out); + } + + return self; +} +/* object definition */ +static const tsk_object_def_t tdav_webrtc_denoise_def_s = +{ + sizeof(tdav_webrtc_denoise_t), + tdav_webrtc_denoise_ctor, + tdav_webrtc_denoise_dtor, + tsk_null, +}; +/* plugin definition*/ +static const tmedia_denoise_plugin_def_t tdav_webrtc_denoise_plugin_def_s = +{ + &tdav_webrtc_denoise_def_s, + + "Audio Denoiser based on Google WebRTC", + + tdav_webrtc_denoise_set, + tdav_webrtc_denoise_open, + tdav_webrtc_denoise_echo_playback, + tdav_webrtc_denoise_process_record, + tdav_webrtc_denoise_process_playback, + tdav_webrtc_denoise_close, +}; +const tmedia_denoise_plugin_def_t *tdav_webrtc_denoise_plugin_def_t = &tdav_webrtc_denoise_plugin_def_s; + + +#endif /* HAVE_WEBRTC */ \ No newline at end of file diff --git a/branches/2.0/doubango/tinyDAV/src/tdav.c b/branches/2.0/doubango/tinyDAV/src/tdav.c index f7ab846a..9c324eb3 100644 --- a/branches/2.0/doubango/tinyDAV/src/tdav.c +++ b/branches/2.0/doubango/tinyDAV/src/tdav.c @@ -81,6 +81,9 @@ #if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_DENOISE) || HAVE_SPEEX_DENOISE) # include "tinydav/audio/tdav_speex_denoise.h" #endif +#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE) +# include "tinydav/audio/tdav_webrtc_denoise.h" +#endif // Audio resampler #if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_RESAMPLER) || HAVE_SPEEX_RESAMPLER) @@ -227,6 +230,9 @@ int tdav_init() #if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_DENOISE) || HAVE_SPEEX_DENOISE) tmedia_denoise_plugin_register(tdav_speex_denoise_plugin_def_t); #endif +#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE) + tmedia_denoise_plugin_register(tdav_webrtc_denoise_plugin_def_t); +#endif /* === Register Audio Resampler === */ #if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_RESAMPLER) || HAVE_SPEEX_RESAMPLER) @@ -494,6 +500,9 @@ int tdav_deinit() #if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_DENOISE) || HAVE_SPEEX_DENOISE) tmedia_denoise_plugin_unregister(tdav_speex_denoise_plugin_def_t); #endif +#if HAVE_WEBRTC && (!defined(HAVE_WEBRTC_DENOISE) || HAVE_WEBRTC_DENOISE) + tmedia_denoise_plugin_unregister(tdav_webrtc_denoise_plugin_def_t); +#endif /* === UnRegister Audio Resampler === */ #if HAVE_SPEEX_DSP && (!defined(HAVE_SPEEX_RESAMPLER) || HAVE_SPEEX_RESAMPLER) diff --git a/branches/2.0/doubango/tinyDAV/tinyDAV.vcproj b/branches/2.0/doubango/tinyDAV/tinyDAV.vcproj index 8979501b..4d0a3ecf 100644 --- a/branches/2.0/doubango/tinyDAV/tinyDAV.vcproj +++ b/branches/2.0/doubango/tinyDAV/tinyDAV.vcproj @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(PSDK_DIR)include";"$(DXSDK_DIR)include";..\thirdparties\win32\include;include;..\tinyMSRP\include;..\tinyRTP\include;..\tinyMEDIA\include;..\tinySDP\include;..\tinyNET\src;..\tinyDSHOW\include;..\tinySAK\src;..\thirdparties\win32\include\BroadVoice16\bvcommon;..\thirdparties\win32\include\BroadVoice16\bv16" - PreprocessorDefinitions="HAVE_G729=0;HAVE_BV16=0;HAVE_OPENCORE_AMR=1;HAVE_ILBC=0;HAVE_LIBGSM=1;HAVE_TINYDSHOW=1;HAVE_DSOUND_H=1;HAVE_WAVE_API=0;HAVE_FFMPEG=1;HAVE_SPEEX_DSP=1;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;G192BITSTREAM=0;DEBUG_LEVEL=DEBUG_LEVEL_INFO;WIN32;_DEBUG;_WINDOWS;_USRDLL;_WIN32_WINNT=0x0501;TINYDAV_EXPORTS" + PreprocessorDefinitions="HAVE_G729=0;HAVE_BV16=0;HAVE_OPENCORE_AMR=1;HAVE_ILBC=0;HAVE_LIBGSM=1;HAVE_TINYDSHOW=1;HAVE_DSOUND_H=1;HAVE_WAVE_API=0;HAVE_FFMPEG=1;HAVE_SPEEX_DSP=1;HAVE_WEBRTC=1;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;G192BITSTREAM=0;DEBUG_LEVEL=DEBUG_LEVEL_INFO;WIN32;_DEBUG;_WINDOWS;_USRDLL;_WIN32_WINNT=0x0501;TINYDAV_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -64,9 +64,9 @@ /> + + @@ -654,6 +658,10 @@ RelativePath=".\src\audio\tdav_speex_resampler.c" > + + diff --git a/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_defaults.h b/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_defaults.h index 4c93da33..47c99ce9 100644 --- a/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_defaults.h +++ b/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_defaults.h @@ -38,7 +38,9 @@ TINYMEDIA_API tmedia_bandwidth_level_t tmedia_defaults_get_bl(); // Denoiser: Echo suppression, AEC, Noise redution, AGC, ... // TINYMEDIA_API int tmedia_defaults_set_echo_tail(uint32_t echo_tail); +TINYMEDIA_API int tmedia_defaults_set_echo_skew(uint32_t echo_skew); TINYMEDIA_API uint32_t tmedia_defaults_get_echo_tail(); +TINYMEDIA_API uint32_t tmedia_defaults_get_echo_skew(); TINYMEDIA_API int tmedia_defaults_set_echo_supp_enabled(tsk_bool_t echo_supp_enabled); TINYMEDIA_API tsk_bool_t tmedia_defaults_get_echo_supp_enabled(); TINYMEDIA_API int tmedia_defaults_set_agc_enabled(tsk_bool_t agc_enabled); diff --git a/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_denoise.h b/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_denoise.h index 4432c633..c8598d1f 100644 --- a/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_denoise.h +++ b/branches/2.0/doubango/tinyMEDIA/include/tinymedia/tmedia_denoise.h @@ -46,6 +46,7 @@ typedef struct tmedia_denoise_s tsk_bool_t opened; uint32_t echo_tail; + uint32_t echo_skew; tsk_bool_t echo_supp_enabled; tsk_bool_t agc_enabled ; float agc_level; diff --git a/branches/2.0/doubango/tinyMEDIA/src/tmedia_defaults.c b/branches/2.0/doubango/tinyMEDIA/src/tmedia_defaults.c index a836282e..305cae4c 100644 --- a/branches/2.0/doubango/tinyMEDIA/src/tmedia_defaults.c +++ b/branches/2.0/doubango/tinyMEDIA/src/tmedia_defaults.c @@ -45,6 +45,7 @@ tmedia_bandwidth_level_t tmedia_defaults_get_bl() // Denoiser: Echo suppression, AEC, Noise redution, AGC, ... // static uint32_t __echo_tail = 20; +static uint32_t __echo_skew = 0; static tsk_bool_t __echo_supp_enabled; static tsk_bool_t __agc_enabled = tsk_false; static float __agc_level = 8000.0f; @@ -61,11 +62,22 @@ int tmedia_defaults_set_echo_tail(uint32_t echo_tail) return 0; } +int tmedia_defaults_set_echo_skew(uint32_t echo_skew) +{ + __echo_skew = echo_skew; + return 0; +} + uint32_t tmedia_defaults_get_echo_tail() { return __echo_tail; } +uint32_t tmedia_defaults_get_echo_skew() +{ + return __echo_skew; +} + int tmedia_defaults_set_echo_supp_enabled(tsk_bool_t echo_supp_enabled) { __echo_supp_enabled = echo_supp_enabled; diff --git a/branches/2.0/doubango/tinyMEDIA/src/tmedia_denoise.c b/branches/2.0/doubango/tinyMEDIA/src/tmedia_denoise.c index 2a5cdf12..c868e330 100644 --- a/branches/2.0/doubango/tinyMEDIA/src/tmedia_denoise.c +++ b/branches/2.0/doubango/tinyMEDIA/src/tmedia_denoise.c @@ -42,6 +42,7 @@ int tmedia_denoise_init(tmedia_denoise_t* self) } self->echo_tail = tmedia_defaults_get_echo_tail(); + self->echo_skew = tmedia_defaults_get_echo_skew(); self->echo_supp_enabled = tmedia_defaults_get_echo_supp_enabled(); self->agc_enabled = tmedia_defaults_get_agc_enabled(); self->agc_level = tmedia_defaults_get_agc_level(); diff --git a/branches/2.0/doubango/tinyMEDIA/src/tmedia_session.c b/branches/2.0/doubango/tinyMEDIA/src/tmedia_session.c index dbf5bd1d..938a98b3 100644 --- a/branches/2.0/doubango/tinyMEDIA/src/tmedia_session.c +++ b/branches/2.0/doubango/tinyMEDIA/src/tmedia_session.c @@ -344,7 +344,6 @@ tmedia_codecs_L_t* tmedia_session_match_codec(tmedia_session_t* self, const tsdp // Guard to avoid matching a codec more than once // For example, H.264 codecs without profiles (Jetsi,Tiscali PC client) to distinguish them could match more than once if(matchingCodecs && tsk_list_find_object_by_pred(matchingCodecs, __pred_find_codec_by_format, codec)){ - TSK_DEBUG_WARN("Codec already matched. Try to add valid FMTP to your codec to help matching."); continue; }