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(media::VideoPixelFormat format, | 81 scoped_ptr<Buffer> ReserveOutputBuffer( |
82 const gfx::Size& dimensions) override { | 82 const gfx::Size& dimensions, |
| 83 media::VideoPixelFormat format, |
| 84 media::VideoPixelStorage storage) override { |
| 85 EXPECT_TRUE(format == media::PIXEL_FORMAT_I420 && |
| 86 storage == media::PIXEL_STORAGE_CPU); |
83 DoReserveOutputBuffer(); | 87 DoReserveOutputBuffer(); |
84 return scoped_ptr<Buffer>(); | 88 return scoped_ptr<Buffer>(); |
85 } | 89 } |
86 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 90 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
87 const media::VideoCaptureFormat& frame_format, | 91 const media::VideoCaptureFormat& frame_format, |
88 const base::TimeTicks& timestamp) override { | 92 const base::TimeTicks& timestamp) override { |
89 DoOnIncomingCapturedBuffer(); | 93 DoOnIncomingCapturedBuffer(); |
90 } | 94 } |
91 void OnIncomingCapturedVideoFrame( | 95 void OnIncomingCapturedVideoFrame( |
92 scoped_ptr<Buffer> buffer, | 96 scoped_ptr<Buffer> buffer, |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 frame_size); | 518 frame_size); |
515 for (int i = 0; i < output_frame_->size().height(); ++i) { | 519 for (int i = 0; i < output_frame_->size().height(); ++i) { |
516 EXPECT_EQ(0, | 520 EXPECT_EQ(0, |
517 memcmp(inverted_frame->data() + i * inverted_frame->stride(), | 521 memcmp(inverted_frame->data() + i * inverted_frame->stride(), |
518 output_frame_->data() + i * output_frame_->stride(), | 522 output_frame_->data() + i * output_frame_->stride(), |
519 output_frame_->stride())); | 523 output_frame_->stride())); |
520 } | 524 } |
521 } | 525 } |
522 | 526 |
523 } // namespace content | 527 } // namespace content |
OLD | NEW |