Bug 1063547 - Return no available devices where not supported, disable on Android. r=jesup, a=lmandel
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Tue, 09 Sep 2014 18:18:12 +0200
changeset 216724 abbbaa040046
parent 216723 5b7a15b4fee2
child 216725 5982da7a1215
push id3891
push userryanvm@gmail.com
push date2014-09-15 14:22 +0000
treeherdermozilla-beta@5982da7a1215 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lmandel
bugs1063547
milestone33.0
Bug 1063547 - Return no available devices where not supported, disable on Android. r=jesup, a=lmandel
media/webrtc/trunk/webrtc/video_engine/vie_input_manager.cc
modules/libpref/src/init/all.js
--- a/media/webrtc/trunk/webrtc/video_engine/vie_input_manager.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_input_manager.cc
@@ -58,17 +58,18 @@ void ViEInputManager::SetModuleProcessTh
   assert(!module_process_thread_);
   module_process_thread_ = module_process_thread;
 }
 
 int ViEInputManager::NumberOfCaptureDevices() {
   WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s",
                __FUNCTION__);
   CriticalSectionScoped cs(device_info_cs_.get());
-  GetDeviceInfo();
+  if (!GetDeviceInfo())
+    return 0;
   assert(capture_device_info_);
   capture_device_info_->Refresh();
   return capture_device_info_->NumberOfDevices();
 }
 
 int ViEInputManager::GetDeviceName(uint32_t device_number,
                                    char* device_nameUTF8,
                                    uint32_t device_name_length,
@@ -85,17 +86,18 @@ int ViEInputManager::GetDeviceName(uint3
                                              device_unique_idUTF8Length);
 }
 
 int ViEInputManager::NumberOfCaptureCapabilities(
   const char* device_unique_idUTF8) {
   WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(engine_id_), "%s",
                __FUNCTION__);
   CriticalSectionScoped cs(device_info_cs_.get());
-  GetDeviceInfo();
+  if (!GetDeviceInfo())
+    return 0;
   assert(capture_device_info_);
   return capture_device_info_->NumberOfCapabilities(device_unique_idUTF8);
 }
 
 int ViEInputManager::GetCaptureCapability(
     const char* device_unique_idUTF8,
     const uint32_t device_capability_number,
     CaptureCapability& capability) {
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -355,23 +355,22 @@ pref("media.navigator.hardware.vp8_decod
 #elif defined(XP_LINUX)
 pref("media.peerconnection.capture_delay", 70);
 pref("media.getusermedia.playout_delay", 50);
 #else
 // *BSD, others - merely a guess for now
 pref("media.peerconnection.capture_delay", 50);
 pref("media.getusermedia.playout_delay", 50);
 #endif
-#else
-#ifdef ANDROID
-pref("media.navigator.enabled", true);
 #endif
+
+#if !defined(ANDROID)
+pref("media.getusermedia.screensharing.enabled", true);
 #endif
 
-pref("media.getusermedia.screensharing.enabled", true);
 #ifdef RELEASE_BUILD
 pref("media.getusermedia.screensharing.allowed_domains", "");
 #else
 // temporary value, not intended for release - bug 1049087
 pref("media.getusermedia.screensharing.allowed_domains", "mozilla.github.io");
 #endif
 
 // TextTrack support