| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/screen_capture_device_android.h" | 5 #include "content/browser/media/capture/screen_capture_device_android.h" |
| 6 | 6 |
| 7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 using ::testing::_; | 10 using ::testing::_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 return std::unique_ptr<Buffer>(); | 43 return std::unique_ptr<Buffer>(); |
| 44 } | 44 } |
| 45 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, | 45 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, |
| 46 const media::VideoCaptureFormat& frame_format, | 46 const media::VideoCaptureFormat& frame_format, |
| 47 base::TimeTicks reference_time, | 47 base::TimeTicks reference_time, |
| 48 base::TimeDelta timestamp) override { | 48 base::TimeDelta timestamp) override { |
| 49 DoOnIncomingCapturedBuffer(); | 49 DoOnIncomingCapturedBuffer(); |
| 50 } | 50 } |
| 51 void OnIncomingCapturedVideoFrame( | 51 void OnIncomingCapturedVideoFrame( |
| 52 std::unique_ptr<Buffer> buffer, | 52 std::unique_ptr<Buffer> buffer, |
| 53 const scoped_refptr<media::VideoFrame>& frame) override { | 53 scoped_refptr<media::VideoFrame> frame) override { |
| 54 DoOnIncomingCapturedVideoFrame(); | 54 DoOnIncomingCapturedVideoFrame(); |
| 55 } | 55 } |
| 56 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( | 56 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( |
| 57 const gfx::Size& dimensions, | 57 const gfx::Size& dimensions, |
| 58 media::VideoPixelFormat format, | 58 media::VideoPixelFormat format, |
| 59 media::VideoPixelStorage storage) override { | 59 media::VideoPixelStorage storage) override { |
| 60 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); | 60 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); |
| 61 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); | 61 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); |
| 62 DoResurrectLastOutputBuffer(); | 62 DoResurrectLastOutputBuffer(); |
| 63 return std::unique_ptr<Buffer>(); | 63 return std::unique_ptr<Buffer>(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 90 media::VideoCaptureParams capture_params; | 90 media::VideoCaptureParams capture_params; |
| 91 capture_params.requested_format.frame_size.SetSize(640, 480); | 91 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 92 capture_params.requested_format.frame_rate = kFrameRate; | 92 capture_params.requested_format.frame_rate = kFrameRate; |
| 93 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 93 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 94 capture_device->AllocateAndStart(capture_params, std::move(client)); | 94 capture_device->AllocateAndStart(capture_params, std::move(client)); |
| 95 capture_device->StopAndDeAllocate(); | 95 capture_device->StopAndDeAllocate(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace | 98 } // namespace |
| 99 } // namespace Content | 99 } // namespace Content |
| OLD | NEW |