Changeset 1337 for pjproject/trunk
- Timestamp:
- Jun 3, 2007 12:37:30 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r974 r1337 75 75 #include <stdlib.h> 76 76 77 /* Uncomment these to disable threads. 78 * NOTE: 79 * when threading is disabled, siprtp won't transmit any 80 * RTP packets. 81 */ 82 /* 83 #undef PJ_HAS_THREADS 84 #define PJ_HAS_THREADS 0 85 */ 86 77 87 78 88 #if PJ_HAS_HIGH_RES_TIMER==0 … … 402 412 * initialized. 403 413 */ 414 #if PJ_HAS_THREADS 404 415 status = pjmedia_endpt_create(&app.cp.factory, NULL, 1, &app.med_endpt); 416 #else 417 status = pjmedia_endpt_create(&app.cp.factory, 418 pjsip_endpt_get_ioqueue(app.sip_endpt), 419 0, &app.med_endpt); 420 #endif 405 421 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 406 422 … … 1436 1452 /* Start media thread. */ 1437 1453 audio->thread_quit_flag = 0; 1454 #if PJ_HAS_THREADS 1438 1455 status = pj_thread_create( inv->pool, "media", &media_thread, audio, 1439 1456 0, 0, &audio->thread); … … 1442 1459 return; 1443 1460 } 1461 #endif 1444 1462 1445 1463 /* Set the media as active */ … … 2071 2089 2072 2090 /* Start worker threads */ 2091 #if PJ_HAS_THREADS 2073 2092 for (i=0; i<app.thread_count; ++i) { 2074 2093 pj_thread_create( app.pool, "app", &sip_worker_thread, NULL, 2075 2094 0, 0, &app.sip_thread[i]); 2076 2095 } 2096 #endif 2077 2097 2078 2098 /* If URL is specified, then make call immediately */ … … 2097 2117 pj_thread_sleep(200); 2098 2118 } else { 2119 #if PJ_HAS_THREADS 2099 2120 /* Start user interface loop */ 2100 2121 console_main(); 2122 #endif 2101 2123 } 2102 2124 … … 2106 2128 app.max_calls)); 2107 2129 2130 #if PJ_HAS_THREADS 2108 2131 /* Start user interface loop */ 2109 2132 console_main(); 2110 2111 } 2112 2133 #endif 2134 } 2135 2136 #if !PJ_HAS_THREADS 2137 PJ_LOG(3,(THIS_FILE, "Press Ctrl-C to quit")); 2138 for (;;) { 2139 pj_time_val t = {0, 10}; 2140 pjsip_endpt_handle_events(app.sip_endpt, &t); 2141 } 2142 #endif 2113 2143 2114 2144 /* Shutting down... */
Note: See TracChangeset
for help on using the changeset viewer.