ekiga r6238 - in trunk: . lib/engine/audioinput/skel lib/engine/audiooutput/skel lib/engine/hal/skel lib/engine/vidinput/skel src/gui



Author: mschneid
Date: Sun May  4 08:50:15 2008
New Revision: 6238
URL: http://svn.gnome.org/viewvc/ekiga?rev=6238&view=rev

Log:
HAL documentation and slight interface change.
Allow bitrates of up to 10 mbit/s.



Modified:
   trunk/ChangeLog
   trunk/lib/engine/audioinput/skel/audioinput-core.cpp
   trunk/lib/engine/audioinput/skel/audioinput-core.h
   trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp
   trunk/lib/engine/audiooutput/skel/audiooutput-core.h
   trunk/lib/engine/hal/skel/hal-core.cpp
   trunk/lib/engine/hal/skel/hal-core.h
   trunk/lib/engine/hal/skel/hal-manager.h
   trunk/lib/engine/vidinput/skel/vidinput-core.cpp
   trunk/lib/engine/vidinput/skel/vidinput-core.h
   trunk/src/gui/preferences.cpp

Modified: trunk/lib/engine/audioinput/skel/audioinput-core.cpp
==============================================================================
--- trunk/lib/engine/audioinput/skel/audioinput-core.cpp	(original)
+++ trunk/lib/engine/audioinput/skel/audioinput-core.cpp	Sun May  4 08:50:15 2008
@@ -473,7 +473,7 @@
     internal_set_device (current_device);
 }
 
-void AudioInputCore::add_device (std::string & source, std::string & device, HalManager* /*manager*/)
+void AudioInputCore::add_device (const std::string & source, const std::string & device, HalManager* /*manager*/)
 {
   PTRACE(0, "AudioInputCore\tAdding Device " << device);
   PWaitAndSignal m(var_mutex);
@@ -495,7 +495,7 @@
   }
 }
 
-void AudioInputCore::remove_device (std::string & source, std::string & device, HalManager* /*manager*/)
+void AudioInputCore::remove_device (const std::string & source, const std::string & device, HalManager* /*manager*/)
 {
   PTRACE(0, "AudioInputCore\tRemoving Device " << device);
   PWaitAndSignal m(var_mutex);

Modified: trunk/lib/engine/audioinput/skel/audioinput-core.h
==============================================================================
--- trunk/lib/engine/audioinput/skel/audioinput-core.h	(original)
+++ trunk/lib/engine/audioinput/skel/audioinput-core.h	Sun May  4 08:50:15 2008
@@ -173,8 +173,8 @@
 
       float get_average_level () { return average_level; }
 
-      void add_device (std::string & source, std::string & device, HalManager* manager);
-      void remove_device (std::string & source, std::string & device, HalManager* manager);
+      void add_device (const std::string & source, const std::string & device, HalManager* manager);
+      void remove_device (const std::string & source, const std::string & device, HalManager* manager);
 
       /*** VidInput Related Signals ***/
       

Modified: trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp
==============================================================================
--- trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp	(original)
+++ trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp	Sun May  4 08:50:15 2008
@@ -454,7 +454,7 @@
   internal_set_device(primary, current_device[primary]);
 }
 
-void AudioOutputCore::add_device (std::string & sink, std::string & device, HalManager* /*manager*/)
+void AudioOutputCore::add_device (const std::string & sink, const std::string & device, HalManager* /*manager*/)
 {
   PTRACE(0, "AudioOutputCore\tAdding Device " << device);
   PWaitAndSignal m_pri(var_mutex[primary]);
@@ -476,7 +476,7 @@
   }
 }
 
