diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 900084e74..2e70f820f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1319,49 +1319,18 @@ bool_t linphone_core_tunnel_available(void){ #endif } -/** - * Enable adaptive rate control. - * - * @ingroup media_parameters - * - * Adaptive rate control consists in using RTCP feedback provided information to dynamically - * control the output bitrate of the audio and video encoders, so that we can adapt to the network conditions and - * available bandwidth. Control of the audio encoder is done in case of audio-only call, and control of the video encoder is done for audio & video calls. - * Adaptive rate control feature is enabled by default. -**/ void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled){ lp_config_set_int(lc->config,"net","adaptive_rate_control",(int)enabled); } -/** - * Returns whether adaptive rate control is enabled. - * - * @ingroup media_parameters - * - * See linphone_core_enable_adaptive_rate_control(). -**/ bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc){ return lp_config_get_int(lc->config,"net","adaptive_rate_control",TRUE); } -/** - * Sets adaptive rate algorithm. It will be used for each new calls starting from - * now. Calls already started will not be updated. - * - * @ingroup media_parameters - * -**/ void linphone_core_set_adaptive_rate_algorithm(LinphoneCore *lc, const char* algorithm){ lp_config_set_string(lc->config,"net","adaptive_rate_algorithm",algorithm); } -/** - * Returns which adaptive rate algorithm is currently configured for future calls. - * - * @ingroup media_parameters - * - * See linphone_core_set_adaptive_rate_algorithm(). -**/ const char * linphone_core_get_adaptive_rate_algorithm(const LinphoneCore *lc){ return lp_config_get_string(lc->config, "net", "adaptive_rate_algorithm", "Simple"); } @@ -1370,36 +1339,12 @@ bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc){ return lp_config_get_int(lc->config,"rtp","rtcp_enabled",TRUE); } -/** - * Sets maximum available download bandwidth - * This is IP bandwidth, in kbit/s. - * This information is used signaled to other parties during - * calls (within SDP messages) so that the remote end can have - * sufficient knowledge to properly configure its audio & video - * codec output bitrate to not overflow available bandwidth. - * - * @ingroup media_parameters - * - * @param lc the LinphoneCore object - * @param bw the bandwidth in kbits/s, 0 for infinite - */ void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw){ lc->net_conf.download_bw=bw; linphone_core_update_allocated_audio_bandwidth(lc); if (linphone_core_ready(lc)) lp_config_set_int(lc->config,"net","download_bw",bw); } -/** - * Sets maximum available upload bandwidth - * This is IP bandwidth, in kbit/s. - * This information is used by liblinphone together with remote - * side available bandwidth signaled in SDP messages to properly - * configure audio & video codec's output bitrate. - * - * @param lc the LinphoneCore object - * @param bw the bandwidth in kbits/s, 0 for infinite - * @ingroup media_parameters - */ void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw){ lc->net_conf.upload_bw=bw; linphone_core_update_allocated_audio_bandwidth(lc); @@ -1426,70 +1371,29 @@ bool_t linphone_core_dns_srv_enabled(const LinphoneCore *lc) { return sal_dns_srv_enabled(lc->sal); } -/** - * Retrieve the maximum available download bandwidth. - * This value was set by linphone_core_set_download_bandwidth(). - * @ingroup media_parameters -**/ int linphone_core_get_download_bandwidth(const LinphoneCore *lc){ return lc->net_conf.download_bw; } -/** - * Retrieve the maximum available upload bandwidth. - * This value was set by linphone_core_set_upload_bandwidth(). - * @ingroup media_parameters -**/ int linphone_core_get_upload_bandwidth(const LinphoneCore *lc){ return lc->net_conf.upload_bw; } -/** - * Set audio packetization time linphone expects to receive from peer. - * A value of zero means that ptime is not specified. - * @ingroup media_parameters - */ void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime) { lp_config_set_int(lc->config,"rtp","download_ptime",ptime); } -/** - * Get audio packetization time linphone expects to receive from peer. - * A value of zero means that ptime is not specified. - * @ingroup media_parameters - */ int linphone_core_get_download_ptime(LinphoneCore *lc) { return lp_config_get_int(lc->config,"rtp","download_ptime",0); } -/** - * Set audio packetization time linphone will send (in absence of requirement from peer) - * A value of 0 stands for the current codec default packetization time. - * - * @ingroup media_parameters -**/ void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime){ lp_config_set_int(lc->config,"rtp","upload_ptime",ptime); } -/** - * Set audio packetization time linphone will send (in absence of requirement from peer) - * A value of 0 stands for the current codec default packetization time. - * - * - * @ingroup media_parameters -**/ int linphone_core_get_upload_ptime(LinphoneCore *lc){ return lp_config_get_int(lc->config,"rtp","upload_ptime",0); } - - -/** - * Returns liblinphone's version as a string. - * - * @ingroup misc - * -**/ const char * linphone_core_get_version(void){ return liblinphone_version; } @@ -1723,25 +1627,6 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab } // else linphone_core_start will be called after the remote provisioning (see linphone_core_iterate) } -/** - * Instanciates a LinphoneCore object. - * @ingroup initializing - * - * The LinphoneCore object is the primary handle for doing all phone actions. - * It should be unique within your application. - * @param vtable a LinphoneCoreVTable structure holding your application callbacks - * @param config_path a path to a config file. If it does not exists it will be created. - * The config file is used to store all settings, call logs, friends, proxies... so that all these settings - * become persistent over the life of the LinphoneCore object. - * It is allowed to set a NULL config file. In that case LinphoneCore will not store any settings. - * @param factory_config_path a path to a read-only config file that can be used to - * to store hard-coded preference such as proxy settings or internal preferences. - * The settings in this factory file always override the one in the normal config file. - * It is OPTIONAL, use NULL if unneeded. - * @param userdata an opaque user pointer that can be retrieved at any time (for example in - * callbacks) using linphone_core_get_user_data(). - * @see linphone_core_new_with_config -**/ LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable, const char *config_path, const char *factory_config_path, void * userdata) { @@ -1759,45 +1644,16 @@ LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, st return core; } -/** - * Returns the list of available audio codecs. - * @param[in] lc The LinphoneCore object - * @return \mslist{PayloadType} - * - * This list is unmodifiable. The ->data field of the MSList points a PayloadType - * structure holding the codec information. - * It is possible to make copy of the list with ms_list_copy() in order to modify it - * (such as the order of codecs). - * @ingroup media_parameters -**/ const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc) { return lc->codecs_conf.audio_codecs; } -/** - * Returns the list of available video codecs. - * @param[in] lc The LinphoneCore object - * @return \mslist{PayloadType} - * - * This list is unmodifiable. The ->data field of the MSList points a PayloadType - * structure holding the codec information. - * It is possible to make copy of the list with ms_list_copy() in order to modify it - * (such as the order of codecs). - * @ingroup media_parameters -**/ const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc) { return lc->codecs_conf.video_codecs; } -/** - * Sets the local "from" identity. - * - * @ingroup proxies - * This data is used in absence of any proxy configuration or when no - * default proxy configuration is set. See LinphoneProxyConfig -**/ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact) { LinphoneAddress *ctt; @@ -1852,11 +1708,6 @@ static void update_primary_contact(LinphoneCore *lc){ linphone_address_destroy(url); } -/** - * Returns the default identity when no proxy configuration is used. - * - * @ingroup proxies -**/ const char *linphone_core_get_primary_contact(LinphoneCore *lc){ char *identity; @@ -1871,28 +1722,14 @@ const char *linphone_core_get_primary_contact(LinphoneCore *lc){ return identity; } -/** - * Tells LinphoneCore to guess local hostname automatically in primary contact. - * - * @ingroup proxies -**/ void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val){ lc->sip_conf.guess_hostname=val; } -/** - * Returns TRUE if hostname part of primary contact is guessed automatically. - * - * @ingroup proxies -**/ bool_t linphone_core_get_guess_hostname(LinphoneCore *lc){ return lc->sip_conf.guess_hostname; } -/** - * Tells to LinphoneCore to use Linphone Instant Messaging encryption - * - */ void linphone_core_enable_lime(LinphoneCore *lc, bool_t val){ if (linphone_core_ready(lc)){ lp_config_set_int(lc->config,"sip","lime",val); @@ -1907,12 +1744,6 @@ bool_t linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc){ return linphone_core_lime_enabled(lc) && (lp_config_get_int(lc->config,"sip", "lime_for_file_sharing", TRUE) && lime_is_available()); } -/** - * Same as linphone_core_get_primary_contact() but the result is a LinphoneAddress object - * instead of const char* - * - * @ingroup proxies -**/ LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){ return linphone_address_new(linphone_core_get_primary_contact(lc)); } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 1423e1713..f57b6aad6 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -2418,6 +2418,12 @@ LINPHONE_PUBLIC void linphone_core_disable_logs(void); */ LINPHONE_PUBLIC void linphone_core_serialize_logs(void); +/** + * Returns liblinphone's version as a string. + * + * @ingroup misc + * +**/ LINPHONE_PUBLIC const char *linphone_core_get_version(void); LINPHONE_PUBLIC const char *linphone_core_get_user_agent(LinphoneCore *lc); /** @@ -2429,6 +2435,25 @@ LINPHONE_PUBLIC const char *linphone_core_get_user_agent_name(void); **/ LINPHONE_PUBLIC const char *linphone_core_get_user_agent_version(void); +/** + * Instanciates a LinphoneCore object. + * @ingroup initializing + * + * The LinphoneCore object is the primary handle for doing all phone actions. + * It should be unique within your application. + * @param vtable a LinphoneCoreVTable structure holding your application callbacks + * @param config_path a path to a config file. If it does not exists it will be created. + * The config file is used to store all settings, call logs, friends, proxies... so that all these settings + * become persistent over the life of the LinphoneCore object. + * It is allowed to set a NULL config file. In that case LinphoneCore will not store any settings. + * @param factory_config_path a path to a read-only config file that can be used to + * to store hard-coded preference such as proxy settings or internal preferences. + * The settings in this factory file always override the one in the normal config file. + * It is OPTIONAL, use NULL if unneeded. + * @param userdata an opaque user pointer that can be retrieved at any time (for example in + * callbacks) using linphone_core_get_user_data(). + * @see linphone_core_new_with_config +**/ LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable, const char *config_path, const char *factory_config, void* userdata); @@ -2575,41 +2600,161 @@ LINPHONE_PUBLIC LinphoneCall *linphone_core_get_call_by_remote_address2(Linphone **/ LINPHONE_PUBLIC void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf); +/** + * Sets the local "from" identity. + * + * @ingroup proxies + * This data is used in absence of any proxy configuration or when no + * default proxy configuration is set. See LinphoneProxyConfig +**/ LINPHONE_PUBLIC int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact); +/** + * Returns the default identity when no proxy configuration is used. + * + * @ingroup proxies +**/ LINPHONE_PUBLIC const char *linphone_core_get_primary_contact(LinphoneCore *lc); LINPHONE_PUBLIC const char * linphone_core_get_identity(LinphoneCore *lc); +/** + * Tells LinphoneCore to guess local hostname automatically in primary contact. + * + * @ingroup proxies +**/ LINPHONE_PUBLIC void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val); +/** + * Returns TRUE if hostname part of primary contact is guessed automatically. + * + * @ingroup proxies +**/ LINPHONE_PUBLIC bool_t linphone_core_get_guess_hostname(LinphoneCore *lc); +/** + * Tells to LinphoneCore to use Linphone Instant Messaging encryption + * + */ LINPHONE_PUBLIC void linphone_core_enable_lime(LinphoneCore *lc, bool_t val); LINPHONE_PUBLIC bool_t linphone_core_lime_enabled(const LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_ipv6_enabled(LinphoneCore *lc); LINPHONE_PUBLIC void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val); +/** + * Same as linphone_core_get_primary_contact() but the result is a LinphoneAddress object + * instead of const char* + * + * @ingroup proxies +**/ LINPHONE_PUBLIC LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc); LINPHONE_PUBLIC const char * linphone_core_get_identity(LinphoneCore *lc); -/*0= no bandwidth limit*/ +/** + * Sets maximum available download bandwidth + * This is IP bandwidth, in kbit/s. + * This information is used signaled to other parties during + * calls (within SDP messages) so that the remote end can have + * sufficient knowledge to properly configure its audio & video + * codec output bitrate to not overflow available bandwidth. + * + * @ingroup media_parameters + * + * @param lc the LinphoneCore object + * @param bw the bandwidth in kbits/s, 0 for infinite + */ LINPHONE_PUBLIC void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw); +/** + * Sets maximum available upload bandwidth + * This is IP bandwidth, in kbit/s. + * This information is used by liblinphone together with remote + * side available bandwidth signaled in SDP messages to properly + * configure audio & video codec's output bitrate. + * + * @param lc the LinphoneCore object + * @param bw the bandwidth in kbits/s, 0 for infinite + * @ingroup media_parameters + */ LINPHONE_PUBLIC void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw); +/** + * Retrieve the maximum available download bandwidth. + * This value was set by linphone_core_set_download_bandwidth(). + * @ingroup media_parameters +**/ LINPHONE_PUBLIC int linphone_core_get_download_bandwidth(const LinphoneCore *lc); +/** + * Retrieve the maximum available upload bandwidth. + * This value was set by linphone_core_set_upload_bandwidth(). + * @ingroup media_parameters +**/ LINPHONE_PUBLIC int linphone_core_get_upload_bandwidth(const LinphoneCore *lc); +/** + * Enable adaptive rate control. + * + * @ingroup media_parameters + * + * Adaptive rate control consists in using RTCP feedback provided information to dynamically + * control the output bitrate of the audio and video encoders, so that we can adapt to the network conditions and + * available bandwidth. Control of the audio encoder is done in case of audio-only call, and control of the video encoder is done for audio & video calls. + * Adaptive rate control feature is enabled by default. +**/ LINPHONE_PUBLIC void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled); + +/** + * Returns whether adaptive rate control is enabled. + * + * @ingroup media_parameters + * + * See linphone_core_enable_adaptive_rate_control(). +**/ LINPHONE_PUBLIC bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc); +/** + * Sets adaptive rate algorithm. It will be used for each new calls starting from + * now. Calls already started will not be updated. + * + * @ingroup media_parameters + * +**/ LINPHONE_PUBLIC void linphone_core_set_adaptive_rate_algorithm(LinphoneCore *lc, const char *algorithm); +/** + * Returns which adaptive rate algorithm is currently configured for future calls. + * + * @ingroup media_parameters + * + * See linphone_core_set_adaptive_rate_algorithm(). +**/ LINPHONE_PUBLIC const char* linphone_core_get_adaptive_rate_algorithm(const LinphoneCore *lc); +/** + * Set audio packetization time linphone expects to receive from peer. + * A value of zero means that ptime is not specified. + * @ingroup media_parameters + */ LINPHONE_PUBLIC void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime); +/** + * Get audio packetization time linphone expects to receive from peer. + * A value of zero means that ptime is not specified. + * @ingroup media_parameters + */ LINPHONE_PUBLIC int linphone_core_get_download_ptime(LinphoneCore *lc); +/** + * Set audio packetization time linphone will send (in absence of requirement from peer) + * A value of 0 stands for the current codec default packetization time. + * + * @ingroup media_parameters +**/ LINPHONE_PUBLIC void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime); +/** + * Set audio packetization time linphone will send (in absence of requirement from peer) + * A value of 0 stands for the current codec default packetization time. + * + * + * @ingroup media_parameters +**/ LINPHONE_PUBLIC int linphone_core_get_upload_ptime(LinphoneCore *lc); /** @@ -2644,11 +2789,32 @@ LINPHONE_PUBLIC void linphone_core_enable_dns_srv(LinphoneCore *lc, bool_t enabl */ LINPHONE_PUBLIC bool_t linphone_core_dns_srv_enabled(const LinphoneCore *lc); -/* returns a MSList of PayloadType */ +/** + * Returns the list of available audio codecs. + * @param[in] lc The LinphoneCore object + * @return \mslist{PayloadType} + * + * This list is unmodifiable. The ->data field of the MSList points a PayloadType + * structure holding the codec information. + * It is possible to make copy of the list with ms_list_copy() in order to modify it + * (such as the order of codecs). + * @ingroup media_parameters +**/ LINPHONE_PUBLIC const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc); LINPHONE_PUBLIC int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs); -/* returns a MSList of PayloadType */ + +/** + * Returns the list of available video codecs. + * @param[in] lc The LinphoneCore object + * @return \mslist{PayloadType} + * + * This list is unmodifiable. The ->data field of the MSList points a PayloadType + * structure holding the codec information. + * It is possible to make copy of the list with ms_list_copy() in order to modify it + * (such as the order of codecs). + * @ingroup media_parameters +**/ LINPHONE_PUBLIC const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc); LINPHONE_PUBLIC int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs);