From f5555cc7ff8f7673899c129a2502436c1dbff6f6 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 21 Jun 2012 12:13:10 +0200 Subject: [PATCH] enhance documentation --- coreapi/linphonecall.c | 27 +++++++++------ coreapi/linphonecore.c | 21 ++++++++++-- coreapi/linphonecore.h | 76 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 98 insertions(+), 26 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index ac8460291..ec006dd58 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -68,14 +68,6 @@ LinphoneCore *linphone_call_get_core(const LinphoneCall *call){ return call->core; } -const LinphoneCallStats *linphone_call_get_audio_stats(const LinphoneCall *call) { - return &call->stats[LINPHONE_CALL_STATS_AUDIO]; -} - -const LinphoneCallStats *linphone_call_get_video_stats(const LinphoneCall *call) { - return &call->stats[LINPHONE_CALL_STATS_VIDEO]; -} - const char* linphone_call_get_authentication_token(LinphoneCall *call){ return call->auth_token; } @@ -1518,7 +1510,7 @@ bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call){ **/ /** - * Returns the measured sound volume played locally (received from remote) + * Returns the measured sound volume played locally (received from remote). * It is expressed in dbm0. **/ float linphone_call_get_play_volume(LinphoneCall *call){ @@ -1533,7 +1525,7 @@ float linphone_call_get_play_volume(LinphoneCall *call){ } /** - * Returns the measured sound volume recorded locally (sent to remote) + * Returns the measured sound volume recorded locally (sent to remote). * It is expressed in dbm0. **/ float linphone_call_get_record_volume(LinphoneCall *call){ @@ -1583,6 +1575,21 @@ float linphone_call_get_average_quality(LinphoneCall *call){ return -1; } +/** + * Access last known statistics for audio stream, for a given call. +**/ +const LinphoneCallStats *linphone_call_get_audio_stats(const LinphoneCall *call) { + return &call->stats[LINPHONE_CALL_STATS_AUDIO]; +} + +/** + * Access last known statistics for video stream, for a given call. +**/ +const LinphoneCallStats *linphone_call_get_video_stats(const LinphoneCall *call) { + return &call->stats[LINPHONE_CALL_STATS_VIDEO]; +} + + /** * @} **/ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 41b9e2dda..d48c2fa28 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3473,7 +3473,6 @@ LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc) * @ingroup call_logs **/ const MSList * linphone_core_get_call_logs(LinphoneCore *lc){ - lc->missed_calls=0; return lc->call_logs; } @@ -3489,17 +3488,31 @@ void linphone_core_clear_call_logs(LinphoneCore *lc){ call_logs_write_to_config_file(lc); } +/** + * Returns number of missed calls. + * Once checked, this counter can be reset with linphone_core_reset_missed_calls_count(). +**/ int linphone_core_get_missed_calls_count(LinphoneCore *lc) { return lc->missed_calls; } +/** + * Resets the counter of missed calls. +**/ void linphone_core_reset_missed_calls_count(LinphoneCore *lc) { lc->missed_calls=0; } -void linphone_core_remove_call_log(LinphoneCore *lc, void *data) { - lc->call_logs = ms_list_remove(lc->call_logs, data); +/** + * Remove a specific call log from call history list. + * This function destroys the call log object. It must not be accessed anymore by the application after calling this function. + * @param lc the linphone core object + * @param a LinphoneCallLog object. +**/ +void linphone_core_remove_call_log(LinphoneCore *lc, LinphoneCallLog *cl){ + lc->call_logs = ms_list_remove(lc->call_logs, cl); call_logs_write_to_config_file(lc); + linphone_call_log_destroy(cl); } static void toggle_video_preview(LinphoneCore *lc, bool_t val){ @@ -3572,6 +3585,7 @@ bool_t linphone_core_video_enabled(LinphoneCore *lc){ * This policy defines whether: * - video shall be initiated by default for outgoing calls * - video shall be accepter by default for incoming calls + * @ingroup media_parameters **/ void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy *policy){ lc->video_policy=*policy; @@ -3584,6 +3598,7 @@ void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy /** * Get the default policy for video. * See linphone_core_set_video_policy() for more details. + * @ingroup media_parameters **/ const LinphoneVideoPolicy *linphone_core_get_video_policy(LinphoneCore *lc){ return &lc->video_policy; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index c9c6fc1a1..79d6204a0 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -157,12 +157,19 @@ typedef struct _LinphoneCallLog{ struct _LinphoneCore *lc; } LinphoneCallLog; + +/** + * Enum describing type of media encryption types. +**/ enum LinphoneMediaEncryption { LinphoneMediaEncryptionNone, LinphoneMediaEncryptionSRTP, LinphoneMediaEncryptionZRTP }; +/** + * Enum describing type of media encryption types. +**/ typedef enum LinphoneMediaEncryption LinphoneMediaEncryption; /*public: */ @@ -174,13 +181,13 @@ const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl); const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl); char * linphone_call_log_to_str(LinphoneCallLog *cl); +struct _LinphoneCallParams; /** * The LinphoneCallParams is an object containing various call related parameters. * It can be used to retrieve parameters from a currently running call or modify the call's characteristics * dynamically. **/ -struct _LinphoneCallParams; typedef struct _LinphoneCallParams LinphoneCallParams; const PayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp); @@ -209,12 +216,17 @@ enum _LinphoneReason{ LinphoneReasonNotAnswered }; +/** + * Enum describing failure reasons. + * @ingroup initializing +**/ typedef enum _LinphoneReason LinphoneReason; const char *linphone_reason_to_string(LinphoneReason err); /** * Structure describing policy regarding video streams establishments. + * @ingroup media_parameters **/ struct _LinphoneVideoPolicy{ bool_t automatically_initiate; /**