OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/capture/video/fake_video_capture_device.h" | 5 #include "media/capture/video/fake_video_capture_device.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 buffer_id, arbitrary_frame_feedback_id, | 95 buffer_id, arbitrary_frame_feedback_id, |
96 base::MakeUnique<StubBufferHandleProvider>(mapped_size, buffer), | 96 base::MakeUnique<StubBufferHandleProvider>(mapped_size, buffer), |
97 base::MakeUnique<StubReadWritePermission>(buffer)); | 97 base::MakeUnique<StubReadWritePermission>(buffer)); |
98 }; | 98 }; |
99 | 99 |
100 class MockClient : public VideoCaptureDevice::Client { | 100 class MockClient : public VideoCaptureDevice::Client { |
101 public: | 101 public: |
102 MOCK_METHOD2(OnError, | 102 MOCK_METHOD2(OnError, |
103 void(const tracked_objects::Location& from_here, | 103 void(const tracked_objects::Location& from_here, |
104 const std::string& reason)); | 104 const std::string& reason)); |
| 105 MOCK_METHOD0(OnStarted, void(void)); |
105 | 106 |
106 explicit MockClient(base::Callback<void(const VideoCaptureFormat&)> frame_cb) | 107 explicit MockClient(base::Callback<void(const VideoCaptureFormat&)> frame_cb) |
107 : frame_cb_(frame_cb) {} | 108 : frame_cb_(frame_cb) {} |
108 | 109 |
109 // Client virtual methods for capturing using Device Buffers. | 110 // Client virtual methods for capturing using Device Buffers. |
110 void OnIncomingCapturedData(const uint8_t* data, | 111 void OnIncomingCapturedData(const uint8_t* data, |
111 int length, | 112 int length, |
112 const VideoCaptureFormat& format, | 113 const VideoCaptureFormat& format, |
113 int rotation, | 114 int rotation, |
114 base::TimeTicks reference_time, | 115 base::TimeTicks reference_time, |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 INSTANTIATE_TEST_CASE_P( | 508 INSTANTIATE_TEST_CASE_P( |
508 , | 509 , |
509 FakeVideoCaptureDeviceCommandLineTest, | 510 FakeVideoCaptureDeviceCommandLineTest, |
510 Values(CommandLineTestData{"fps=-1", 5, 1u}, | 511 Values(CommandLineTestData{"fps=-1", 5, 1u}, |
511 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, | 512 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, |
512 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, | 513 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, |
513 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, | 514 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, |
514 CommandLineTestData{"device-count=2", 20, 2u}, | 515 CommandLineTestData{"device-count=2", 20, 2u}, |
515 CommandLineTestData{"device-count=0", 20, 1u})); | 516 CommandLineTestData{"device-count=0", 20, 1u})); |
516 }; // namespace media | 517 }; // namespace media |
OLD | NEW |