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

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: 80-char line fix in test html. Created 3 years, 10 months 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 e5975aa5da4659d5b561d7af87d6fab998ccdf1e..c128ad96d49fa74e7ca9cd68df5f9a20a6b8866b 100644
--- a/media/capture/video/fake_video_capture_device_unittest.cc
+++ b/media/capture/video/fake_video_capture_device_unittest.cc
@@ -347,6 +347,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));
« no previous file with comments | « media/capture/video/fake_video_capture_device_factory.cc ('k') | media/capture/video/video_capture_device_descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698