Changeset 1641 for pjproject/trunk/pjsip-apps/src/symsndtest/app_main.cpp
- Timestamp:
- Dec 28, 2007 6:55:02 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/symsndtest/app_main.cpp
r1428 r1641 29 29 #define CHANNEL_COUNT 1 30 30 #define PTIME 100 31 #define SAMPLES_PER_FRAME ( 2048)31 #define SAMPLES_PER_FRAME (80) 32 32 #define BITS_PER_SAMPLE 16 33 33 #define LOOPBACK_BUFF_COUNT 100 34 34 35 35 extern CConsoleBase* console; … … 40 40 static pj_time_val t_start; 41 41 42 43 static pj_int16_t buff_loopback[SAMPLES_PER_FRAME*LOOPBACK_BUFF_COUNT]; 44 static pj_uint32_t pointer_w, pointer_r; 42 45 43 46 /* Logging callback */ … … 71 74 pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer); 72 75 pj_log_set_decor(PJ_LOG_HAS_NEWLINE); 76 pj_log_set_level(5); 73 77 74 78 /* Init pjlib */ … … 115 119 PJ_UNUSED_ARG(input); 116 120 PJ_UNUSED_ARG(size); 121 122 pj_memcpy(&buff_loopback[pointer_w*SAMPLES_PER_FRAME], input, size); 123 124 if (size != SAMPLES_PER_FRAME*2) { 125 PJ_LOG(3, (THIS_FILE, "Size captured = %u", 126 size)); 127 pj_bzero(&buff_loopback[pointer_w*SAMPLES_PER_FRAME]+size/2, SAMPLES_PER_FRAME*2 - size); 128 } 129 130 if (++pointer_w >= LOOPBACK_BUFF_COUNT) { 131 pointer_w = 0; 132 } 117 133 118 134 ++rec_cnt; … … 129 145 PJ_UNUSED_ARG(timestamp); 130 146 131 pj_bzero(output, size); 147 //pj_bzero(output, size); 148 pj_memcpy(output, &buff_loopback[pointer_r*SAMPLES_PER_FRAME], SAMPLES_PER_FRAME*2); 149 150 if (++pointer_r >= LOOPBACK_BUFF_COUNT) { 151 pointer_r = 0; 152 } 132 153 133 154 ++play_cnt; … … 174 195 } 175 196 197 pointer_w = LOOPBACK_BUFF_COUNT/2; 198 pointer_r = 0; 199 176 200 return PJ_SUCCESS; 177 201 } … … 298 322 case 'p': 299 323 snd_start(PJMEDIA_DIR_PLAYBACK); 300 324 break; 301 325 case 'c': 302 326 snd_stop();
Note: See TracChangeset
for help on using the changeset viewer.