Changeset 1664 for pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
- Timestamp:
- Jan 4, 2008 6:19:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r1296 r1664 18 18 */ 19 19 #include <pjmedia/sound_port.h> 20 #include <pjmedia/delaybuf.h> 20 21 #include <pjmedia/echo.h> 21 22 #include <pjmedia/errno.h> … … 63 64 unsigned samples_per_frame; 64 65 unsigned bits_per_sample; 66 67 #if PJMEDIA_SOUND_USE_DELAYBUF 68 pjmedia_delay_buf *delay_buf; 69 #endif 65 70 }; 66 71 … … 93 98 frame.timestamp.u32.hi = 0; 94 99 frame.timestamp.u32.lo = timestamp; 100 101 #if PJMEDIA_SOUND_USE_DELAYBUF 102 status = pjmedia_delay_buf_get(snd_port->delay_buf, (pj_int16_t*)output); 103 if (status != PJ_SUCCESS) { 104 pj_bzero(output, size); 105 } 106 107 pjmedia_port_put_frame(port, &frame); 108 #endif 95 109 96 110 status = pjmedia_port_get_frame(port, &frame); … … 186 200 } 187 201 202 #if PJMEDIA_SOUND_USE_DELAYBUF 203 PJ_UNUSED_ARG(size); 204 PJ_UNUSED_ARG(timestamp); 205 PJ_UNUSED_ARG(frame); 206 pjmedia_delay_buf_put(snd_port->delay_buf, (pj_int16_t*)input); 207 #else 188 208 frame.buf = (void*)input; 189 209 frame.size = size; … … 192 212 193 213 pjmedia_port_put_frame(port, &frame); 214 #endif 194 215 195 216 return PJ_SUCCESS; … … 325 346 { 326 347 pjmedia_snd_port *snd_port; 348 pj_status_t status; 327 349 328 350 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); … … 339 361 snd_port->samples_per_frame = samples_per_frame; 340 362 snd_port->bits_per_sample = bits_per_sample; 363 364 #if PJMEDIA_SOUND_USE_DELAYBUF 365 status = pjmedia_delay_buf_create(pool, "snd_buff", samples_per_frame, 366 16, &snd_port->delay_buf); 367 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 368 #else 369 PJ_UNUSED_ARG(status); 370 #endif 341 371 342 372 *p_port = snd_port;
Note: See TracChangeset
for help on using the changeset viewer.