| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/renderer_host/media/desktop_capture_device.h" | 5 #include "content/browser/renderer_host/media/desktop_capture_device.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/sequenced_task_runner.h" | 8 #include "base/sequenced_task_runner.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 class MockDeviceClient : public media::VideoCaptureDevice::Client { | 41 class MockDeviceClient : public media::VideoCaptureDevice::Client { |
| 42 public: | 42 public: |
| 43 MOCK_METHOD2(ReserveOutputBuffer, | 43 MOCK_METHOD2(ReserveOutputBuffer, |
| 44 scoped_refptr<Buffer>(media::VideoFrame::Format format, | 44 scoped_refptr<Buffer>(media::VideoFrame::Format format, |
| 45 const gfx::Size& dimensions)); | 45 const gfx::Size& dimensions)); |
| 46 MOCK_METHOD0(OnError, void()); | 46 MOCK_METHOD0(OnError, void()); |
| 47 MOCK_METHOD5(OnIncomingCapturedFrame, | 47 MOCK_METHOD5(OnIncomingCapturedFrame, |
| 48 void(const uint8* data, | 48 void(const uint8* data, |
| 49 int length, | 49 int length, |
| 50 base::Time timestamp, | 50 base::TimeTicks timestamp, |
| 51 int rotation, | 51 int rotation, |
| 52 const media::VideoCaptureFormat& frame_format)); | 52 const media::VideoCaptureFormat& frame_format)); |
| 53 MOCK_METHOD5(OnIncomingCapturedBuffer, | 53 MOCK_METHOD5(OnIncomingCapturedBuffer, |
| 54 void(const scoped_refptr<Buffer>& buffer, | 54 void(const scoped_refptr<Buffer>& buffer, |
| 55 media::VideoFrame::Format format, | 55 media::VideoFrame::Format format, |
| 56 const gfx::Size& dimensions, | 56 const gfx::Size& dimensions, |
| 57 base::Time timestamp, | 57 base::TimeTicks timestamp, |
| 58 int frame_rate)); | 58 int frame_rate)); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 // DesktopFrame wrapper that flips wrapped frame upside down by inverting | 61 // DesktopFrame wrapper that flips wrapped frame upside down by inverting |
| 62 // stride. | 62 // stride. |
| 63 class InvertedDesktopFrame : public webrtc::DesktopFrame { | 63 class InvertedDesktopFrame : public webrtc::DesktopFrame { |
| 64 public: | 64 public: |
| 65 // Takes ownership of |frame|. | 65 // Takes ownership of |frame|. |
| 66 InvertedDesktopFrame(webrtc::DesktopFrame* frame) | 66 InvertedDesktopFrame(webrtc::DesktopFrame* frame) |
| 67 : webrtc::DesktopFrame( | 67 : webrtc::DesktopFrame( |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 capture_device.StopAndDeAllocate(); | 270 capture_device.StopAndDeAllocate(); |
| 271 | 271 |
| 272 EXPECT_EQ(kTestFrameWidth1, format.frame_size.width()); | 272 EXPECT_EQ(kTestFrameWidth1, format.frame_size.width()); |
| 273 EXPECT_EQ(kTestFrameHeight1, format.frame_size.height()); | 273 EXPECT_EQ(kTestFrameHeight1, format.frame_size.height()); |
| 274 EXPECT_EQ(kFrameRate, format.frame_rate); | 274 EXPECT_EQ(kFrameRate, format.frame_rate); |
| 275 EXPECT_EQ(media::PIXEL_FORMAT_ARGB, format.pixel_format); | 275 EXPECT_EQ(media::PIXEL_FORMAT_ARGB, format.pixel_format); |
| 276 worker_pool_->FlushForTesting(); | 276 worker_pool_->FlushForTesting(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace content | 279 } // namespace content |
| OLD | NEW |