提交 23a744ad authored 作者: Michael Jerris's avatar Michael Jerris

Initial windows build for new portaudio module, so far completely untested, it…

Initial windows build for new portaudio module, so far completely untested, it will NOT work on 64 bit and potentially problematic on SMP boxes still as I am building right now.  This build currently uses only winmme, will follow up with better support for optionally building against direct sound, asio, and wasapi.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3993 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 d89c21fd
差异被折叠。
......@@ -35,9 +35,9 @@ Pa_GetStreamReadAvailable @31
Pa_GetStreamWriteAvailable @32
Pa_GetSampleSize @33
Pa_Sleep @34
PaAsio_GetAvailableLatencyValues @50
PaAsio_ShowControlPanel @51
;PaAsio_GetAvailableLatencyValues @50
;PaAsio_ShowControlPanel @51
PaUtil_InitializeX86PlainConverters @52
PaAsio_GetInputChannelName @53
PaAsio_GetOutputChannelName @54
;PaAsio_GetInputChannelName @53
;PaAsio_GetOutputChannelName @54
PaUtil_SetDebugPrintFunction @55
\ No newline at end of file
......@@ -5,16 +5,28 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "portaudio.vcpr
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug DirectSound|Win32 = Debug DirectSound|Win32
Debug DirectSound|x64 = Debug DirectSound|x64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release DirectSound|Win32 = Release DirectSound|Win32
Release DirectSound|x64 = Release DirectSound|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|Win32.ActiveCfg = Debug DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|Win32.Build.0 = Debug DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|x64.ActiveCfg = Debug DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug DirectSound|x64.Build.0 = Debug DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|Win32.ActiveCfg = Release DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|Win32.Build.0 = Release DirectSound|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|x64.ActiveCfg = Release DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release DirectSound|x64.Build.0 = Release DirectSound|x64
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64
......
......@@ -124,7 +124,7 @@ static const double ditheredInt16Scaler_ = 0x7FFE;
#define PA_DITHER_BITS_ (15)
/* Multiply by PA_FLOAT_DITHER_SCALE_ to get a float between -2.0 and +1.99999 */
#define PA_FLOAT_DITHER_SCALE_ (1.0 / ((1<<PA_DITHER_BITS_)-1))
#define PA_FLOAT_DITHER_SCALE_ (1.0f / ((1<<PA_DITHER_BITS_)-1))
static const float const_float_dither_scale_ = PA_FLOAT_DITHER_SCALE_;
#define PA_DITHER_SHIFT_ ((32 - PA_DITHER_BITS_) + 1)
......
......@@ -42,8 +42,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\portaudio_v18_1\pa_common&quot;;&quot;$(InputDir)..\..\..\..\libs\portaudio_v18_1\pa_win_wmme&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\portaudio\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -52,6 +52,7 @@
WarnAsError="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4100;4101"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......@@ -126,14 +127,15 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\portaudio_v18_1\pa_common&quot;;&quot;$(InputDir)..\..\..\..\libs\portaudio_v18_1\pa_win_wmme&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\include&quot;;&quot;$(InputDir)&quot;;&quot;$(InputDir)..\..\..\..\libs\include&quot;;&quot;$(InputDir)..\..\..\..\libs\portaudio\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4100;4101"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......@@ -197,11 +199,11 @@
>
</File>
<File
RelativePath=".\pablio.c"
RelativePath=".\pa_ringbuffer.c"
>
</File>
<File
RelativePath=".\ringbuffer.c"
RelativePath=".\pablio.c"
>
</File>
</Filter>
......@@ -211,11 +213,11 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\pablio.h"
RelativePath=".\pa_ringbuffer.h"
>
</File>
<File
RelativePath=".\ringbuffer.h"
RelativePath=".\pablio.h"
>
</File>
</Filter>
......
......@@ -258,7 +258,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
if (olen == 0) {
break;
}
WriteAudioStream(globals.ring_stream, abuf, olen);
WriteAudioStream(globals.ring_stream, abuf, (long)olen);
}
}
}
......@@ -628,8 +628,8 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
}
tech_pvt->hold_frame.datalen = olen * sizeof(int16_t);
tech_pvt->hold_frame.samples = olen;
tech_pvt->hold_frame.datalen = (uint32_t)(olen * sizeof(int16_t));
tech_pvt->hold_frame.samples = (uint32_t)olen;
*frame = &tech_pvt->hold_frame;
}
......@@ -1313,8 +1313,8 @@ static switch_status_t engage_device(int sample_rate, int codec_ms)
static switch_status_t engage_ring_device(int sample_rate, int channels)
{
int codec_ms = 20;
PaStreamParameters inputParameters, outputParameters;
//int codec_ms = 20;
PaStreamParameters outputParameters;
PaError err;
if (!globals.ring_stream) {
......@@ -1367,7 +1367,7 @@ static switch_status_t dtmf_call(char **argv, int argc, switch_stream_handle_t *
static switch_status_t switch_call(char **argv, int argc, switch_stream_handle_t *stream)
{
private_t *tp,*tech_pvt;
private_t *tp,*tech_pvt = NULL;
char *callid = argv[0];
uint8_t one_call = 0;
......@@ -1490,9 +1490,10 @@ static switch_status_t list_calls(char **argv, int argc, switch_stream_handle_t
switch_mutex_lock(globals.pvt_lock);
for (tp = globals.call_list; tp; tp = tp->next) {
x++;
switch_channel_t *channel = switch_core_session_get_channel(tp->session);
switch_channel_t *channel;
switch_caller_profile_t *profile;
x++;
channel = switch_core_session_get_channel(tp->session);
if ((profile = switch_channel_get_caller_profile(channel))) {
if (profile->originatee_caller_profile) {
......@@ -1534,9 +1535,22 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
switch_channel_t *channel;
char *dialplan = globals.dialplan;
char *cid_name = globals.cid_name;
char *cid_num = globals.cid_num;
if (!switch_strlen_zero(argv[1])) {
char *cid_num = globals.cid_num;
switch_core_session_add_stream(session, NULL);
if ((tech_pvt = (private_t *) switch_core_session_alloc(session, sizeof(private_t))) != 0) {
memset(tech_pvt, 0, sizeof(*tech_pvt));
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
channel = switch_core_session_get_channel(session);
switch_core_session_set_private(session, tech_pvt);
tech_pvt->session = session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
return SWITCH_STATUS_MEMERR;
}
if (!switch_strlen_zero(argv[1])) {
dialplan = argv[1];
}
......@@ -1555,20 +1569,6 @@ static switch_status_t place_call(char **argv, int argc, switch_stream_handle_t
if (!switch_strlen_zero(argv[4])) {
tech_pvt->codec_ms = atoi(argv[5]);
}
switch_core_session_add_stream(session, NULL);
if ((tech_pvt = (private_t *) switch_core_session_alloc(session, sizeof(private_t))) != 0) {
memset(tech_pvt, 0, sizeof(*tech_pvt));
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
channel = switch_core_session_get_channel(session);
switch_core_session_set_private(session, tech_pvt);
tech_pvt->session = session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
return SWITCH_STATUS_MEMERR;
}
if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
NULL,
......
......@@ -102,8 +102,10 @@
# endif
#else
# ifdef ALLOW_SMP_DANGERS
# ifndef _MSC_VER
# warning Memory barriers not defined on this system or system unknown
# warning For SMP safety, you should fix this.
# endif
# define PaUtil_FullMemoryBarrier()
# define PaUtil_ReadMemoryBarrier()
# define PaUtil_WriteMemoryBarrier()
......
......@@ -204,8 +204,6 @@ PaError OpenAudioStream( PABLIO_Stream **rwblPtr,
PaStreamFlags streamFlags)
{
long bytesPerSample;
long doRead = 0;
long doWrite = 0;
PaError err;
PABLIO_Stream *aStream;
long minNumBuffers;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论