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 { | |
83 DoReserveOutputBuffer(); | 85 DoReserveOutputBuffer(); |
hubbe
2015/06/18 19:23:10
CHECK/EXPECT input values?
mcasas
2015/06/19 02:58:35
Done.
| |
84 return scoped_ptr<Buffer>(); | 86 return scoped_ptr<Buffer>(); |
85 } | 87 } |
86 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 88 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
87 const media::VideoCaptureFormat& frame_format, | 89 const media::VideoCaptureFormat& frame_format, |
88 const base::TimeTicks& timestamp) override { | 90 const base::TimeTicks& timestamp) override { |
89 DoOnIncomingCapturedBuffer(); | 91 DoOnIncomingCapturedBuffer(); |
90 } | 92 } |
91 void OnIncomingCapturedVideoFrame( | 93 void OnIncomingCapturedVideoFrame( |
92 scoped_ptr<Buffer> buffer, | 94 scoped_ptr<Buffer> buffer, |
93 const scoped_refptr<media::VideoFrame>& frame, | 95 const scoped_refptr<media::VideoFrame>& frame, |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 frame_size); | 516 frame_size); |
515 for (int i = 0; i < output_frame_->size().height(); ++i) { | 517 for (int i = 0; i < output_frame_->size().height(); ++i) { |
516 EXPECT_EQ(0, | 518 EXPECT_EQ(0, |
517 memcmp(inverted_frame->data() + i * inverted_frame->stride(), | 519 memcmp(inverted_frame->data() + i * inverted_frame->stride(), |
518 output_frame_->data() + i * output_frame_->stride(), | 520 output_frame_->data() + i * output_frame_->stride(), |
519 output_frame_->stride())); | 521 output_frame_->stride())); |
520 } | 522 } |
521 } | 523 } |
522 | 524 |
523 } // namespace content | 525 } // namespace content |
OLD | NEW |