diff options
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/build/pjsystest.dsp | 7 | ||||
-rw-r--r-- | pjsip-apps/build/pjsystest.vcproj | 145 | ||||
-rw-r--r-- | pjsip-apps/src/pjsystest/systest.c | 28 | ||||
-rw-r--r-- | pjsip-apps/src/pjsystest/systest.h | 32 |
4 files changed, 184 insertions, 28 deletions
diff --git a/pjsip-apps/build/pjsystest.dsp b/pjsip-apps/build/pjsystest.dsp index d3f45f4d..40e11da2 100644 --- a/pjsip-apps/build/pjsystest.dsp +++ b/pjsip-apps/build/pjsystest.dsp @@ -91,13 +91,6 @@ LINK32=link.exe # Begin Source File
SOURCE=..\src\pjsystest\main_console.c
-
-!IF "$(CFG)" == "pjsystest - Win32 Release"
-
-!ELSEIF "$(CFG)" == "pjsystest - Win32 Debug"
-
-!ENDIF
-
# End Source File
# Begin Source File
diff --git a/pjsip-apps/build/pjsystest.vcproj b/pjsip-apps/build/pjsystest.vcproj index f3ac233c..5f72a58b 100644 --- a/pjsip-apps/build/pjsystest.vcproj +++ b/pjsip-apps/build/pjsystest.vcproj @@ -14,6 +14,9 @@ <Platform
Name="Windows Mobile 6 Professional SDK (ARMV4I)"
/>
+ <Platform
+ Name="Win32"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -158,6 +161,69 @@ />
</Configuration>
<Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../pjsip/include,../../pjlib/include,../../pjlib-util/include,../../pjmedia/include,../../pjnath/include"
+ PreprocessorDefinitions="_CONSOLE;"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Iphlpapi.lib dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib user32.lib gdi32.lib advapi32.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"
ConfigurationType="1"
InheritedPropertySheets="..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops;..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops"
@@ -296,6 +362,69 @@ <DebuggerTool
/>
</Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../pjsip/include,../../pjlib/include,../../pjlib-util/include,../../pjmedia/include,../../pjnath/include"
+ PreprocessorDefinitions="_CONSOLE;"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Iphlpapi.lib dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib ole32.lib user32.lib gdi32.lib advapi32.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -344,6 +473,22 @@ <File
RelativePath="..\src\pjsystest\main_wm.c"
>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\src\pjsystest\systest.c"
diff --git a/pjsip-apps/src/pjsystest/systest.c b/pjsip-apps/src/pjsystest/systest.c index 01401848..600ba80c 100644 --- a/pjsip-apps/src/pjsystest/systest.c +++ b/pjsip-apps/src/pjsystest/systest.c @@ -377,11 +377,6 @@ static void systest_rec_audio(void) pjsua_recorder_destroy(rec_id); rec_id = PJSUA_INVALID_ID; - key = gui_msgbox(title, - "Recording has been stopped. Press OK to playback " - "the recorded audio.", - WITH_OK); - status = pjsua_player_create(&filename, 0, &play_id); if (status != PJ_SUCCESS) goto on_return; @@ -393,6 +388,7 @@ static void systest_rec_audio(void) goto on_return; key = gui_msgbox(title, + "Recording has been stopped. " "The recorded audio is being played now to " "the speaker device, in a loop. Listen for " "any audio impairments. Press OK to stop.", @@ -486,7 +482,7 @@ static void systest_audio_test(void) param.dir = dir; param.rec_id = systest.rec_id; param.play_id = systest.play_id; - param.clock_rate = systest.media_cfg.clock_rate; + param.clock_rate = systest.media_cfg.snd_clock_rate; param.channel_count = systest.media_cfg.channel_count; param.samples_per_frame = param.clock_rate * param.channel_count * systest.media_cfg.audio_frame_ptime / 1000; @@ -568,8 +564,8 @@ static void systest_audio_test(void) -result.rec_drift_per_sec; pj_ansi_snprintf(drifttext, sizeof(drifttext), - "Clock drifts detected. Capture device " - "is running %d samples per second %s " + "Clock drifts detected. Capture " + "is %d samples/sec %s " "than the playback device", drift, which); problems[problem_count++] = drifttext; @@ -680,7 +676,7 @@ static int calculate_latency(pj_pool_t *pool, pjmedia_port *wav, lat = (max_echo_pos - max_signal_pos) * 1000 / wav->info.clock_rate; -#if 1 +#if 0 PJ_LOG(4,(THIS_FILE, "Signal at %dms, echo at %d ms, latency %d ms", max_signal_pos * 1000 / wav->info.clock_rate, max_echo_pos * 1000 / wav->info.clock_rate, @@ -770,6 +766,7 @@ static void systest_latency_test(void) /* We're running */ + PJ_LOG(3,(THIS_FILE, "Please wait while test is running (~10 sec)")); gui_sleep(10); /* Done with the test */ @@ -946,10 +943,14 @@ static void systest_display_settings(void) pj_get_version()); len = strlen(textbuf); - pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Clock rate: %d\r\n", + pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Test clock rate: %d\r\n", systest.media_cfg.clock_rate); len = strlen(textbuf); + pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Device clock rate: %d\r\n", + systest.media_cfg.snd_clock_rate); + len = strlen(textbuf); + pj_ansi_snprintf(textbuf+len, sizeof(textbuf)-len, "Aud frame ptime: %d\r\n", systest.media_cfg.audio_frame_ptime); len = strlen(textbuf); @@ -1031,12 +1032,13 @@ int systest_init(void) pjsua_config_default(&systest.ua_cfg); pjsua_media_config_default(&systest.media_cfg); - systest.media_cfg.clock_rate = CLOCK_RATE; + systest.media_cfg.clock_rate = TEST_CLOCK_RATE; + systest.media_cfg.snd_clock_rate = DEV_CLOCK_RATE; if (OVERRIDE_AUD_FRAME_PTIME) systest.media_cfg.audio_frame_ptime = OVERRIDE_AUD_FRAME_PTIME; systest.media_cfg.channel_count = CHANNEL_COUNT; - systest.rec_id = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; - systest.play_id = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; + systest.rec_id = REC_DEV_ID; + systest.play_id = PLAY_DEV_ID; systest.media_cfg.ec_tail_len = 0; #if defined(OVERRIDE_AUDDEV_PLAY_LAT) && OVERRIDE_AUDDEV_PLAY_LAT!=0 diff --git a/pjsip-apps/src/pjsystest/systest.h b/pjsip-apps/src/pjsystest/systest.h index 1b802fe7..f5043be2 100644 --- a/pjsip-apps/src/pjsystest/systest.h +++ b/pjsip-apps/src/pjsystest/systest.h @@ -24,12 +24,28 @@ /* * Overrideable parameters */ -#define OVERRIDE_AUDDEV_REC_LAT 100 -#define OVERRIDE_AUDDEV_PLAY_LAT 200 +#define REC_DEV_ID PJMEDIA_AUD_DEFAULT_CAPTURE_DEV +#define PLAY_DEV_ID PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV +//#define REC_DEV_ID 5 +//#define PLAY_DEV_ID 5 +#define OVERRIDE_AUDDEV_REC_LAT 0 +#define OVERRIDE_AUDDEV_PLAY_LAT 0 #define OVERRIDE_AUD_FRAME_PTIME 0 -#define CLOCK_RATE 8000 + +/* Don't change this */ #define CHANNEL_COUNT 1 +/* If you change CLOCK_RATE then the input WAV files need to be + * changed, so normally don't need to change this. + */ +#define TEST_CLOCK_RATE 8000 + +/* You may change sound device's clock rate as long as resampling + * is enabled. + */ +#define DEV_CLOCK_RATE 8000 + + #if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE #define LOG_OUT_PATH "\\PJSYSTEST.LOG" #define RESULT_OUT_PATH "\\PJSYSTEST_RESULT.TXT" @@ -39,11 +55,11 @@ #define WAV_LATENCY_OUT_PATH "\\PJSYSTEST_LATREC.WAV" #else #define LOG_OUT_PATH "PJSYSTEST.LOG" - #define RESULT_OUT_PATH "PJSYSTEST.TXT" - #define WAV_PLAYBACK_PATH "pjsip8.wav" - #define WAV_REC_OUT_PATH "TESTREC.WAV" - #define WAV_TOCK8_PATH "TOCK8.WAV" - #define WAV_LATENCY_OUT_PATH "LATENCY.WAV" + #define RESULT_OUT_PATH "PJSYSTEST_RESULT.TXT" + #define WAV_PLAYBACK_PATH "input.8.wav" + #define WAV_REC_OUT_PATH "PJSYSTEST_TESTREC.WAV" + #define WAV_TOCK8_PATH "tock8.wav" + #define WAV_LATENCY_OUT_PATH "PJSYSTEST_LATREC.WAV" #endif #ifdef __cplusplus |