Changeset 2854 for pjproject/trunk/pjsip-apps/src/samples/jbsim.c
- Timestamp:
- Aug 5, 2009 5:10:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/jbsim.c
r2846 r2854 40 40 /* Defaults settings */ 41 41 #define CODEC "PCMU" 42 #define LOG_FILE "jbsim. out"42 #define LOG_FILE "jbsim.csv" 43 43 #define WAV_REF "../../tests/pjsua/wavs/input.8.wav" 44 44 #define WAV_OUT "jbsim.wav" 45 #define DURATION 2045 #define DURATION 60 46 46 #define DTX PJ_TRUE 47 47 #define PLC PJ_TRUE … … 50 50 #define LOSS_CORR 0 51 51 #define LOSS_EXTRA 2 52 #define SILENT 1 52 53 53 54 /* … … 122 123 { 123 124 /* General options */ 125 pj_bool_t silent; /* Write little to stdout */ 124 126 const char *log_file; /* The output log file */ 125 127 … … 188 190 * Logging 189 191 */ 190 static void write_log(struct log_entry *entry )192 static void write_log(struct log_entry *entry, pj_bool_t to_stdout) 191 193 { 192 194 /* Format (CSV): */ … … 209 211 pj_file_write(g_app.log_fd, log, &size); 210 212 } 213 if (to_stdout && !g_app.cfg.silent) 214 printf("%s", log); 211 215 header_written = PJ_TRUE; 212 216 } … … 260 264 pj_file_write(g_app.log_fd, log, &size); 261 265 } 266 267 if (to_stdout && !g_app.cfg.silent) 268 printf("%s", log); 262 269 } 263 270 … … 275 282 entry.log = data; 276 283 entry.wall_clock = g_app.wall_clock; 277 write_log(&entry );284 write_log(&entry, PJ_FALSE); 278 285 } 279 286 … … 480 487 #endif 481 488 #if defined(PJMEDIA_HAS_ILBC_CODEC) && PJMEDIA_HAS_ILBC_CODEC != 0 482 pjmedia_codec_ilbc_init(g_app.endpt, 30); 489 /* Init ILBC with mode=20 to make the losts occur at the same 490 * places as other codecs. 491 */ 492 pjmedia_codec_ilbc_init(g_app.endpt, 20); 483 493 #endif 484 494 #if defined(PJMEDIA_HAS_INTEL_IPP) && PJMEDIA_HAS_INTEL_IPP != 0 … … 585 595 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 586 596 frame.buf = g_app.framebuf; 587 frame.size = src->info.samples_per_frame * 2;597 frame.size = dst->info.samples_per_frame * 2; 588 598 589 599 status = pjmedia_port_get_frame(src, &frame); … … 705 715 } 706 716 707 write_log(&entry );717 write_log(&entry, PJ_TRUE); 708 718 709 719 ++strm->state.tx.total_tx; … … 793 803 entry.jb_state = &jstate; 794 804 795 write_log(&entry );805 write_log(&entry, PJ_TRUE); 796 806 797 807 /* GET */ … … 816 826 strcat(msg, "** NULL frame was returned **"); 817 827 818 write_log(&entry );828 write_log(&entry, PJ_TRUE); 819 829 820 830 } … … 961 971 g_app.cfg.codec = pj_str(CODEC); 962 972 g_app.cfg.duration_msec = DURATION * 1000; 973 g_app.cfg.silent = SILENT; 963 974 g_app.cfg.log_file = LOG_FILE; 964 975 g_app.cfg.tx_wav_in = WAV_REF;
Note: See TracChangeset
for help on using the changeset viewer.