]> sjero.net Git - linphone/commitdiff
implement and active adaptive rate control for audio & video.
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 19 Oct 2011 08:55:44 +0000 (10:55 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 19 Oct 2011 08:55:44 +0000 (10:55 +0200)
coreapi/linphonecall.c
coreapi/linphonecore.c
gtk/parameters.ui
gtk/propertybox.c
mediastreamer2
oRTP

index 15b1aa72325a59868ab810f7664713dc61ac600f..f4bc4f4d779a70ab78076c804bb67f2d057e8f81 100644 (file)
@@ -1092,7 +1092,9 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
                        bool_t is_inactive=FALSE;
 
                        call->current_params.has_video=TRUE;
-                       
+
+                       video_stream_enable_adaptive_bitrate_control(call->videostream,
+                                                                 linphone_core_adaptive_rate_control_enabled(lc));
                        video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
                        video_stream_enable_self_view(call->videostream,lc->video_conf.selfview);
                        if (lc->video_window_id!=0)
index 3a21ae70135241ed9bf815d0012ea3ca8dc492fb..8f3986a17bd90f4623524202a183137c73162b4a 100644 (file)
@@ -814,7 +814,7 @@ void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled
  * 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",FALSE);
+       return lp_config_get_int(lc->config,"net","adaptive_rate_control",TRUE);
 }
 
 bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc){
index 9af426212d36886aa0f20ce92d24bc1b5ca844d6..ce9373dae81446bc5ce26536c5cc13a1ae3e69d5 100644 (file)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">500</property>
     <property name="upper">3001</property>
                                     <property name="can_focus">True</property>
                                     <property name="primary_icon_activatable">False</property>
                                     <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
                                     <property name="adjustment">adjustment1</property>
                                     <signal name="value-changed" handler="linphone_gtk_mtu_changed" swapped="no"/>
                                   </object>
                                     <property name="invisible_char_set">True</property>
                                     <property name="primary_icon_activatable">False</property>
                                     <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
                                     <property name="adjustment">adjustment7</property>
                                     <signal name="value-changed" handler="linphone_gtk_update_my_port" swapped="no"/>
                                   </object>
                                     <property name="invisible_char_set">True</property>
                                     <property name="primary_icon_activatable">False</property>
                                     <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
                                     <property name="adjustment">adjustment2</property>
                                     <signal name="value-changed" handler="linphone_gtk_video_port_changed" swapped="no"/>
                                   </object>
                                     <property name="invisible_char_set">True</property>
                                     <property name="primary_icon_activatable">False</property>
                                     <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
                                     <property name="adjustment">adjustment3</property>
                                     <signal name="value-changed" handler="linphone_gtk_audio_port_changed" swapped="no"/>
                                   </object>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <property name="primary_icon_activatable">False</property>
                                     <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
                                     <signal name="changed" handler="linphone_gtk_nat_address_changed" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                     <property name="primary_icon_activatable">False</property>
                                     <property name="secondary_icon_activatable">False</property>
-                                    <property name="primary_icon_sensitive">True</property>
-                                    <property name="secondary_icon_sensitive">True</property>
                                     <signal name="changed" handler="linphone_gtk_stun_server_changed" swapped="no"/>
                                   </object>
                                   <packing>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
                                 <signal name="editing-done" handler="linphone_gtk_alsa_special_device_changed" swapped="no"/>
                               </object>
                               <packing>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
                                 <signal name="changed" handler="linphone_gtk_update_my_contact" swapped="no"/>
                               </object>
                               <packing>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
                                 <signal name="changed" handler="linphone_gtk_update_my_contact" swapped="no"/>
                               </object>
                               <packing>
                                 <property name="editable">False</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="hscrollbar_policy">automatic</property>
-                                <property name="vscrollbar_policy">automatic</property>
                                 <child>
                                   <object class="GtkTreeView" id="proxy_list">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection1"/>
+                                    </child>
                                   </object>
                                 </child>
                               </object>
@@ -1638,8 +1618,6 @@ virtual network !</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="hscrollbar_policy">automatic</property>
-                                    <property name="vscrollbar_policy">automatic</property>
                                     <property name="shadow_type">out</property>
                                     <child>
                                       <object class="GtkTreeView" id="codec_list">
@@ -1647,6 +1625,9 @@ virtual network !</property>
                                         <property name="can_focus">True</property>
                                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                         <property name="has_tooltip">True</property>
+                                        <child internal-child="selection">
+                                          <object class="GtkTreeSelection" id="treeview-selection2"/>
+                                        </child>
                                       </object>
                                     </child>
                                   </object>
@@ -1843,7 +1824,7 @@ virtual network !</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="n_rows">2</property>
+                            <property name="n_rows">3</property>
                             <property name="n_columns">2</property>
                             <child>
                               <object class="GtkSpinButton" id="upload_bw">
@@ -1853,8 +1834,6 @@ virtual network !</property>
                                 <property name="tooltip_text" translatable="yes">0 stands for "unlimited"</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
                                 <property name="adjustment">adjustment5</property>
                                 <signal name="value-changed" handler="linphone_gtk_upload_bw_changed" swapped="no"/>
                               </object>
@@ -1863,6 +1842,8 @@ virtual network !</property>
                                 <property name="right_attach">2</property>
                                 <property name="top_attach">1</property>
                                 <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"></property>
                               </packing>
                             </child>
                             <child>
@@ -1873,14 +1854,14 @@ virtual network !</property>
                                 <property name="tooltip_text" translatable="yes">0 stands for "unlimited"</property>
                                 <property name="primary_icon_activatable">False</property>
                                 <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
                                 <property name="adjustment">adjustment6</property>
                                 <signal name="value-changed" handler="linphone_gtk_download_bw_changed" swapped="no"/>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options">GTK_EXPAND</property>
                               </packing>
                             </child>
                             <child>
@@ -1905,6 +1886,41 @@ virtual network !</property>
                                 <property name="justify">right</property>
                               </object>
                             </child>
+                            <child>
+                              <object class="GtkCheckButton" id="adaptive_rate_control">
+                                <property name="label" translatable="yes">Enable adaptive rate control</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                                <signal name="toggled" handler="linphone_gtk_adaptive_rate_control_toggled" swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"></property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label5">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">&lt;i&gt;Adaptive rate control is a technique to dynamically guess the available bandwidth during a call.&lt;/i&gt;</property>
+                                <property name="use_markup">True</property>
+                                <property name="wrap">True</property>
+                              </object>
+                              <packing>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"></property>
+                              </packing>
+                            </child>
                           </object>
                         </child>
                       </object>
index 193541029d847f6bd1c3f995a9bc4fc7a8bcc873..78a8ca4230f05c1d84431752a3c1855bbb88ca25 100644 (file)
@@ -453,6 +453,11 @@ void linphone_gtk_upload_bw_changed(GtkWidget *w){
        linphone_gtk_check_codec_bandwidth(v);
 }
 
+void linphone_gtk_adaptive_rate_control_toggled(GtkToggleButton *button){
+       gboolean active=gtk_toggle_button_get_active(button);
+       linphone_core_enable_adaptive_rate_control(linphone_gtk_get_core(),active);
+}
+
 static void linphone_gtk_codec_move(GtkWidget *button, int dir){
        GtkTreeView *v=GTK_TREE_VIEW(linphone_gtk_get_widget(gtk_widget_get_toplevel(button),"codec_list"));
        GtkTreeSelection *sel=gtk_tree_view_get_selection(v);
@@ -899,6 +904,8 @@ void linphone_gtk_show_parameters(void){
                                linphone_core_get_download_bandwidth(lc));
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"upload_bw")),
                                linphone_core_get_upload_bandwidth(lc));
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"adaptive_rate_control")),
+                                linphone_core_adaptive_rate_control_enabled(lc));
 
 
        /* UI CONFIG */
index 3e62df330823c9efefaf314e894a6a7867f9ff76..954911c0dbdf7351cd82df70d0999a84d163db7f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3e62df330823c9efefaf314e894a6a7867f9ff76
+Subproject commit 954911c0dbdf7351cd82df70d0999a84d163db7f
diff --git a/oRTP b/oRTP
index 0a878baa150133e35acdfb7082ccc99a54be41fe..3256179b911975ce7d3556f8e2c00b21881a84d2 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 0a878baa150133e35acdfb7082ccc99a54be41fe
+Subproject commit 3256179b911975ce7d3556f8e2c00b21881a84d2