Changeset 660
- Timestamp:
- Aug 7, 2006 1:22:23 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/main.c
r503 r660 29 29 pj_status_t app_destroy(void); 30 30 31 32 #if defined(PJ_WIN32) && PJ_WIN32!=0 33 #include <windows.h> 34 35 static pj_thread_desc handler_desc; 36 37 static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) 38 { 39 pj_thread_t *thread; 40 41 switch (fdwCtrlType) 42 { 43 // Handle the CTRL+C signal. 44 45 case CTRL_C_EVENT: 46 case CTRL_CLOSE_EVENT: 47 case CTRL_BREAK_EVENT: 48 case CTRL_LOGOFF_EVENT: 49 case CTRL_SHUTDOWN_EVENT: 50 pj_thread_register("ctrlhandler", handler_desc, &thread); 51 PJ_LOG(3,(THIS_FILE, "Ctrl-C detected, quitting..")); 52 app_destroy(); 53 ExitProcess(1); 54 return TRUE; 55 56 default: 57 58 return FALSE; 59 } 60 } 61 62 static void setup_signal_handler(void) 63 { 64 SetConsoleCtrlHandler(&CtrlHandler, TRUE); 65 } 66 67 #else 68 69 static void setup_signal_handler(void) 70 { 71 } 72 73 #endif 74 31 75 int main(int argc, char *argv[]) 32 76 { 33 77 if (app_init(argc, argv) != PJ_SUCCESS) 34 78 return 1; 79 80 setup_signal_handler(); 35 81 36 82 app_main(); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r651 r660 1278 1278 const char *dir; 1279 1279 char last_update[64]; 1280 char packets[32], bytes[32], ipbytes[32] ;1281 pj_time_val now;1280 char packets[32], bytes[32], ipbytes[32], avg_bps[32]; 1281 pj_time_val media_duration, now; 1282 1282 1283 1283 pjmedia_session_get_stream_stat(session, i, &stat); … … 1324 1324 } 1325 1325 1326 pj_gettimeofday(&media_duration); 1327 PJ_TIME_VAL_SUB(media_duration, stat.start); 1328 if (PJ_TIME_VAL_MSEC(media_duration) == 0) 1329 media_duration.msec = 1; 1330 1326 1331 len = pj_ansi_snprintf(p, end-p, 1327 1332 "%s RX pt=%d, stat last update: %s\n" 1328 "%s total %spkt %sB (%sB +IP hdr) \n"1333 "%s total %spkt %sB (%sB +IP hdr) @avg=%sbps\n" 1329 1334 "%s pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)\n" 1330 1335 "%s (msec) min avg max last\n" … … 1337 1342 good_number(bytes, stat.rx.bytes), 1338 1343 good_number(ipbytes, stat.rx.bytes + stat.rx.pkt * 32), 1344 good_number(avg_bps, stat.rx.bytes * 8 * 1000 / PJ_TIME_VAL_MSEC(media_duration)), 1339 1345 indent, 1340 1346 stat.rx.loss, … … 1380 1386 len = pj_ansi_snprintf(p, end-p, 1381 1387 "%s TX pt=%d, ptime=%dms, stat last update: %s\n" 1382 "%s total %spkt %sB (%sB +IP hdr) \n"1388 "%s total %spkt %sB (%sB +IP hdr) @avg %sbps\n" 1383 1389 "%s pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)\n" 1384 1390 "%s (msec) min avg max last\n" … … 1395 1401 good_number(bytes, stat.tx.bytes), 1396 1402 good_number(ipbytes, stat.tx.bytes + stat.tx.pkt * 32), 1403 good_number(avg_bps, stat.tx.bytes * 8 * 1000 / PJ_TIME_VAL_MSEC(media_duration)), 1397 1404 1398 1405 indent,
Note: See TracChangeset
for help on using the changeset viewer.