ekiga r6239 - in trunk: . lib/engine/audioinput/null lib/engine/audioinput/skel lib/engine/audiooutput/null lib/engine/audiooutput/skel src/devices



Author: mschneid
Date: Sun May  4 18:23:07 2008
New Revision: 6239
URL: http://svn.gnome.org/viewvc/ekiga?rev=6239&view=rev

Log:
Adjusted debug levels. Fix audio device to be able to be
closed in closed stayed.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp
   trunk/lib/engine/audioinput/skel/audioinput-core.cpp
   trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp
   trunk/lib/engine/audiooutput/skel/audiooutput-core.cpp
   trunk/src/devices/audiodev.cpp

Modified: trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp
==============================================================================
--- trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp	(original)
+++ trunk/lib/engine/audioinput/null/audioinput-manager-null.cpp	Sun May  4 18:23:07 2008
@@ -61,7 +61,7 @@
        ( audioinput_device.source == DEVICE_SOURCE) &&
        ( audioinput_device.device == DEVICE_DEVICE) ) {
 
-    PTRACE(4, "GMAudioInputManager_null\tSetting null device");
+    PTRACE(4, "GMAudioInputManager_null\tSetting Device " << audioinput_device.source << "/" <<  audioinput_device.device);
     current_state.audioinput_device = audioinput_device;
     return true;
   }

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 18:23:07 2008
@@ -197,7 +197,7 @@
      for (std::vector<AudioInputDevice>::iterator iter = audioinput_devices.begin ();
          iter != audioinput_devices.end ();
          iter++) {
-      PTRACE(0, "AudioInputCore\tDetected Device: " << iter->type << "/" << iter->source << "/" << iter->device);
+      PTRACE(4, "AudioInputCore\tDetected Device: " << iter->type << "/" << iter->source << "/" << iter->device);
     }
   }
 
