[ekiga] Setup H.239 configuration (H323)



commit 580d1a28510f0d3ef194c85bb6b73e7f8a2ce105
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date:   Tue Aug 7 22:12:24 2012 +0200

    Setup H.239 configuration (H323)
    
    This is the first patch of bug #681310.  It shows, when a participant
    is streaming their slides through H.239, the slides, and only the
    slides.  A future commit will show both video streams: the main role
    and the slides.

 ekiga.schemas.in.in                                |   22 ++++++++++++
 lib/engine/components/opal/opal-call-manager.cpp   |   35 ++++++++++++++++++++
 lib/engine/components/opal/opal-call-manager.h     |    4 ++-
 lib/engine/components/opal/opal-gmconf-bridge.cpp  |   11 ++++++
 lib/engine/gui/gtk-frontend/preferences-window.cpp |   13 +++++++-
 5 files changed, 83 insertions(+), 2 deletions(-)
---
diff --git a/ekiga.schemas.in.in b/ekiga.schemas.in.in
index 91106fd..5efc658 100644
--- a/ekiga.schemas.in.in
+++ b/ekiga.schemas.in.in
@@ -453,6 +453,28 @@
       </locale>
     </schema>
     <schema>
+      <key>/schemas/apps/@PACKAGE_NAME@/protocols/h323/enable_h239</key>
+      <applyto>/apps/@PACKAGE_NAME@/protocols/h323/enable_h239</applyto>
+      <owner>Ekiga</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+	<short>Enable H.239</short>
+	<long>This enables H.239 capability for additional video roles</long>
+      </locale>
+    </schema>
+    <schema>
+      <key>/schemas/apps/@PACKAGE_NAME@/protocols/h323/video_role</key>
+      <applyto>/apps/@PACKAGE_NAME@/protocols/h323/video_role</applyto>
+      <owner>Ekiga</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+	<short>Extented Video Roles</short>
+	<long>Select the H.239 Video Role. The values can be 0 (for "disable extended video"), 1 (for "allow per content role mask"), 2 (for "force presentation"), or 3 (for "force live role")</long>
+      </locale>
+    </schema>
+    <schema>
       <key>/schemas/apps/@PACKAGE_NAME@/protocols/h323/dtmf_mode</key>
       <applyto>/apps/@PACKAGE_NAME@/protocols/h323/dtmf_mode</applyto>
       <owner>Ekiga</owner>
diff --git a/lib/engine/components/opal/opal-call-manager.cpp b/lib/engine/components/opal/opal-call-manager.cpp
index d6ba26f..b80dca4 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -599,6 +599,25 @@ void CallManager::set_video_options (const CallManager::VideoOptions & options)
                                        300);
       }
 
+      switch (options.extended_video_roles) {
+      case 0 :
+        media_format.SetOptionInteger(OpalVideoFormat::ContentRoleMaskOption(), 0);
+        break;
+
+      case 2 : // Force Presentation (slides)
+        media_format.SetOptionInteger(OpalVideoFormat::ContentRoleMaskOption(),
+                                      OpalVideoFormat::ContentRoleBit(OpalVideoFormat::ePresentation));
+        break;
+
+      case 3 : // Force Live (main)
+        media_format.SetOptionInteger(OpalVideoFormat::ContentRoleMaskOption(),
+                                      OpalVideoFormat::ContentRoleBit(OpalVideoFormat::eMainRole));
+        break;
+
+        default :
+          break;
+      }
+
       OpalMediaFormat::SetRegisteredMediaFormat(media_format);
     }
   }
@@ -662,6 +681,22 @@ void CallManager::get_video_options (CallManager::VideoOptions & options) const
       options.temporal_spatial_tradeoff =
         media_format.GetOptionInteger (OpalVideoFormat::TemporalSpatialTradeOffOption ());
 
+      int evr = media_format.GetOptionInteger (OpalVideoFormat::OpalVideoFormat::ContentRoleMaskOption ());
+      switch (evr) {
+      case 0: // eNoRole
+        options.extended_video_roles = 0;
+        break;
+      case 1: // ePresentation
+        options.extended_video_roles = 2;
+        break;
+      case 2: // eMainRole
+        options.extended_video_roles = 3;
+        break;
+      default:
+        options.extended_video_roles = 1;
+        break;
+      }
+
       break;
     }
   }
