Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2606983002: Media Capture Depth Stream Extensions API: focal length and depth range. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/capture/video/fake_video_capture_device_unittest.cc
diff --git a/media/capture/video/fake_video_capture_device_unittest.cc b/media/capture/video/fake_video_capture_device_unittest.cc
index c9bbae90f3372440cb93afc2c2722251a11ad8d6..258e8317029db2f7aeb9c77e701465aa9778697a 100644
--- a/media/capture/video/fake_video_capture_device_unittest.cc
+++ b/media/capture/video/fake_video_capture_device_unittest.cc
@@ -314,6 +314,22 @@ TEST_F(FakeVideoCaptureDeviceTest, GetDeviceSupportedFormats) {
}
}
+TEST_F(FakeVideoCaptureDeviceTest, GetCameraCalibration) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kUseFakeDeviceForMediaStream, "device-count=2");
+ std::unique_ptr<VideoCaptureDeviceDescriptors> descriptors(
+ EnumerateDevices());
+ ASSERT_EQ(2u, descriptors->size());
+ ASSERT_FALSE(descriptors->at(0).camera_calibration);
+ const VideoCaptureDeviceDescriptor& depth_device = descriptors->at(1);
+ EXPECT_EQ("/dev/video1", depth_device.device_id);
+ ASSERT_TRUE(depth_device.camera_calibration);
+ EXPECT_EQ(135.0, depth_device.camera_calibration->focal_length_x);
+ EXPECT_EQ(135.6, depth_device.camera_calibration->focal_length_y);
+ EXPECT_EQ(0.0, depth_device.camera_calibration->depth_near);
+ EXPECT_EQ(65.535, depth_device.camera_calibration->depth_far);
+}
+
TEST_F(FakeVideoCaptureDeviceTest, GetAndSetCapabilities) {
std::unique_ptr<VideoCaptureDevice> device(new FakeVideoCaptureDevice(
FakeVideoCaptureDevice::BufferOwnership::OWN_BUFFERS, 30.0));

Powered by Google App Engine
This is Rietveld 408576698