@@ -217,10 +217,10 @@
 {
   PWaitAndSignal m(var_mutex);
 
-  PTRACE(0, "AudioInputCore\tStarting preview " << channels << "x" << samplerate << "/" << bits_per_sample);
+  PTRACE(4, "AudioInputCore\tStarting preview " << channels << "x" << samplerate << "/" << bits_per_sample);
 
   if (preview_config.active || stream_config.active) {
-    PTRACE(0, "AudioInputCore\tTrying to start preview in wrong state");
+    PTRACE(1, "AudioInputCore\tTrying to start preview in wrong state");
   }
 
   internal_open(channels, samplerate, bits_per_sample);
@@ -243,10 +243,10 @@
 {
   PWaitAndSignal m(var_mutex);
 
-  PTRACE(0, "AudioInputCore\tStopping Preview");
+  PTRACE(4, "AudioInputCore\tStopping Preview");
 
   if (!preview_config.active || stream_config.active) {
-    PTRACE(0, "AudioInputCore\tTrying to stop preview in wrong state");
+    PTRACE(1, "AudioInputCore\tTrying to stop preview in wrong state");
   }
 
 //     preview_manager.stop();
@@ -260,7 +260,7 @@
 {
   PWaitAndSignal m(var_mutex);
 
-  PTRACE(0, "AudioInputCore\tSetting stream buffer size " << num_buffers << "/" << buffer_size);
+  PTRACE(4, "AudioInputCore\tSetting stream buffer size " << num_buffers << "/" << buffer_size);
 
   if (current_manager)
     current_manager->set_buffer_size(buffer_size, num_buffers);
@@ -273,10 +273,10 @@
 {
   PWaitAndSignal m(var_mutex);
 
-  PTRACE(0, "AudioInputCore\tStarting stream " << channels << "x" << samplerate << "/" << bits_per_sample);
+  PTRACE(4, "AudioInputCore\tStarting stream " << channels << "x" << samplerate << "/" << bits_per_sample);
 
   if (preview_config.active || stream_config.active) {
-    PTRACE(0, "AudioInputCore\tTrying to start stream in wrong state");
+    PTRACE(1, "AudioInputCore\tTrying to start stream in wrong state");
   }
 
   internal_open(channels, samplerate, bits_per_sample);
@@ -293,10 +293,10 @@
 {
   PWaitAndSignal m(var_mutex);
 
-  PTRACE(0, "AudioInputCore\tStopping Stream");
+  PTRACE(4, "AudioInputCore\tStopping Stream");
 
   if (preview_config.active || !stream_config.active) {
-    PTRACE(0, "AudioInputCore\tTrying to stop stream in wrong state");
+    PTRACE(1, "AudioInputCore\tTrying to stop stream in wrong state");
     return;
   }
 
@@ -371,7 +371,7 @@
 
 void AudioInputCore::internal_set_audioinput_device(const AudioInputDevice & audioinput_device)
 {
-  PTRACE(0, "AudioInputCore\tSetting device: " << audioinput_device.type << "/" << audioinput_device.source << "/" << audioinput_device.device);
+  PTRACE(4, "AudioInputCore\tSetting device: " << audioinput_device.type << "/" << audioinput_device.source << "/" << audioinput_device.device);
 
   if (preview_config.active)
     preview_manager.stop();
@@ -404,7 +404,7 @@
 
 void AudioInputCore::internal_open (unsigned channels, unsigned samplerate, unsigned bits_per_sample)
 {
-  PTRACE(0, "AudioInputCore\tOpening device with " << channels << "-" << samplerate << "/" << bits_per_sample );
+  PTRACE(4, "AudioInputCore\tOpening device with " << channels << "-" << samplerate << "/" << bits_per_sample );
 
   if (current_manager && !current_manager->open(channels, samplerate, bits_per_sample)) {
 
@@ -441,7 +441,7 @@
 
 void AudioInputCore::internal_close()
 {
-  PTRACE(0, "AudioInputCore\tClosing current device");
+  PTRACE(4, "AudioInputCore\tClosing current device");
   if (current_manager)
     current_manager->close();
 }

Modified: trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp
==============================================================================
--- trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp	(original)
+++ trunk/lib/engine/audiooutput/null/audiooutput-manager-null.cpp	Sun May  4 18:23:07 2008
@@ -63,7 +63,7 @@
        ( audiooutput_device.source == DEVICE_SOURCE) &&
        ( audiooutput_device.device == DEVICE_DEVICE) ) {
 
-    PTRACE(4, "GMAudioOutputManager_null\tSetting null device");
+    PTRACE(4, "GMAudioOutputManager_null\tSetting Device[" << primarySecondary << "] " << audiooutput_device.source << "/" <<  audiooutput_device.device);
     current_state[primarySecondary].audiooutput_device = audiooutput_device;
     return true;
   }

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 18:23:07 2008
@@ -147,7 +147,7 @@
      for (std::vector<AudioOutputDevice>::iterator iter = audiooutput_devices.begin ();
          iter != audiooutput_devices.end ();
          iter++) {
-      PTRACE(0, "AudioOutputCore\tDetected Device: " << iter->type << "/" << iter->source << "/" << iter->device);
+      PTRACE(4, "AudioOutputCore\tDetected Device: " << iter->type << "/" << iter->source << "/" << iter->device);
     }
   }
 
@@ -155,7 +155,7 @@
 
 void AudioOutputCore::set_audiooutput_device(AudioOutputPrimarySecondary primarySecondary, const AudioOutputDevice & audiooutput_device)
 {
-  PTRACE(0, "AudioOutputCore\tSetting device[" << primarySecondary << "]: " << audiooutput_device.type << "/" << audiooutput_device.source << "/" << audiooutput_device.device);
+  PTRACE(4, "AudioOutputCore\tSetting device[" << primarySecondary << "]: " << audiooutput_device.type << "/" << audiooutput_device.source << "/" << audiooutput_device.device);
 
   PWaitAndSignal m_sec(var_mutex[secondary]);
 
@@ -255,19 +255,18 @@
 
 void AudioOutputCore::play_buffer(AudioOutputPrimarySecondary primarySecondary, char* buffer, unsigned long len, unsigned channels, unsigned sample_rate, unsigned bps)
 {
-PTRACE(0, "Play buffer " << primarySecondary);
   switch (primarySecondary) {
     case primary:
       var_mutex[primary].Wait();
 
       if (!current_manager[primary]) {
-        PTRACE(0, "AudioOutputCore\tDropping sound event, primary manager not set");
+        PTRACE(1, "AudioOutputCore\tDropping sound event, primary manager not set");
         var_mutex[primary].Signal();
         return;
       }
 
       if (current_primary_config.active) {
-        PTRACE(0, "AudioOutputCore\tDropping sound event, primary device not set");
+        PTRACE(1, "AudioOutputCore\tDropping sound event, primary device not set");
         var_mutex[primary].Signal();
         return;
       }
@@ -284,7 +283,7 @@
         }
         else {
           var_mutex[secondary].Signal();
-          PTRACE(0, "AudioOutputCore\tNo secondary audiooutput device defined, trying primary");
+          PTRACE(1, "AudioOutputCore\tNo secondary audiooutput device defined, trying primary");
           play_buffer(primary, buffer, len, channels, sample_rate, bps);
         }
       break;
@@ -368,7 +367,7 @@
 
 bool AudioOutputCore::internal_open (AudioOutputPrimarySecondary primarySecondary, unsigned channels, unsigned samplerate, unsigned bits_per_sample)
 {
-  PTRACE(0, "AudioOutputCore\tOpening device["<<primarySecondary<<"] with " << channels<< "-" << samplerate << "/" << bits_per_sample);
+  PTRACE(4, "AudioOutputCore\tOpening device["<<primarySecondary<<"] with " << channels<< "-" << samplerate << "/" << bits_per_sample);
 
   if (!current_manager[primarySecondary]) {
     PTRACE(1, "AudioOutputCore\tUnable to obtain current manager for device["<<primarySecondary<<"]");
@@ -392,7 +391,7 @@
 
 void AudioOutputCore::internal_close(AudioOutputPrimarySecondary primarySecondary)
 {
-  PTRACE(0, "AudioOutputCore\tClosing current device");
+  PTRACE(4, "AudioOutputCore\tClosing current device");
   if (current_manager[primarySecondary])
     current_manager[primarySecondary]->close(primarySecondary);
 }
@@ -402,7 +401,6 @@
   unsigned long pos = 0;
   unsigned written = 0;
 
-  PTRACE(0, "AudioOutputCore\tinternal_play");
   if (!internal_open ( primarySecondary, channels, sample_rate, bps))
     return;
 

Modified: trunk/src/devices/audiodev.cpp
==============================================================================
--- trunk/src/devices/audiodev.cpp	(original)
+++ trunk/src/devices/audiodev.cpp	Sun May  4 18:23:07 2008
@@ -137,6 +137,9 @@
 
 bool PSoundChannel_EKIGA::Close()
 {
+  if (opened == false)
+    return true;
+
   if (direction == Recorder) {
     audioinput_core.stop_stream();
   }



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