diff --git a/lib/engine/components/opal/opal-call-manager.h b/lib/engine/components/opal/opal-call-manager.h
index e554b61..1d64b8b 100644
--- a/lib/engine/components/opal/opal-call-manager.h
+++ b/lib/engine/components/opal/opal-call-manager.h
@@ -139,13 +139,15 @@ public:
           maximum_frame_rate (0), 
           temporal_spatial_tradeoff (0), 
           maximum_received_bitrate (0), 
-          maximum_transmitted_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_transmitted_bitrate;
+        unsigned extended_video_roles;
       };
 
     void set_video_options (const VideoOptions & options);
diff --git a/lib/engine/components/opal/opal-gmconf-bridge.cpp b/lib/engine/components/opal/opal-gmconf-bridge.cpp
index 7c5a855..ce88044 100644
--- a/lib/engine/components/opal/opal-gmconf-bridge.cpp
+++ b/lib/engine/components/opal/opal-gmconf-bridge.cpp
@@ -110,6 +110,8 @@ ConfBridge::ConfBridge (Ekiga::Service & _service)
   keys.push_back (H323_KEY "enable_fast_start");
   keys.push_back (H323_KEY "dtmf_mode");
   keys.push_back (H323_KEY "forward_host");
+  keys.push_back (H323_KEY "enable_h239");
+  keys.push_back (H323_KEY "video_role");
 
   keys.push_back (NAT_KEY "stun_server");
   keys.push_back (NAT_KEY "enable_stun");
@@ -328,6 +330,15 @@ void ConfBridge::on_property_changed (std::string key, GmConfEntry *entry)
           h323_manager->set_forward_uri (str);
         g_free (str);
       }
+      else if (key == H323_KEY "video_role") {
+        CallManager::VideoOptions options;
+        manager.get_video_options (options);
+        options.extended_video_roles = gm_conf_entry_get_int (entry);
+        manager.set_video_options (options);
+      }
+      else if (key == H323_KEY "enable_h239") {
+        h323_manager->SetDefaultH239Control(gm_conf_entry_get_bool (entry));
+      }
     }
   }
 #endif
diff --git a/lib/engine/gui/gtk-frontend/preferences-window.cpp b/lib/engine/gui/gtk-frontend/preferences-window.cpp
index 1db7bea..32c1daf 100644
--- a/lib/engine/gui/gtk-frontend/preferences-window.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -661,6 +661,13 @@ gm_pw_init_h323_page (GtkWidget *prefs_window,
       _("Q.931"),
       NULL};
 
+  const gchar *roles [] =
+    { _("Disable H.239 Extendend Video"),
+      _("Allow H.239 per Content Role Mask"),
+      _("Force H.239 Presentation Role"),
+      _("Force H.239 Live Role"),
+      NULL };
+
   /* Add Misc Settings */
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                            _("Misc Settings"), 2, 2);
@@ -672,7 +679,7 @@ gm_pw_init_h323_page (GtkWidget *prefs_window,
 
   /* Packing widget */
   subsection = gnome_prefs_subsection_new (prefs_window, container,
-                                _("Advanced Settings"), 3, 1);
+                                _("Advanced Settings"), 5, 1);
 
   /* The toggles */
   gnome_prefs_toggle_new (subsection, _("Enable H.245 _tunneling"), H323_KEY "enable_h245_tunneling", _("This enables H.245 Tunneling mode. In H.245 Tunneling mode H.245 messages are encapsulated into the H.225 channel (port 1720). This saves one TCP connection during calls. H.245 Tunneling was introduced in H.323v2 and Netmeeting does not support it. Using both Fast Start and H.245 Tunneling can crash some versions of Netmeeting."), 0);
@@ -681,6 +688,10 @@ gm_pw_init_h323_page (GtkWidget *prefs_window,
 
   gnome_prefs_toggle_new (subsection, _("Enable fast _start procedure"), H323_KEY "enable_fast_start", _("Connection will be established in Fast Start mode. Fast Start is a new way to start calls faster that was introduced in H.323v2. It is not supported by Netmeeting and using both Fast Start and H.245 Tunneling can crash some versions of Netmeeting."), 2);
 
+  gnome_prefs_toggle_new (subsection, _("Enable H.239 control"), H323_KEY "enable_h239", _("This enables H.239 capability for additional video roles."), 3);
+
+  gnome_prefs_int_option_menu_new (subsection, _("Extended Video Roles:"), roles, H323_KEY "video_role", _("Select the H.239 Video Role"), 4);
+
   /* Packing widget */
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                 _("DTMF Mode"), 1, 1);



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