]> sjero.net Git - linphone/commitdiff
enhance documentation
authorSimon Morlat <simon.morlat@linphone.org>
Thu, 21 Jun 2012 10:13:10 +0000 (12:13 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Thu, 21 Jun 2012 10:13:10 +0000 (12:13 +0200)
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h

index ac84602912ad75f5276ffac27b6702301608abfa..ec006dd58bad9e0f29cab205d9aea14ffe9655d8 100644 (file)
@@ -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];
+}
+
+
 /**
  * @}
 **/
index 41b9e2ddad6549645d4fe60bcc74389c86e6567a..d48c2fa283dc4d8b5b0064c6544a3748a0a469c7 100644 (file)
@@ -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;
index c9c6fc1a141104036d9e9d2f28193b31b44d9d86..79d6204a07553564cd0762e913d95f6ad708be1d 100644 (file)
@@ -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; /**<Whether video shall be automatically proposed for outgoing calls.*/ 
@@ -222,28 +234,61 @@ struct _LinphoneVideoPolicy{
        bool_t unused[2];
 };
 
+/**
+ * Structure describing policy regarding video streams establishments.
+ * @ingroup media_parameters
+**/
 typedef struct _LinphoneVideoPolicy LinphoneVideoPolicy;
 
 /**
  * The LinphoneCall object represents a call issued or received by the LinphoneCore
+ * @ingroup call_control
 **/
 struct _LinphoneCall;
 /**
  * The LinphoneCall object represents a call issued or received by the LinphoneCore
+ * @ingroup call_control
 **/
 typedef struct _LinphoneCall LinphoneCall;
 
 
+/**
+ * @addtogroup call_misc
+ * @{
+**/
+
 #define LINPHONE_CALL_STATS_AUDIO 0
 #define LINPHONE_CALL_STATS_VIDEO 1
 
-typedef struct _LinphoneCallStats {
-       int             type;
-       jitter_stats_t  jitter_stats;
-       mblk_t*         received_rtcp;
-       mblk_t*         sent_rtcp;
-       float           round_trip_delay;
-} LinphoneCallStats;
+/**
+ * The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.
+ *
+ * To receive these informations periodically and as soon as they are computed, the application is invited to place a #CallStatsUpdated callback in the LinphoneCoreVTable structure
+ * it passes for instanciating the LinphoneCore object (see linphone_core_new() ).
+ *
+ * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats().
+**/
+typedef struct _LinphoneCallStats LinphoneCallStats;
+
+/**
+ * The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.
+ *
+ * To receive these informations periodically and as soon as they are computed, the application is invited to place a #CallStatsUpdated callback in the LinphoneCoreVTable structure
+ * it passes for instanciating the LinphoneCore object (see linphone_core_new() ).
+ *
+ * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats().
+**/
+struct _LinphoneCallStats {
+       int             type; /**< Can be either LINPHONE_CALL_STATS_AUDIO or LINPHONE_CALL_STATS_VIDEO*/
+       jitter_stats_t  jitter_stats; /**<jitter buffer statistics, see oRTP documentation for details */
+       mblk_t*         received_rtcp; /**<Last RTCP packet received, as a mblk_t structure. See oRTP documentation for details how to extract information from it*/
+       mblk_t*         sent_rtcp;/**<Last RTCP packet sent, as a mblk_t structure. See oRTP documentation for details how to extract information from it*/
+       float           round_trip_delay; /**<Round trip propagation time in seconds if known, -1 if unknown.*/
+};
+
+/**
+ * @}
+**/
 
 const LinphoneCallStats *linphone_call_get_audio_stats(const LinphoneCall *call);
 const LinphoneCallStats *linphone_call_get_video_stats(const LinphoneCall *call);
@@ -345,7 +390,12 @@ void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val);
 bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
 
 /*keep this in sync with mediastreamer2/msvolume.h*/
-#define LINPHONE_VOLUME_DB_LOWEST (-120) /**< Lowest measured that can be returned.*/
+
+/**
+ * Lowest volume measurement that can be returned by linphone_call_get_play_volume() or linphone_call_get_record_volume(), corresponding to pure silence.
+ * @ingroup call_misc
+**/
+#define LINPHONE_VOLUME_DB_LOWEST (-120)
 
 /**
  * @addtogroup proxies
@@ -644,7 +694,7 @@ typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to);
 typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf);
 /** Callback prototype for in progress transfers. The new_call_state is the state of the call resulting of the transfer, at the other party. */
 typedef void (*LinphoneTransferStateChanged)(struct _LinphoneCore *lc, LinphoneCall *transfered, LinphoneCallState new_call_state);
-/** Callback prototype */
+/** Callback prototype for receiving quality statistics for calls*/
 typedef void (*CallStatsUpdated)(struct _LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats);
 
 /**
@@ -666,7 +716,7 @@ typedef struct _LinphoneVTable{
        LinphoneTransferStateChanged transfer_state_changed; /**<Notifies when a transfer is in progress */
        BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/
        NotifyReceivedCb notify_recv; /**< Other notifications*/
-       CallStatsUpdated call_stats_updated; /**<Notifies on change in the stats of call */
+       CallStatsUpdated call_stats_updated; /**<Notifies on refreshing of call's statistics. */
        DisplayStatusCb display_status; /**< Callback that notifies various events with human readable text.*/
        DisplayMessageCb display_message;/**< Callback to display a message to the user */
        DisplayMessageCb display_warning;/** Callback to display a warning to the user */
@@ -972,7 +1022,7 @@ const MSList * linphone_core_get_call_logs(LinphoneCore *lc);
 void linphone_core_clear_call_logs(LinphoneCore *lc);
 int linphone_core_get_missed_calls_count(LinphoneCore *lc);
 void linphone_core_reset_missed_calls_count(LinphoneCore *lc);
-void linphone_core_remove_call_log(LinphoneCore *lc, void *data);
+void linphone_core_remove_call_log(LinphoneCore *lc, LinphoneCallLog *call_log);
 
 /* video support */
 bool_t linphone_core_video_supported(LinphoneCore *lc);
@@ -1159,7 +1209,7 @@ typedef struct LinphoneTunnel LinphoneTunnel;
 * get tunnel instance if available
 */
 LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc);
-    
+
 void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy);
 
 #ifdef __cplusplus