Index: media/capture/video/fake_video_capture_device_factory.cc |
diff --git a/media/capture/video/fake_video_capture_device_factory.cc b/media/capture/video/fake_video_capture_device_factory.cc |
index d20749c2723fc05483314e89352fbc691c48bd86..01b9658e61327a934fd0b605a9a0c2ba6074a4aa 100644 |
--- a/media/capture/video/fake_video_capture_device_factory.cc |
+++ b/media/capture/video/fake_video_capture_device_factory.cc |
@@ -15,11 +15,14 @@ |
namespace { |
+static const size_t kDepthDeviceIndex = 1; |
+static const char kDepthDeviceId[] = "/dev/video1"; |
+ |
// Factory has one device by default; I420. If there are more, the second device |
// is of Y16 format while the rest are I420. |
media::VideoPixelFormat GetPixelFormat(const std::string& device_id) { |
- return (device_id == "/dev/video1") ? media::PIXEL_FORMAT_Y16 |
- : media::PIXEL_FORMAT_I420; |
+ return (device_id == kDepthDeviceId) ? media::PIXEL_FORMAT_Y16 |
+ : media::PIXEL_FORMAT_I420; |
} |
} |
@@ -82,6 +85,18 @@ void FakeVideoCaptureDeviceFactory::GetDeviceDescriptors( |
#endif |
); |
} |
+ |
+ // Fill the camera calibration information for depth device. |
+ if (device_descriptors->size() > kDepthDeviceIndex) { |
mcasas
2017/01/05 01:09:32
if (device_descriptors < kDepthDeviceIndex)
re
aleksandar.stojiljkovic
2017/01/09 18:47:01
Done.
|
+ VideoCaptureDeviceDescriptor& depth_device( |
+ (*device_descriptors)[kDepthDeviceIndex]); |
+ depth_device.camera_calibration = |
+ new VideoCaptureDeviceDescriptor::CameraCalibration; |
+ depth_device.camera_calibration->focal_length_x = 135.0; |
+ depth_device.camera_calibration->focal_length_y = 135.6; |
+ depth_device.camera_calibration->depth_near = 0.0; |
+ depth_device.camera_calibration->depth_far = 65.535; |
+ } |
} |
void FakeVideoCaptureDeviceFactory::GetSupportedFormats( |