| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 using ::testing::_; | 58 using ::testing::_; |
| 59 using ::testing::SaveArg; | 59 using ::testing::SaveArg; |
| 60 | 60 |
| 61 namespace media { | 61 namespace media { |
| 62 | 62 |
| 63 namespace { | 63 namespace { |
| 64 | 64 |
| 65 class MockClient : public VideoCaptureDevice::Client { | 65 class MockClient : public VideoCaptureDevice::Client { |
| 66 public: | 66 public: |
| 67 MOCK_METHOD2(ReserveOutputBuffer, | 67 MOCK_METHOD2(ReserveOutputBuffer, |
| 68 scoped_refptr<Buffer>(VideoFrame::Format format, | 68 scoped_refptr<Buffer>(media::VideoPixelFormat format, |
| 69 const gfx::Size& dimensions)); | 69 const gfx::Size& dimensions)); |
| 70 MOCK_METHOD9(OnIncomingCapturedYuvData, | 70 MOCK_METHOD9(OnIncomingCapturedYuvData, |
| 71 void (const uint8* y_data, | 71 void (const uint8* y_data, |
| 72 const uint8* u_data, | 72 const uint8* u_data, |
| 73 const uint8* v_data, | 73 const uint8* v_data, |
| 74 size_t y_stride, | 74 size_t y_stride, |
| 75 size_t u_stride, | 75 size_t u_stride, |
| 76 size_t v_stride, | 76 size_t v_stride, |
| 77 const VideoCaptureFormat& frame_format, | 77 const VideoCaptureFormat& frame_format, |
| 78 int clockwise_rotation, | 78 int clockwise_rotation, |
| 79 const base::TimeTicks& timestamp)); | 79 const base::TimeTicks& timestamp)); |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 // Use PIXEL_FORMAT_MAX to iterate all device names for testing | 441 // Use PIXEL_FORMAT_MAX to iterate all device names for testing |
| 442 // GetDeviceSupportedFormats(). | 442 // GetDeviceSupportedFormats(). |
| 443 scoped_ptr<VideoCaptureDevice::Name> name = | 443 scoped_ptr<VideoCaptureDevice::Name> name = |
| 444 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); | 444 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); |
| 445 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here | 445 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here |
| 446 // since we cannot forecast the hardware capabilities. | 446 // since we cannot forecast the hardware capabilities. |
| 447 ASSERT_FALSE(name); | 447 ASSERT_FALSE(name); |
| 448 } | 448 } |
| 449 | 449 |
| 450 }; // namespace media | 450 }; // namespace media |
| OLD | NEW |