[ekiga] Opal::CallManager: Allow a bigger bitrate.



commit 691a72daf0609488ef8ba47438597fdec2feee37
Author: Damien Sandras <dsandras seconix com>
Date:   Sun Dec 28 15:06:43 2014 +0100

    Opal::CallManager: Allow a bigger bitrate.
    
    Also changed the signification of the maximum rx bitrate. This is not
    really the allowed reception bitrate. This is actually the allowed
    bitrate (rx & tx) for the Ekiga endpoint.

 lib/engine/components/opal/opal-call-manager.cpp |   65 ++++++++--------------
 lib/engine/components/opal/opal-call-manager.h   |   14 ++--
 org.gnome.ekiga.gschema.xml.in.in                |    8 +-
 3 files changed, 34 insertions(+), 53 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-call-manager.cpp 
b/lib/engine/components/opal/opal-call-manager.cpp
index 5974a24..7646e80 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -685,50 +685,31 @@ void CallManager::set_video_options (const CallManager::VideoOptions & options)
   OpalMediaFormat::GetAllRegisteredMediaFormats (media_formats_list);
 
   int maximum_frame_rate = std::min (std::max ((signed) options.maximum_frame_rate, 1), 30);
-  int maximum_received_bitrate = (options.maximum_received_bitrate > 0 ? options.maximum_received_bitrate : 
4096);
-  int maximum_transmitted_bitrate = (options.maximum_transmitted_bitrate > 0 ? 
options.maximum_transmitted_bitrate : 48);
-  int temporal_spatial_tradeoff = (options.temporal_spatial_tradeoff > 0 ? options.temporal_spatial_tradeoff 
: 31);
+  int maximum_bitrate = (options.maximum_bitrate > 0 ? options.maximum_bitrate : 16384);
+  int maximum_transmitted_bitrate = (options.maximum_transmitted_bitrate > 0 ? 
options.maximum_transmitted_bitrate : 256);
+  int temporal_spatial_tradeoff = (options.temporal_spatial_tradeoff > 0 ? options.temporal_spatial_tradeoff 
: 12);
   // Configure all mediaOptions of all Video MediaFormats
   for (int i = 0 ; i < media_formats_list.GetSize () ; i++) {
 
     OpalMediaFormat media_format = media_formats_list [i];
     if (media_format.GetMediaType() == OpalMediaType::Video ()) {
 
-      media_format.SetOptionInteger (OpalVideoFormat::FrameWidthOption (),
-                                     Ekiga::VideoSizes [options.size].width);
-      media_format.SetOptionInteger (OpalVideoFormat::FrameHeightOption (),
-                                     Ekiga::VideoSizes [options.size].height);
-      media_format.SetOptionInteger (OpalVideoFormat::FrameTimeOption (),
-                                     (int) (90000 / maximum_frame_rate));
-      media_format.SetOptionInteger (OpalVideoFormat::MaxBitRateOption (),
-                                     maximum_received_bitrate * 1000);
-      media_format.SetOptionInteger (OpalVideoFormat::TargetBitRateOption (),
-                                     maximum_transmitted_bitrate * 1000);
-      media_format.SetOptionInteger (OpalVideoFormat::MinRxFrameWidthOption(),
-                                     GM_QSIF_WIDTH);
-      media_format.SetOptionInteger (OpalVideoFormat::MinRxFrameHeightOption(),
-                                     GM_QSIF_HEIGHT);
-      media_format.SetOptionInteger (OpalVideoFormat::MaxRxFrameWidthOption(),
-                                     GM_1080P_WIDTH);
-      media_format.SetOptionInteger (OpalVideoFormat::MaxRxFrameHeightOption(),
-                                     GM_1080P_HEIGHT);
-      media_format.AddOption(new OpalMediaOptionUnsigned (OpalVideoFormat::TemporalSpatialTradeOffOption (),
-                                                          true, OpalMediaOption::NoMerge,
-                                                          temporal_spatial_tradeoff));
-      media_format.SetOptionInteger (OpalVideoFormat::TemporalSpatialTradeOffOption(),
-                                     temporal_spatial_tradeoff);
-      media_format.AddOption(new OpalMediaOptionUnsigned (OpalVideoFormat::MaxFrameSizeOption (),
-                                                          true, OpalMediaOption::NoMerge, 1400));
-      media_format.SetOptionInteger (OpalVideoFormat::MaxFrameSizeOption (),
-                                     1400);
-
-      if ( media_format.GetName() != "YUV420P" &&
-           media_format.GetName() != "RGB32" &&
-           media_format.GetName() != "RGB24") {
-
-        media_format.SetOptionInteger (OpalVideoFormat::RateControlPeriodOption(),
-                                       300);
-      }
+      media_format.SetOptionInteger (OpalVideoFormat::FrameWidthOption (), Ekiga::VideoSizes 
[options.size].width);
+      media_format.SetOptionInteger (OpalVideoFormat::FrameHeightOption (), Ekiga::VideoSizes 
[options.size].height);
+      media_format.SetOptionInteger (OpalVideoFormat::FrameTimeOption (), (int) (90000 / 
maximum_frame_rate));
+      media_format.SetOptionInteger (OpalVideoFormat::MaxBitRateOption (), maximum_bitrate * 1000);
+      media_format.SetOptionInteger (OpalVideoFormat::TargetBitRateOption (), maximum_transmitted_bitrate * 
1000);
+      media_format.SetOptionInteger (OpalVideoFormat::MinRxFrameWidthOption(), GM_QSIF_WIDTH);
+      media_format.SetOptionInteger (OpalVideoFormat::MinRxFrameHeightOption(), GM_QSIF_HEIGHT);
+      media_format.SetOptionInteger (OpalVideoFormat::MaxRxFrameWidthOption(), GM_1080P_WIDTH);
+      media_format.SetOptionInteger (OpalVideoFormat::MaxRxFrameHeightOption(), GM_1080P_HEIGHT);
+      media_format.AddOption(new OpalMediaOptionUnsigned (OpalVideoFormat::TemporalSpatialTradeOffOption (), 
true, OpalMediaOption::NoMerge, temporal_spatial_tradeoff));
+      media_format.SetOptionInteger (OpalVideoFormat::TemporalSpatialTradeOffOption(), 
temporal_spatial_tradeoff);
+
+      if (media_format.GetName() != "YUV420P" &&
+          media_format.GetName() != "RGB32" &&
+          media_format.GetName() != "RGB24")
+        media_format.SetOptionInteger (OpalVideoFormat::RateControlPeriodOption(), 300);
 
       switch (options.extended_video_roles) {
       case 0 :
@@ -780,8 +761,8 @@ void CallManager::set_video_options (const CallManager::VideoOptions & options)
     }
   }
 
+  PTRACE (4, "Opal::CallManager\tVideo Max Bitrate: " << maximum_bitrate);
   PTRACE (4, "Opal::CallManager\tVideo Max Tx Bitrate: " << maximum_transmitted_bitrate);
-  PTRACE (4, "Opal::CallManager\tVideo Max Rx Bitrate: " << maximum_received_bitrate);
   PTRACE (4, "Opal::CallManager\tVideo Temporal Spatial Tradeoff: " << temporal_spatial_tradeoff);
   PTRACE (4, "Opal::CallManager\tVideo Size: " << options.size);
   PTRACE (4, "Opal::CallManager\tVideo Max Frame Rate: " << maximum_frame_rate);
@@ -811,7 +792,7 @@ void CallManager::get_video_options (CallManager::VideoOptions & options) const
 
       options.maximum_frame_rate =
         (int) (90000 / media_format.GetOptionInteger (OpalVideoFormat::FrameTimeOption ()));
-      options.maximum_received_bitrate =
+      options.maximum_bitrate =
         (int) (media_format.GetOptionInteger (OpalVideoFormat::MaxBitRateOption ()) / 1000);
       options.maximum_transmitted_bitrate =
         (int) (media_format.GetOptionInteger (OpalVideoFormat::TargetBitRateOption ()) / 1000);
@@ -1154,11 +1135,11 @@ CallManager::setup (const std::string & setting)
     options.maximum_frame_rate = video_codecs_settings->get_int ("max-frame-rate");
     set_video_options (options);
   }
