**/
typedef enum _LinphoneIceState LinphoneIceState;
+/**
+ * Enum describing uPnP states.
+ * @ingroup initializing
+**/
+enum _LinphoneUpnpState{
+ LinphoneUpnpStateIdle, /**< uPnP is not activate */
+ LinphoneUpnpStatePending, /**< uPnP process is in progress */
+ LinphoneUpnpStateAdding, /**< Internal use: Only used by port binding */
+ LinphoneUpnpStateRemoving, /**< Internal use: Only used by port binding */
+ LinphoneUpnpStateNotAvailable, /**< uPnP is not available */
+ LinphoneUpnpStateOk, /**< uPnP is enabled */
+ LinphoneUpnpStateKo, /**< uPnP processing has failed */
+};
+
+/**
+ * Enum describing uPnP states.
+ * @ingroup initializing
+**/
+typedef enum _LinphoneUpnpState LinphoneUpnpState;
+
+
/**
* The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.
*
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.*/
LinphoneIceState ice_state; /**< State of ICE processing. */
+ LinphoneUpnpState upnp_state; /**< State of uPnP processing. */
float download_bandwidth; /**<Download bandwidth measurement of received stream, expressed in kbit/s, including IP/UDP/RTP headers*/
float upload_bandwidth; /**<Download bandwidth measurement of sent stream, expressed in kbit/s, including IP/UDP/RTP headers*/
};
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="call_statistics">
- <property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Call statistics</property>
<property name="type_hint">dialog</property>
- <signal name="response" handler="linphone_gtk_call_statistics_closed" swapped="no"/>
+ <signal name="response" handler="linphone_gtk_call_statistics_closed"/>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="audio_codec_label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes">Audio codec</property>
</object>
<packing>
<child>
<object class="GtkLabel" id="video_codec_label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes">Video codec</property>
</object>
<packing>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes">Audio IP bandwidth usage</property>
</object>
<packing>
<child>
<object class="GtkLabel" id="audio_codec">
<property name="visible">True</property>
- <property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<child>
<object class="GtkLabel" id="video_codec">
<property name="visible">True</property>
- <property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<child>
<object class="GtkLabel" id="audio_bandwidth_usage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Media connectivity</property>
+ <property name="label" translatable="yes">Audio Media connectivity</property>
</object>
<packing>
<property name="top_attach">4</property>
</packing>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <object class="GtkLabel" id="media_connectivity">
+ <object class="GtkLabel" id="audio_media_connectivity">
<property name="visible">True</property>
- <property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes">Video IP bandwidth usage</property>
</object>
<packing>
<child>
<object class="GtkLabel" id="video_bandwidth_usage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="bottom_attach">4</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Video Media connectivity</property>
+ </object>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="video_media_connectivity">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
</object>
</child>
</object>
<child type="label">
<object class="GtkLabel" id="call_statistics_label">
<property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes"><b>Call statistics and information</b></property>
<property name="use_markup">True</property>
</object>
<property name="position">1</property>
</packing>
</child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
</object>
</child>
<action-widgets>
return "invalid";
}
+static const char *upnp_state_to_string(LinphoneUpnpState ice_state){
+ switch(ice_state){
+ case LinphoneUpnpStateIdle:
+ return _("uPnP not activated");
+ case LinphoneUpnpStatePending:
+ return _("uPnP in progress");
+ case LinphoneUpnpStateNotAvailable:
+ return _("uPnp not available");
+ case LinphoneUpnpStateOk:
+ return _("uPnP is running");
+ case LinphoneUpnpStateKo:
+ return _("uPnP failed");
+ default:
+ break;
+ }
+ return "invalid";
+}
+
static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){
const LinphoneCallStats *as=linphone_call_get_audio_stats(call);
const LinphoneCallStats *vs=linphone_call_get_video_stats(call);
- LinphoneIceState ice_state=as->ice_state;
+ const char *audio_media_connectivity = _("Direct");
+ const char *video_media_connectivity = _("Direct");
gchar *tmp=g_strdup_printf(_("download: %f\nupload: %f (kbit/s)"),
as->download_bandwidth,as->upload_bandwidth);
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"audio_bandwidth_usage")),tmp);
vs->download_bandwidth,vs->upload_bandwidth);
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_bandwidth_usage")),tmp);
g_free(tmp);
- gtk_label_set_text(GTK_LABEL(linphone_gtk_get_widget(callstats,"media_connectivity")),ice_state_to_string(ice_state));
+ if(as->upnp_state != LinphoneUpnpStateNotAvailable && as->upnp_state != LinphoneUpnpStateIdle) {
+ audio_media_connectivity = upnp_state_to_string(as->upnp_state);
+ } else if(as->ice_state != LinphoneIceStateNotActivated) {
+ audio_media_connectivity = ice_state_to_string(as->ice_state);
+ }
+ gtk_label_set_text(GTK_LABEL(linphone_gtk_get_widget(callstats,"audio_media_connectivity")),audio_media_connectivity);
+ if(vs->upnp_state != LinphoneUpnpStateNotAvailable && vs->upnp_state != LinphoneUpnpStateIdle) {
+ video_media_connectivity = upnp_state_to_string(vs->upnp_state);
+ } else if(vs->ice_state != LinphoneIceStateNotActivated) {
+ video_media_connectivity = ice_state_to_string(vs->ice_state);
+ }
+ gtk_label_set_text(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_media_connectivity")),video_media_connectivity);
}
static gboolean refresh_call_stats(GtkWidget *callstats){