summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-08-04 18:27:19 +0000
committerBenny Prijono <bennylp@teluu.com>2006-08-04 18:27:19 +0000
commit3474adb4cba6d8f0e3a2858a59f64683ae8153ad (patch)
treea0524cf2c80fafe1691a2da330bf5352b2b5c087 /pjsip/src/pjsua-lib
parentca972f8eb9678ff162c6e7acc4059b8bec5fb43c (diff)
More work on the AEC (including changes in PJSUA), embed the AEC in sound_port, reduce DirectSound buffer from 32 to 16, and fixed ARM compilation for MSVC WinCE target.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@648 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index ffc228b6..3eeb3078 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -968,32 +968,9 @@ PJ_DEF(pj_status_t) pjsua_set_snd_dev( int capture_dev,
conf_port = pjmedia_conf_get_master_port(pjsua_var.mconf);
pj_assert(conf_port != NULL);
- /* Create AEC if it's not created */
- if (pjsua_var.aec_port == NULL && pjsua_var.media_cfg.ec_tail_len) {
- status = pjmedia_aec_port_create(pjsua_var.pool, conf_port,
- conf_port->info.clock_rate *
- pjsua_var.media_cfg.ec_tail_len /
- 1000,
- &pjsua_var.aec_port);
- if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create AEC port", status);
- pjmedia_snd_port_destroy(pjsua_var.snd_port);
- pjsua_var.snd_port = NULL;
- return status;
- }
- }
-
- /* Connect to the AEC port */
- status = pjmedia_snd_port_connect(pjsua_var.snd_port,
- pjsua_var.media_cfg.ec_tail_len ?
- pjsua_var.aec_port : conf_port );
- if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to connect conference port to "
- "sound device", status);
- pjmedia_snd_port_destroy(pjsua_var.snd_port);
- pjsua_var.snd_port = NULL;
- return status;
- }
+ /* Set AEC */
+ pjmedia_snd_port_set_aec(pjsua_var.snd_port, pjsua_var.pool,
+ pjsua_var.media_cfg.ec_tail_len);
/* Save the device IDs */
pjsua_var.cap_dev = capture_dev;
@@ -1053,6 +1030,30 @@ PJ_DEF(pjmedia_port*) pjsua_set_no_snd_dev(void)
}
+/*
+ * Configure the AEC settings of the sound port.
+ */
+PJ_DEF(pj_status_t) pjsua_set_aec(unsigned tail_ms)
+{
+ pjsua_var.media_cfg.ec_tail_len = tail_ms;
+
+ if (pjsua_var.snd_port)
+ return pjmedia_snd_port_set_aec(pjsua_var.snd_port, pjsua_var.pool,
+ tail_ms);
+
+ return PJ_SUCCESS;
+}
+
+
+/*
+ * Get current AEC tail length.
+ */
+PJ_DEF(pj_status_t) pjsua_get_aec(unsigned *p_tail_ms)
+{
+ *p_tail_ms = pjsua_var.media_cfg.ec_tail_len;
+ return PJ_SUCCESS;
+}
+
/*****************************************************************************
* Codecs.