From 98bbb9affe0a1d9fe163c964a3c1c4fa392ca937 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Thu, 1 Nov 2012 21:59:18 -0500 Subject: [PATCH] mostly trivial windows fixes for last several commits - anthm pthread_self in mod_dptools is not in scope for windows? commented out. --- libs/stfu/stfu.c | 9 ++++++- libs/stfu/stfu.h | 2 +- .../applications/mod_dptools/mod_dptools.c | 2 +- src/mod/codecs/mod_silk/mod_silk.c | 7 ++++- .../mod_managed/freeswitch_wrap.2010.cxx | 10 +++++-- .../mod_managed/managed/swig.2010.cs | 26 ++++++++++++++++--- w32/Library/FreeSwitchCore.2008.vcproj | 12 ++++----- w32/Library/FreeSwitchCore.2010.vcxproj | 10 +++---- 8 files changed, 57 insertions(+), 21 deletions(-) diff --git a/libs/stfu/stfu.c b/libs/stfu/stfu.c index f02219cd9e..a2f9760da9 100644 --- a/libs/stfu/stfu.c +++ b/libs/stfu/stfu.c @@ -806,15 +806,22 @@ stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i) return rframe; } -int32_t stfu_n_copy_next_frame(stfu_instance_t *jb, uint32_t timestamp, uint16_t seq, uint16_t distance, stfu_frame_t *next_frame) +STFU_DECLARE(int32_t) stfu_n_copy_next_frame(stfu_instance_t *jb, uint32_t timestamp, uint16_t seq, uint16_t distance, stfu_frame_t *next_frame) { uint32_t i = 0, j = 0; +#ifdef WIN32 +#pragma warning (disable:4204) +#endif stfu_queue_t *queues[] = { jb->out_queue, jb->in_queue, jb->old_queue}; +#ifdef WIN32 +#pragma warning (default:4204) +#endif stfu_queue_t *queue = NULL; stfu_frame_t *frame = NULL; uint32_t target_ts = 0; + seq = seq; if (!next_frame) return 0; target_ts = timestamp + (distance - 1) * jb->samples_per_packet; diff --git a/libs/stfu/stfu.h b/libs/stfu/stfu.h index bc3dd519ba..e1a0d439a3 100644 --- a/libs/stfu/stfu.h +++ b/libs/stfu/stfu.h @@ -191,7 +191,7 @@ stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_ stfu_status_t stfu_n_resize(stfu_instance_t *i, uint32_t qlen); stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uint32_t pt, void *data, size_t datalen, uint32_t timer_ts, int last); stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i); -int32_t stfu_n_copy_next_frame(stfu_instance_t *jb, uint32_t timestamp, uint16_t seq, uint16_t distance, stfu_frame_t *next_frame); +STFU_DECLARE(int32_t) stfu_n_copy_next_frame(stfu_instance_t *jb, uint32_t timestamp, uint16_t seq, uint16_t distance, stfu_frame_t *next_frame); void stfu_n_reset(stfu_instance_t *i); stfu_status_t stfu_n_sync(stfu_instance_t *i, uint32_t packets); void stfu_n_call_me(stfu_instance_t *i, stfu_n_call_me_t callback, void *udata); diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 6f8084648a..d274198ecd 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -5154,7 +5154,7 @@ void *SWITCH_THREAD_FUNC call_monitor_thread(switch_thread_t *thread, void *obj) } while (busy); - printf("%ld ASS LAUNCH %s %d %d\n", (long)pthread_self(), argv[sent], sent, size); + /* printf("%ld ASS LAUNCH %s %d %d\n", (long)pthread_self(), argv[sent], sent, size); */ launch_call(argv[sent++], cm->path, cm->exten, cm->context, cm->dp, mutex, &counter, &var_event); } diff --git a/src/mod/codecs/mod_silk/mod_silk.c b/src/mod/codecs/mod_silk/mod_silk.c index 922c86d06b..bb0eeaa7fd 100644 --- a/src/mod/codecs/mod_silk/mod_silk.c +++ b/src/mod/codecs/mod_silk/mod_silk.c @@ -31,7 +31,11 @@ */ #include "switch.h" +#ifndef WIN32 #include "stfu.h" +#else +#include "../../../libs/stfu/stfu.h" +#endif #include "SKP_Silk_SDK_API.h" SWITCH_MODULE_LOAD_FUNCTION(mod_silk_load); @@ -331,6 +335,7 @@ static switch_status_t switch_silk_decode(switch_codec_t *codec, SKP_int16 reclen; int32_t found_frame; switch_bool_t did_lbrr = SWITCH_FALSE; + int i; *decoded_data_len = 0; @@ -339,7 +344,7 @@ static switch_status_t switch_silk_decode(switch_codec_t *codec, jb = switch_core_session_get_jb(session, SWITCH_MEDIA_TYPE_AUDIO); } if (jb && codec && codec->cur_frame) { - for (int i = 1; i <= MAX_LBRR_DELAY; i++) { + for (i = 1; i <= MAX_LBRR_DELAY; i++) { found_frame = stfu_n_copy_next_frame(jb, codec->cur_frame->timestamp, codec->cur_frame->seq, i, &next_frame); if (found_frame) { SKP_Silk_SDK_search_for_LBRR(next_frame.data, next_frame.dlen, i, (SKP_uint8*) &recbuff, &reclen); diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index 8d09ec6b03..d37e098099 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -8269,15 +8269,21 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_hupall(int jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_hupall_matching_var(char * jarg1, char * jarg2, int jarg3) { +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_session_hupall_matching_var_ans(char * jarg1, char * jarg2, int jarg3, int jarg4) { + unsigned long jresult ; char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; switch_call_cause_t arg3 ; + switch_hup_type_t arg4 ; + uint32_t result; arg1 = (char *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_call_cause_t)jarg3; - switch_core_session_hupall_matching_var((char const *)arg1,(char const *)arg2,arg3); + arg4 = (switch_hup_type_t)jarg4; + result = (uint32_t)switch_core_session_hupall_matching_var_ans((char const *)arg1,(char const *)arg2,arg3,arg4); + jresult = (unsigned long)result; + return jresult; } diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index 25a99cdf69..24aac8ed9e 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -1606,8 +1606,9 @@ public class freeswitch { freeswitchPINVOKE.switch_core_session_hupall((int)cause); } - public static void switch_core_session_hupall_matching_var(string var_name, string var_val, switch_call_cause_t cause) { - freeswitchPINVOKE.switch_core_session_hupall_matching_var(var_name, var_val, (int)cause); + public static uint switch_core_session_hupall_matching_var_ans(string var_name, string var_val, switch_call_cause_t cause, switch_hup_type_t type) { + uint ret = freeswitchPINVOKE.switch_core_session_hupall_matching_var_ans(var_name, var_val, (int)cause, (int)type); + return ret; } public static switch_console_callback_match switch_core_session_findall_matching_var(string var_name, string var_val) { @@ -8694,8 +8695,8 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_hupall")] public static extern void switch_core_session_hupall(int jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_hupall_matching_var")] - public static extern void switch_core_session_hupall_matching_var(string jarg1, string jarg2, int jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_hupall_matching_var_ans")] + public static extern uint switch_core_session_hupall_matching_var_ans(string jarg1, string jarg2, int jarg3, int jarg4); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_findall_matching_var")] public static extern IntPtr switch_core_session_findall_matching_var(string jarg1, string jarg2); @@ -28851,6 +28852,23 @@ public class switch_hold_record_t : IDisposable { namespace FreeSWITCH.Native { +public enum switch_hup_type_t { + SHT_NONE = 0, + SHT_UNANSWERED = (1 << 0), + SHT_ANSWERED = (1 << 1) +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + using System; using System.Runtime.InteropServices; diff --git a/w32/Library/FreeSwitchCore.2008.vcproj b/w32/Library/FreeSwitchCore.2008.vcproj index 624e125542..16635f2b93 100644 --- a/w32/Library/FreeSwitchCore.2008.vcproj +++ b/w32/Library/FreeSwitchCore.2008.vcproj @@ -48,7 +48,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;TPL_NOLIB;" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;TPL_NOLIB;STFU_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -142,7 +142,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;TPL_NOLIB;" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;TPL_NOLIB;STFU_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -235,7 +235,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;TPL_NOLIB;" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;TPL_NOLIB;STFU_EXPORTS" RuntimeLibrary="2" UsePrecompiledHeader="2" PrecompiledHeaderThrough="switch.h" @@ -325,7 +325,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;TPL_NOLIB;" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;TPL_NOLIB;STFU_EXPORTS" RuntimeLibrary="2" UsePrecompiledHeader="2" PrecompiledHeaderThrough="switch.h" @@ -855,11 +855,11 @@ > Disabled ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;STFU_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -147,7 +147,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs Disabled ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;PCRE_STATIC;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;STFU_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -199,7 +199,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs MaxSpeed ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;ENABLE_ZRTP;TPL_NOLIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;ENABLE_ZRTP;TPL_NOLIB;STFU_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDLL Use switch.h @@ -248,7 +248,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs MaxSpeed ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\win32\sqlite;..\..\libs\pcre;..\..\libs\stfu;..\..\libs\speex\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\tiff-4.0.2\libtiff;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;ENABLE_ZRTP;TPL_NOLIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;PCRE_STATIC;ENABLE_ZRTP;TPL_NOLIB;STFU_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDLL Use switch.h @@ -836,4 +836,4 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs - + \ No newline at end of file