| 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/media/capture/desktop_capture_device.h" | 5 #include "content/browser/media/capture/desktop_capture_device.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 size_t v_stride, | 71 size_t v_stride, |
| 72 const media::VideoCaptureFormat& frame_format, | 72 const media::VideoCaptureFormat& frame_format, |
| 73 int clockwise_rotation, | 73 int clockwise_rotation, |
| 74 const base::TimeTicks& timestamp)); | 74 const base::TimeTicks& timestamp)); |
| 75 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); | 75 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); |
| 76 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); | 76 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); |
| 77 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); | 77 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); |
| 78 MOCK_METHOD1(OnError, void(const std::string& reason)); | 78 MOCK_METHOD1(OnError, void(const std::string& reason)); |
| 79 | 79 |
| 80 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. | 80 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. |
| 81 scoped_ptr<Buffer> ReserveOutputBuffer( | 81 scoped_ptr<Buffer> ReserveOutputBuffer(media::VideoPixelFormat format, |
| 82 const gfx::Size& dimensions, | 82 const gfx::Size& dimensions) override { |
| 83 media::VideoPixelFormat format, | |
| 84 media::VideoPixelStorage storage) override { | |
| 85 EXPECT_TRUE(format == media::PIXEL_FORMAT_I420 && | |
| 86 storage == media::PIXEL_STORAGE_CPU); | |
| 87 DoReserveOutputBuffer(); | 83 DoReserveOutputBuffer(); |
| 88 return scoped_ptr<Buffer>(); | 84 return scoped_ptr<Buffer>(); |
| 89 } | 85 } |
| 90 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 86 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
| 91 const media::VideoCaptureFormat& frame_format, | 87 const media::VideoCaptureFormat& frame_format, |
| 92 const base::TimeTicks& timestamp) override { | 88 const base::TimeTicks& timestamp) override { |
| 93 DoOnIncomingCapturedBuffer(); | 89 DoOnIncomingCapturedBuffer(); |
| 94 } | 90 } |
| 95 void OnIncomingCapturedVideoFrame( | 91 void OnIncomingCapturedVideoFrame( |
| 96 scoped_ptr<Buffer> buffer, | 92 scoped_ptr<Buffer> buffer, |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 frame_size); | 514 frame_size); |
| 519 for (int i = 0; i < output_frame_->size().height(); ++i) { | 515 for (int i = 0; i < output_frame_->size().height(); ++i) { |
| 520 EXPECT_EQ(0, | 516 EXPECT_EQ(0, |
| 521 memcmp(inverted_frame->data() + i * inverted_frame->stride(), | 517 memcmp(inverted_frame->data() + i * inverted_frame->stride(), |
| 522 output_frame_->data() + i * output_frame_->stride(), | 518 output_frame_->data() + i * output_frame_->stride(), |
| 523 output_frame_->stride())); | 519 output_frame_->stride())); |
| 524 } | 520 } |
| 525 } | 521 } |
| 526 | 522 |
| 527 } // namespace content | 523 } // namespace content |
| OLD | NEW |