- Timestamp:
- Nov 8, 2009 3:35:41 AM (15 years ago)
- Location:
- pjproject/trunk/pjsip-apps
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/build/Makefile
r2506 r2991 40 40 41 41 42 ############################################################################### 43 # Defines for building pjsystest 44 # 45 export PJSYSTEST_SRCDIR = ../src/pjsystest 46 export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 47 systest.o main_console.o 48 export PJSYSTEST_CFLAGS += $(_CFLAGS) 49 export PJSYSTEST_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) 50 export PJSYSTEST_EXE:=../bin/pjsystest-$(TARGET_NAME)$(HOST_EXE) 51 52 42 53 export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 43 54 ############################################################################### … … 45 56 # 46 57 # 47 TARGETS := pjsua samples58 TARGETS := pjsua pjsystest samples 48 59 49 60 .PHONY: $(TARGETS) … … 61 72 $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(PJSUA_EXE) 62 73 74 pjsystest: 75 $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(PJSYSTEST_EXE) 76 63 77 samples: 64 78 $(MAKE) -f Samples.mak … … 73 87 @if test "$@" = "depend"; then \ 74 88 echo '$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ 89 echo '$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \ 75 90 fi 76 91 -
pjproject/trunk/pjsip-apps/src/pjsystest/systest.c
r2840 r2991 115 115 116 116 strcpy(themsg, title); 117 strncat(themsg, errmsg, sizeof(themsg) );117 strncat(themsg, errmsg, sizeof(themsg)-1); 118 118 themsg[sizeof(themsg)-1] = '\0'; 119 119 … … 246 246 } 247 247 248 /* Util: create file player, each time trying different paths until we get 249 * the file. 250 */ 251 static pj_status_t create_player(unsigned path_cnt, const char *paths[], 252 pjsua_player_id *p_id) 253 { 254 pj_str_t name; 255 pj_status_t status = PJ_ENOTFOUND; 256 unsigned i; 257 258 for (i=0; i<path_cnt; ++i) { 259 status = pjsua_player_create(pj_cstr(&name, paths[i]), 0, p_id); 260 if (status == PJ_SUCCESS) 261 return PJ_SUCCESS; 262 } 263 return status; 264 } 248 265 249 266 /***************************************************************************** 250 267 * test: play WAV file 251 268 */ 252 static void systest_play_wav( const char *filename)269 static void systest_play_wav(unsigned path_cnt, const char *paths[]) 253 270 { 254 271 pjsua_player_id play_id = PJSUA_INVALID_ID; 255 272 enum gui_key key; 256 273 test_item_t *ti; 257 pj_str_t name;258 274 const char *title = "WAV File Playback Test"; 259 275 pj_status_t status; … … 269 285 "for a while to make sure that everything is okay." 270 286 " Press OK to start, CANCEL to skip", 271 filename);287 paths[0]); 272 288 273 289 key = gui_msgbox(title, textbuf, … … 281 297 282 298 /* WAV port */ 283 status = pjsua_player_create(pj_cstr(&name, filename), 0, &play_id);299 status = create_player(path_cnt, paths, &play_id); 284 300 if (status != PJ_SUCCESS) 285 301 goto on_return; … … 314 330 static void systest_play_wav1(void) 315 331 { 316 systest_play_wav(WAV_PLAYBACK_PATH); 332 const char *paths[] = { WAV_PLAYBACK_PATH, 333 ALT_PATH1 WAV_PLAYBACK_PATH }; 334 systest_play_wav(PJ_ARRAY_SIZE(paths), paths); 317 335 } 318 336 319 337 static void systest_play_wav2(void) 320 338 { 321 systest_play_wav(WAV_TOCK8_PATH); 339 const char *paths[] = { WAV_TOCK8_PATH, 340 ALT_PATH1 WAV_TOCK8_PATH}; 341 systest_play_wav(PJ_ARRAY_SIZE(paths), paths); 322 342 } 323 343 … … 713 733 static void systest_latency_test(void) 714 734 { 715 const pj_str_t ref_wav_file = pj_str(WAV_TOCK8_PATH);735 const char *ref_wav_paths[] = { WAV_TOCK8_PATH, ALT_PATH1 WAV_TOCK8_PATH }; 716 736 const pj_str_t rec_wav_file = pj_str(WAV_LATENCY_OUT_PATH); 717 737 pjsua_player_id play_id = PJSUA_INVALID_ID; … … 755 775 PJ_LOG(3,(THIS_FILE, "Running %s", title)); 756 776 757 status = pjsua_player_create(&ref_wav_file, 0, &play_id); 777 status = create_player(PJ_ARRAY_SIZE(ref_wav_paths), ref_wav_paths, 778 &play_id); 758 779 if (status != PJ_SUCCESS) 759 780 goto on_return; -
pjproject/trunk/pjsip-apps/src/pjsystest/systest.h
r2839 r2991 54 54 #define WAV_TOCK8_PATH "\\Program Files\\pjsystest\\tock8.WAV" 55 55 #define WAV_LATENCY_OUT_PATH "\\PJSYSTEST_LATREC.WAV" 56 #define ALT_PATH1 "" 56 57 #else 57 58 #define LOG_OUT_PATH "PJSYSTEST.LOG" … … 61 62 #define WAV_TOCK8_PATH "tock8.wav" 62 63 #define WAV_LATENCY_OUT_PATH "PJSYSTEST_LATREC.WAV" 64 #define ALT_PATH1 "../../tests/pjsua/wavs/" 63 65 #endif 64 66
Note: See TracChangeset
for help on using the changeset viewer.