Bug 1369108 - 2. Refresh Android camera list when necessary; r=jesup
authorJim Chen <nchen@mozilla.com>
Fri, 02 Jun 2017 16:11:53 -0400
changeset 412631 54c93d5eb3089ed12163a7308edc003cdb41cf7a
parent 412630 483b253cdd73802d4de006eedc5a543b4339a3e7
child 412632 0a58469c18011216c9f1d0e052f6a0d9bf799543
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1369108
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1369108 - 2. Refresh Android camera list when necessary; r=jesup Currently, if permission is first denied, the list of cameras is empty. However, if permission is later granted, the list stays empty because we never try to refresh the list. This patch causes us to refresh the list when necessary. MozReview-Commit-ID: 5eodPCWVyaP
media/webrtc/trunk/webrtc/modules/video_capture/android/device_info_android.cc
--- a/media/webrtc/trunk/webrtc/modules/video_capture/android/device_info_android.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/android/device_info_android.cc
@@ -220,16 +220,17 @@ bool DeviceInfoAndroid::FindCameraIndex(
   return FindCameraIndexByName(deviceUniqueIdUTF8, index);
 }
 
 int32_t DeviceInfoAndroid::Init() {
   return 0;
 }
 
 uint32_t DeviceInfoAndroid::NumberOfDevices() {
+  Refresh();
   return g_camera_info->size();
 }
 
 int32_t DeviceInfoAndroid::GetDeviceName(
     uint32_t deviceNumber,
     char* deviceNameUTF8,
     uint32_t deviceNameLength,
     char* deviceUniqueIdUTF8,