-  if (setting.empty () || setting == "maximum-video-rx-bitrate") {
+  if (setting.empty () || setting == "maximum-video-bitrate") {
 
     CallManager::VideoOptions options;
     get_video_options (options);
-    options.maximum_received_bitrate = video_codecs_settings->get_int ("maximum-video-rx-bitrate");
+    options.maximum_bitrate = video_codecs_settings->get_int ("maximum-video-bitrate");
     set_video_options (options);
   }
   if (setting.empty () || setting == "media-list") {
diff --git a/lib/engine/components/opal/opal-call-manager.h b/lib/engine/components/opal/opal-call-manager.h
index 55a11d5..5d9828a 100644
--- a/lib/engine/components/opal/opal-call-manager.h
+++ b/lib/engine/components/opal/opal-call-manager.h
@@ -169,20 +169,20 @@ public:
     void set_stun_enabled (bool);
 
     /**/
-    struct VideoOptions 
+    struct VideoOptions
       {
-        VideoOptions () 
-          : size (0), 
-          maximum_frame_rate (0), 
-          temporal_spatial_tradeoff (0), 
-          maximum_received_bitrate (0), 
+        VideoOptions ()
+          : size (0),
+          maximum_frame_rate (0),
+          temporal_spatial_tradeoff (0),
+          maximum_bitrate (0),
           maximum_transmitted_bitrate (0),
           extended_video_roles (0) {};
 
         unsigned size;
         unsigned maximum_frame_rate;
         unsigned temporal_spatial_tradeoff;
-        unsigned maximum_received_bitrate;
+        unsigned maximum_bitrate;
         unsigned maximum_transmitted_bitrate;
         unsigned extended_video_roles;
       };
diff --git a/org.gnome.ekiga.gschema.xml.in.in b/org.gnome.ekiga.gschema.xml.in.in
index fdf6156..1ba01b2 100644
--- a/org.gnome.ekiga.gschema.xml.in.in
+++ b/org.gnome.ekiga.gschema.xml.in.in
@@ -378,10 +378,10 @@
       <_summary>Maximum TX video bitrate</_summary>
       <_description>The maximum TX video bitrate in kbit/s. The video quality and the number of transmitted 
frames per second (depends on selected codec) will be dynamically adjusted above their minimum during calls 
to try to minimize the bandwidth to the given value</_description>
     </key>
-    <key name="maximum-video-rx-bitrate" type="i">
-      <default>4096</default>
-      <_summary>Maximum RX video bitrate</_summary>
-      <_description>The maximum RX video bitrate in kbit/s. This value will be signaled to the peer endpoint 
that can adjust (if it supports it) its TX bitrate if it is above the signaled value</_description>
+    <key name="maximum-video-bitrate" type="i">
+      <default>16384</default>
+      <_summary>Maximum video bitrate</_summary>
+      <_description>The maximum video bitrate in kbit/s. This value will be signaled to the peer endpoint 
that can adjust (if it supports it) its TX bitrate if it is above the signaled value</_description>
     </key>
     <key name="temporal-spatial-tradeoff" type="i">
       <range min="0" max="31"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]