Changeset 653 for pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
- Timestamp:
- Aug 6, 2006 12:07:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r650 r653 18 18 */ 19 19 #include <pjmedia/sound_port.h> 20 #include <pjmedia/ aec.h>20 #include <pjmedia/echo.h> 21 21 #include <pjmedia/errno.h> 22 22 #include <pjmedia/plc.h> … … 57 57 unsigned options; 58 58 59 pjmedia_ aec *aec;59 pjmedia_echo_state *ec_state; 60 60 unsigned aec_tail_len; 61 61 pjmedia_plc *plc; … … 116 116 pjmedia_plc_save(snd_port->plc, output); 117 117 118 if (snd_port-> aec) {119 pjmedia_ aec_playback(snd_port->aec, output);118 if (snd_port->ec_state) { 119 pjmedia_echo_playback(snd_port->ec_state, output); 120 120 } 121 121 … … 165 165 166 166 /* Cancel echo */ 167 if (snd_port-> aec) {168 pjmedia_ aec_capture(snd_port->aec, input, 0);167 if (snd_port->ec_state) { 168 pjmedia_echo_capture(snd_port->ec_state, input, 0); 169 169 } 170 170 … … 252 252 /* Create AEC only when direction is full duplex */ 253 253 if (snd_port->dir == PJMEDIA_DIR_CAPTURE_PLAYBACK) { 254 status = pjmedia_snd_port_set_ aec(snd_port, pool, AEC_TAIL);254 status = pjmedia_snd_port_set_ec_tail(snd_port, pool, AEC_TAIL); 255 255 if (status != PJ_SUCCESS) { 256 256 PJ_LOG(4,(THIS_FILE, "Unable to create AEC")); 257 snd_port-> aec= NULL;257 snd_port->ec_state = NULL; 258 258 } 259 259 } … … 285 285 286 286 /* Destroy AEC */ 287 if (snd_port-> aec) {288 pjmedia_ aec_destroy(snd_port->aec);289 snd_port-> aec= NULL;287 if (snd_port->ec_state) { 288 pjmedia_echo_destroy(snd_port->ec_state); 289 snd_port->ec_state = NULL; 290 290 } 291 291 … … 433 433 * Enable AEC 434 434 */ 435 PJ_DEF(pj_status_t) pjmedia_snd_port_set_ aec(pjmedia_snd_port *snd_port,436 pj_pool_t *pool,437 unsigned tail_ms)435 PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec_tail(pjmedia_snd_port *snd_port, 436 pj_pool_t *pool, 437 unsigned tail_ms) 438 438 { 439 439 pj_status_t status; … … 445 445 446 446 /* Destroy AEC */ 447 if (snd_port-> aec) {448 pjmedia_ aec_destroy(snd_port->aec);449 snd_port-> aec= NULL;447 if (snd_port->ec_state) { 448 pjmedia_echo_destroy(snd_port->ec_state); 449 snd_port->ec_state = NULL; 450 450 } 451 451 … … 453 453 454 454 if (tail_ms != 0) { 455 status = pjmedia_ aec_create(pool, snd_port->clock_rate,455 status = pjmedia_echo_create(pool, snd_port->clock_rate, 456 456 snd_port->samples_per_frame, 457 tail_ms, 0, &snd_port-> aec);457 tail_ms, 0, &snd_port->ec_state); 458 458 if (status != PJ_SUCCESS) 459 snd_port-> aec= NULL;459 snd_port->ec_state = NULL; 460 460 } else { 461 PJ_LOG(4,(THIS_FILE, "AEC disabled in the sound port")); 461 PJ_LOG(4,(THIS_FILE, "Echo canceller is now disabled in the " 462 "sound port")); 462 463 status = PJ_SUCCESS; 463 464 } … … 468 469 469 470 /* Get AEC tail length */ 470 PJ_DEF(pj_status_t) pjmedia_snd_port_get_ aec_tail( pjmedia_snd_port *snd_port,471 471 PJ_DEF(pj_status_t) pjmedia_snd_port_get_ec_tail( pjmedia_snd_port *snd_port, 472 unsigned *p_length) 472 473 { 473 474 PJ_ASSERT_RETURN(snd_port && p_length, PJ_EINVAL); 474 *p_length = snd_port-> aec? snd_port->aec_tail_len : 0;475 *p_length = snd_port->ec_state ? snd_port->aec_tail_len : 0; 475 476 return PJ_SUCCESS; 476 477 }
Note: See TracChangeset
for help on using the changeset viewer.