diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-03-12 18:11:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-03-12 18:11:37 +0000 |
commit | 1dacdee696b7591a6dcc0b3c1d0f41573e473168 (patch) | |
tree | 302b09dcd989c0c05cf09f6aebaa63d870b421b9 /pjsip/include/pjsua-lib | |
parent | ba9d8ca28eb209571c0bd6a080a8bb03d0fa2d33 (diff) |
(Major) Task #737 and #738: integration of APS-Direct and Audiodev from aps-direct branch to trunk.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2506 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsua-lib')
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 118 | ||||
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua_internal.h | 11 |
2 files changed, 120 insertions, 9 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index ca00bb18..99869344 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -4200,6 +4200,20 @@ struct pjsua_media_config */ unsigned ec_tail_len; + /** + * Audio capture buffer length, in milliseconds. + * + * Default: PJMEDIA_SND_DEFAULT_REC_LATENCY + */ + unsigned snd_rec_latency; + + /** + * Audio playback buffer length, in milliseconds. + * + * Default: PJMEDIA_SND_DEFAULT_PLAY_LATENCY + */ + unsigned snd_play_latency; + /** * Jitter buffer initial prefetch delay in msec. The value must be * between jb_min_pre and jb_max_pre below. @@ -4272,9 +4286,10 @@ struct pjsua_media_config /** * Specify idle time of sound device before it is automatically closed, - * in seconds. + * in seconds. Use value -1 to disable the auto-close feature of sound + * device * - * Default : -1 (Disable the auto-close feature of sound device) + * Default : 1 */ int snd_auto_close_time; }; @@ -4787,7 +4802,20 @@ PJ_DECL(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id); */ /** - * Enum all sound devices installed in the system. + * Enum all audio devices installed in the system. + * + * @param info Array of info to be initialized. + * @param count On input, specifies max elements in the array. + * On return, it contains actual number of elements + * that have been initialized. + * + * @return PJ_SUCCESS on success, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsua_enum_aud_devs(pjmedia_aud_dev_info info[], + unsigned *count); + +/** + * Enum all sound devices installed in the system (old API). * * @param info Array of info to be initialized. * @param count On input, specifies max elements in the array. @@ -4807,8 +4835,6 @@ PJ_DECL(pj_status_t) pjsua_recorder_destroy(pjsua_recorder_id id); PJ_DECL(pj_status_t) pjsua_enum_snd_devs(pjmedia_snd_dev_info info[], unsigned *count); - - /** * Get currently active sound devices. If sound devices has not been created * (for example when pjsua_start() is not called), it is possible that @@ -4879,7 +4905,22 @@ PJ_DECL(pjmedia_port*) pjsua_set_no_snd_dev(void); /** - * Configure the echo canceller tail length of the sound port. + * Change the echo cancellation settings. + * + * The behavior of this function depends on whether the sound device is + * currently active, and if it is, whether device or software AEC is + * being used. + * + * If the sound device is currently active, and if the device supports AEC, + * this function will forward the change request to the device and it will + * be up to the device on whether support the request. If software AEC is + * being used (the software EC will be used if the device does not support + * AEC), this function will change the software EC settings. In all cases, + * the setting will be saved for future opening of the sound device. + * + * If the sound device is not currently active, this will only change the + * default AEC settings and the setting will be applied next time the + * sound device is opened. * * @param tail_ms The tail length, in miliseconds. Set to zero to * disable AEC. @@ -4897,7 +4938,7 @@ PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options); /** - * Get current echo canceller tail length. + * Get current echo canceller tail length. * * @param p_tail_ms Pointer to receive the tail length, in miliseconds. * If AEC is disabled, the value will be zero. @@ -4912,6 +4953,69 @@ PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options); PJ_DECL(pj_status_t) pjsua_get_ec_tail(unsigned *p_tail_ms); +/** + * Check whether the sound device is currently active. The sound device + * may be inactive if the application has set the auto close feature to + * non-zero (the snd_auto_close_time setting in #pjsua_media_config), or + * if null sound device or no sound device has been configured via the + * #pjsua_set_no_snd_dev() function. + */ +PJ_DECL(pj_bool_t) pjsua_snd_is_active(void); + + +/** + * Configure sound device setting to the sound device being used. If sound + * device is currently active, the function will forward the setting to the + * sound device instance to be applied immediately, if it supports it. + * + * The setting will be saved for future opening of the sound device, if the + * "keep" argument is set to non-zero. If the sound device is currently + * inactive, and the "keep" argument is false, this function will return + * error. + * + * Note that in case the setting is kept for future use, it will be applied + * to any devices, even when application has changed the sound device to be + * used. + * + * Note also that the echo cancellation setting should be set with + * #pjsua_set_ec() API instead. + * + * See also #pjmedia_aud_stream_set_cap() for more information about setting + * an audio device capability. + * + * @param cap The sound device setting to change. + * @param pval Pointer to value. Please see #pjmedia_aud_dev_cap + * documentation about the type of value to be + * supplied for each setting. + * @param keep Specify whether the setting is to be kept for future + * use. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsua_snd_set_setting(pjmedia_aud_dev_cap cap, + const void *pval, + pj_bool_t keep); + +/** + * Retrieve a sound device setting. If sound device is currently active, + * the function will forward the request to the sound device. If sound device + * is currently inactive, and if application had previously set the setting + * and mark the setting as kept, then that setting will be returned. + * Otherwise, this function will return error. + * + * Note that echo cancellation settings should be retrieved with + * #pjsua_get_ec_tail() API instead. + * + * @param cap The sound device setting to retrieve. + * @param pval Pointer to receive the value. + * Please see #pjmedia_aud_dev_cap documentation about + * the type of value to be supplied for each setting. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsua_snd_get_setting(pjmedia_aud_dev_cap cap, + void *pval); + /***************************************************************************** * Codecs. diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h index a4af71bc..a144c97d 100644 --- a/pjsip/include/pjsua-lib/pjsua_internal.h +++ b/pjsip/include/pjsua-lib/pjsua_internal.h @@ -272,8 +272,15 @@ struct pjsua_data pjmedia_endpt *med_endpt; /**< Media endpoint. */ pjsua_conf_setting mconf_cfg; /**< Additionan conf. bridge. param */ pjmedia_conf *mconf; /**< Conference bridge. */ - int cap_dev; /**< Capture device ID. */ - int play_dev; /**< Playback device ID. */ + pj_bool_t is_mswitch;/**< Are we using audio switchboard + (a.k.a APS-Direct) */ + + /* Sound device */ + pjmedia_aud_dev_index cap_dev; /**< Capture device ID. */ + pjmedia_aud_dev_index play_dev; /**< Playback device ID. */ + pj_uint32_t aud_svmask;/**< Which settings to save */ + pjmedia_aud_param aud_param; /**< User settings to sound dev */ + pj_bool_t aud_open_cnt;/**< How many # device is opened */ pj_bool_t no_snd; /**< No sound (app will manage it) */ pj_pool_t *snd_pool; /**< Sound's private pool. */ pjmedia_snd_port *snd_port; /**< Sound port. */ |