-void AudioOutputCore::remove_device (std::string & sink, std::string & device, HalManager* /*manager*/)
+void AudioOutputCore::remove_device (const std::string & sink, const std::string & device, HalManager* /*manager*/)
 {
   PTRACE(0, "AudioOutputCore\tRemoving Device " << device);
   PWaitAndSignal m_pri(var_mutex[primary]);

Modified: trunk/lib/engine/audiooutput/skel/audiooutput-core.h
==============================================================================
--- trunk/lib/engine/audiooutput/skel/audiooutput-core.h	(original)
+++ trunk/lib/engine/audiooutput/skel/audiooutput-core.h	Sun May  4 08:50:15 2008
@@ -159,8 +159,8 @@
 
       float get_average_level () { return average_level; }
       
-      void add_device (std::string & sink, std::string & device, HalManager* manager);
-      void remove_device (std::string & sink, std::string & device, HalManager* manager);
+      void add_device (const std::string & sink, const std::string & device, HalManager* manager);
+      void remove_device (const std::string & sink, const std::string & device, HalManager* manager);
 		  
       /*** VidInput Related Signals ***/
       

Modified: trunk/lib/engine/hal/skel/hal-core.cpp
==============================================================================
--- trunk/lib/engine/hal/skel/hal-core.cpp	(original)
+++ trunk/lib/engine/hal/skel/hal-core.cpp	Sun May  4 08:50:15 2008
@@ -86,34 +86,34 @@
       go_on = visitor (*(*iter));
 }
 
