Index: content/browser/renderer_host/media/video_capture_manager.cc |
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc |
index e1830eed9fa09a7704246e7d7ac534ed97e5d574..fa4955d3186284d3db87113341a304d6df81cda0 100644 |
--- a/content/browser/renderer_host/media/video_capture_manager.cc |
+++ b/content/browser/renderer_host/media/video_capture_manager.cc |
@@ -1025,6 +1025,9 @@ void VideoCaptureManager::OnDevicesInfoEnumerated( |
for (const auto& it : devices_info_cache_) { |
devices.emplace_back(it.descriptor); |
descriptors_and_formats.emplace_back(it.descriptor, it.supported_formats); |
+ } |
+ |
+ if (!descriptors_and_formats.empty()) { |
MediaInternals::GetInstance()->UpdateVideoCaptureDeviceCapabilities( |
descriptors_and_formats); |
} |
@@ -1227,6 +1230,22 @@ void VideoCaptureManager::DoTakePhoto( |
base::Unretained(device), base::Passed(&callback))); |
} |
+bool VideoCaptureManager::GetCameraCalibration( |
+ const std::string& device_id, |
+ MediaStreamDevice::CameraCalibration* calibration) { |
+ VideoCaptureManager::DeviceInfo* info = GetDeviceInfoById(device_id); |
+ if (!info || !info->descriptor.camera_calibration) |
+ return false; |
+ calibration->valid = true; |
+ calibration->focal_length_x = |
+ info->descriptor.camera_calibration->focal_length_x; |
+ calibration->focal_length_y = |
+ info->descriptor.camera_calibration->focal_length_y; |
+ calibration->depth_near = info->descriptor.camera_calibration->depth_near; |
+ calibration->depth_far = info->descriptor.camera_calibration->depth_far; |
+ return true; |
+} |
+ |
#if defined(OS_ANDROID) |
void VideoCaptureManager::OnApplicationStateChange( |
base::android::ApplicationState state) { |