-void HalCore::on_video_input_device_added (std::string & source, std::string & device, unsigned capabilities, HalManager* manager) {
+void HalCore::on_video_input_device_added (std::string source, std::string device, unsigned capabilities, HalManager* manager) {
   video_input_device_added.emit (source, device, capabilities, manager);
 }
 
-void HalCore::on_video_input_device_removed (std::string & source, std::string & device, unsigned capabilities, HalManager* manager) {
+void HalCore::on_video_input_device_removed (std::string source, std::string device, unsigned capabilities, HalManager* manager) {
   video_input_device_removed.emit (source, device, capabilities, manager);
 }
 
-void HalCore::on_audio_input_device_added (std::string & source, std::string & device, HalManager* manager) {
+void HalCore::on_audio_input_device_added (std::string source, std::string device, HalManager* manager) {
   audio_input_device_added.emit (source, device, manager);
 }
 
-void HalCore::on_audio_input_device_removed (std::string & source, std::string & device, HalManager* manager) {
+void HalCore::on_audio_input_device_removed (std::string source, std::string device, HalManager* manager) {
   audio_input_device_removed.emit (source, device, manager);
 }
 
-void HalCore::on_audio_output_device_added (std::string & sink, std::string & device, HalManager* manager) {
+void HalCore::on_audio_output_device_added (std::string sink, std::string device, HalManager* manager) {
   audio_output_device_added.emit (sink, device, manager);
 }
 
-void HalCore::on_audio_output_device_removed (std::string & sink, std::string & device, HalManager* manager) {
+void HalCore::on_audio_output_device_removed (std::string sink, std::string device, HalManager* manager) {
   audio_output_device_removed.emit (sink, device, manager);
 }
 
-void HalCore::on_network_interface_up (std::string & interface_name, std::string & ip4_address, HalManager* manager) {
+void HalCore::on_network_interface_up (std::string interface_name, std::string ip4_address, HalManager* manager) {
   network_interface_up.emit (interface_name, ip4_address, manager);
 }
 
-void HalCore::on_network_interface_down (std::string & interface_name, std::string & ip4_address, HalManager* manager) {
+void HalCore::on_network_interface_down (std::string interface_name, std::string ip4_address, HalManager* manager) {
   network_interface_down.emit (interface_name,ip4_address, manager);
 }

Modified: trunk/lib/engine/hal/skel/hal-core.h
==============================================================================
--- trunk/lib/engine/hal/skel/hal-core.h	(original)
+++ trunk/lib/engine/hal/skel/hal-core.h	Sun May  4 08:50:15 2008
@@ -30,7 +30,8 @@
  *   begin                : written in 2008 by Matthias Schneider
  *   copyright            : (c) 2008 by Matthias Schneider
  *   description          : Declaration of the interface of a hal core.
- *                          A hal core manages HalManagers.
+ *                          A hal core manages hal managers and abstracts 
+ *                          their platform specific implementation.
  *
  */
 
@@ -50,13 +51,20 @@
 namespace Ekiga
 {
 /**
- * @defgroup hal
+ * @defgroup hal Hal HAL
  * @{
  */
 
   class HalManager;
 
   /** Core object for hal support
+
+      The hal core is used to abstract platform-specific hardware abstraction layer
+      managers. It will emit signals when interesting devices and are added to or
+      removed from the system or when network devices come up or go down.
+
+      Threads: The callbacks will always be passed back to the main thread,
+               independent from the actual manager runs in a separate thread or not.
    */
   class HalCore
     : public Service
@@ -72,6 +80,7 @@
       */
       ~HalCore ();
 
+
       /*** Service Implementation ***/
 
       /** Returns the name of the service.
@@ -80,14 +89,15 @@
       const std::string get_name () const
         { return "hal-core"; }
 
-
       /** Returns the description of the service.
        * @return The service description.
        */
       const std::string get_description () const
-        { return "\tHal Core managing Hal Manager objects"; }
+        { return "\tHardware abstraction layer core"; }
 
 
+      /*** API to list HalManagers ***/
+
       /** Adds a HalManager to the HalCore service.
        * @param The manager to be added.
        */
@@ -95,41 +105,46 @@
 
       /** Triggers a callback for all Ekiga::HalManager sources of the
        * HalCore service.
+       * @param The callback (the return value means "go on" and allows
+       *  stopping the visit)
        */
        void visit_managers (sigc::slot<bool, HalManager &> visitor);
 
-      /** This signal is emitted when a Ekiga::HalManager has been
+      /** This signal is emitted when an Ekiga::HalManager has been
        * added to the HalCore Service.
        */
        sigc::signal<void, HalManager &> manager_added;
 
+
+      /*** API to act on HAL events ***/
+
       /** See hal-manager.h for the API
        */
-      sigc::signal<void, std::string &, std::string &, unsigned, HalManager*> video_input_device_added;
-      sigc::signal<void, std::string &, std::string &, unsigned, HalManager*> video_input_device_removed;
+      sigc::signal<void, const std::string &, const std::string &, unsigned, HalManager*> video_input_device_added;
+      sigc::signal<void, const std::string &, const std::string &, unsigned, HalManager*> video_input_device_removed;
 
-      sigc::signal<void, std::string &, std::string &, HalManager*> audio_input_device_added;
-      sigc::signal<void, std::string &, std::string &, HalManager*> audio_input_device_removed;
+      sigc::signal<void, const std::string &, const std::string &, HalManager*> audio_input_device_added;
+      sigc::signal<void, const std::string &, const std::string &, HalManager*> audio_input_device_removed;
 
-      sigc::signal<void, std::string &, std::string &, HalManager*> audio_output_device_added;
-      sigc::signal<void, std::string &, std::string &, HalManager*> audio_output_device_removed;
+      sigc::signal<void, const std::string &, const std::string &, HalManager*> audio_output_device_added;
+      sigc::signal<void, const std::string &, const std::string &, HalManager*> audio_output_device_removed;
 
-      sigc::signal<void, std::string &, std::string &, HalManager*> network_interface_up;
-      sigc::signal<void, std::string &, std::string &, HalManager*> network_interface_down;
+      sigc::signal<void, const std::string &, const std::string &, HalManager*> network_interface_up;
+      sigc::signal<void, const std::string &, const std::string &, HalManager*> network_interface_down;
 
   private:
 
-      void on_video_input_device_added (std::string & source, std::string & device, unsigned capabilities, HalManager* manager);
-      void on_video_input_device_removed (std::string & source, std::string & device, unsigned capabilities, HalManager* manager);
+      void on_video_input_device_added (std::string source, std::string device, unsigned capabilities, HalManager* manager);
+      void on_video_input_device_removed (std::string source, std::string device, unsigned capabilities, HalManager* manager);
 
-      void on_audio_input_device_added (std::string & source, std::string & device, HalManager* manager);
-      void on_audio_input_device_removed (std::string & source, std::string & device, HalManager* manager);
+      void on_audio_input_device_added (std::string source, std::string device, HalManager* manager);
+      void on_audio_input_device_removed (std::string source, std::string device, HalManager* manager);
 
-      void on_audio_output_device_added (std::string & sink, std::string & device, HalManager* manager);
-      void on_audio_output_device_removed (std::string & sink, std::string & device, HalManager* manager);
+      void on_audio_output_device_added (std::string sink, std::string device, HalManager* manager);
+      void on_audio_output_device_removed (std::string sink, std::string device, HalManager* manager);
 
-      void on_network_interface_up (std::string & interface_name, std::string & ip4_address, HalManager* manager);
-      void on_network_interface_down (std::string & interface_name, std::string & ip4_address, HalManager* manager);
+      void on_network_interface_up (std::string interface_name, std::string ip4_address, HalManager* manager);
+      void on_network_interface_down (std::string interface_name, std::string ip4_address, HalManager* manager);
 
       std::set<HalManager *> managers;
 

Modified: trunk/lib/engine/hal/skel/hal-manager.h
==============================================================================
--- trunk/lib/engine/hal/skel/hal-manager.h	(original)
+++ trunk/lib/engine/hal/skel/hal-manager.h	Sun May  4 08:50:15 2008
@@ -62,30 +62,59 @@
       ~HalManager () {}
 
 
-      /*                 
-       * VIDINOUT MANAGEMENT 
-       */               
+      /*** API to act on HAL events ***/
 
-      /** Create a call based on the remote uri given as parameter
-       * @param uri  an uri
-       * @return     true if a Ekiga::Call could be created
+      /** This signal is emitted when a video input device is added to the system
+       * @param: source         : the video input framework (e.g. video4linux, etc.)
+       *         device         : the device name
+       *         capabilities   : source-dependent device capabilites (e.g. V4L1 or V4L2 for video4linux)
        */
+      sigc::signal<void, std::string, std::string, unsigned> video_input_device_added;
 
-      sigc::signal<void, std::string&, std::string&, unsigned> video_input_device_added;
-      sigc::signal<void, std::string&, std::string&, unsigned> video_input_device_removed;
+      /** This signal is emitted when a video input device is removed from the system
+       * @param: source         : the video input framework (e.g. video4linux, etc.)
+       *         device         : the device name
+       *         capabilities   : source-dependent device capabilites (e.g. V4L1 or V4L2 for video4linux)
+       */
+      sigc::signal<void, std::string, std::string, unsigned> video_input_device_removed;
 
-      sigc::signal<void, std::string&, std::string&> audio_input_device_added;
-      sigc::signal<void, std::string&, std::string&> audio_input_device_removed;
+      /** This signal is emitted when an audio input device is added to the system
+       * @param: source         : the audio input framework (e.g. alsa, oss, etc.)
+       *         device         : the device name
+       */
+      sigc::signal<void, std::string, std::string> audio_input_device_added;
 
-      sigc::signal<void, std::string&, std::string&> audio_output_device_added;
-      sigc::signal<void, std::string&, std::string&> audio_output_device_removed;
+      /** This signal is emitted when an audio input device is removed from the system
+       * @param: source         : the audio input framework (e.g. alsa, oss, etc.)
+       *         device         : the device name
+       */
+      sigc::signal<void, std::string, std::string> audio_input_device_removed;
 
-      sigc::signal<void, std::string&, std::string&> network_interface_up;
-      sigc::signal<void, std::string&, std::string&> network_interface_down;
+      /** This signal is emitted when an audio output device is added to the system
+       * @param: source         : the audio output framework (e.g. alsa, oss, etc.)
+       *         device         : the device name
+       */
+      sigc::signal<void, std::string, std::string> audio_output_device_added;
 
-  protected:  
+      /** This signal is emitted when an audio output device is removed from the system
+       * @param: source         : the audio output framework (e.g. alsa, oss, etc.)
+       *         device         : the device name
+       */
+      sigc::signal<void, std::string, std::string> audio_output_device_removed;
 
+      /** This signal is emitted when a network device comes up
+       * @param: interface_name : The interface name (e.g. eth0, etc.)
+       *         ip4_address    : The IPv4 address (e.g. "192.168.0.1")
+       */
+      sigc::signal<void, std::string, std::string> network_interface_up;
+
+      /** This signal is emitted when a network device goes down
+       * @param: interface_name : The interface name (e.g. eth0, etc.)
+       *         ip4_address    : The IPv4 address (e.g. "192.168.0.1")
+       */
+      sigc::signal<void, std::string, std::string> network_interface_down;
   };
+
 /**
  * @}
  */

Modified: trunk/lib/engine/vidinput/skel/vidinput-core.cpp
==============================================================================
--- trunk/lib/engine/vidinput/skel/vidinput-core.cpp	(original)
+++ trunk/lib/engine/vidinput/skel/vidinput-core.cpp	Sun May  4 08:50:15 2008
@@ -546,7 +546,7 @@
   internal_set_device(current_device, current_channel, current_format);
 }
 
-void VidInputCore::add_device (std::string & source, std::string & device, unsigned capabilities, HalManager* /*manager*/)
+void VidInputCore::add_device (const std::string & source, const std::string & device, unsigned capabilities, HalManager* /*manager*/)
 {
   PTRACE(0, "VidInputCore\tAdding Device " << device);
   PWaitAndSignal m(var_mutex);
@@ -568,7 +568,7 @@
   }
 }
 
-void VidInputCore::remove_device (std::string & source, std::string & device, unsigned capabilities, HalManager* /*manager*/)
+void VidInputCore::remove_device (const std::string & source, const std::string & device, unsigned capabilities, HalManager* /*manager*/)
 {
   PTRACE(0, "VidInputCore\tRemoving Device " << device);
   PWaitAndSignal m(var_mutex);

Modified: trunk/lib/engine/vidinput/skel/vidinput-core.h
==============================================================================
--- trunk/lib/engine/vidinput/skel/vidinput-core.h	(original)
+++ trunk/lib/engine/vidinput/skel/vidinput-core.h	Sun May  4 08:50:15 2008
@@ -176,8 +176,8 @@
       void set_whiteness  (unsigned whiteness);
       void set_contrast   (unsigned contrast);
 
-      void add_device (std::string & source, std::string & device, unsigned capabilities, HalManager* manager);
-      void remove_device (std::string & source, std::string & device, unsigned capabilities, HalManager* manager);
+      void add_device (const std::string & source, const std::string & device, unsigned capabilities, HalManager* manager);
+      void remove_device (const std::string & source, const std::string & device, unsigned capabilities, HalManager* manager);
 
       /*** VidInput Related Signals ***/
       

Modified: trunk/src/gui/preferences.cpp
==============================================================================
--- trunk/src/gui/preferences.cpp	(original)
+++ trunk/src/gui/preferences.cpp	Sun May  4 08:50:15 2008
@@ -1083,7 +1083,7 @@
   /* Translators: the full sentence is Keep a minimum video quality of X % */
   gnome_prefs_scale_new (subsection, _("Picture Quality"), _("Frame Rate"), VIDEO_CODECS_KEY "temporal_spatial_tradeoff", _("Choose if you want to favour frame rate or quality for the transmitted video."), 0.0, 32.0, 1.0, 2);
 
-  gnome_prefs_spin_new (subsection, _("Maximum video _bitrate (in kbits/s):"), VIDEO_CODECS_KEY "maximum_video_tx_bitrate", _("The maximum video bitrate in kbits/s. The video quality and the number of transmitted frames per second (depends on codec) will be dynamically adjusted above their minimum during calls to try to minimize the bandwidth to the given value."), 16.0, 2048.0, 1.0, 1, NULL, true);
+  gnome_prefs_spin_new (subsection, _("Maximum video _bitrate (in kbits/s):"), VIDEO_CODECS_KEY "maximum_video_tx_bitrate", _("The maximum video bitrate in kbits/s. The video quality and the number of transmitted frames per second (depends on codec) will be dynamically adjusted above their minimum during calls to try to minimize the bandwidth to the given value."), 16.0, 10240.0, 1.0, 1, NULL, true);
 
 }
 



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