| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); | 42 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); |
| 43 DoReserveOutputBuffer(); | 43 DoReserveOutputBuffer(); |
| 44 return std::unique_ptr<Buffer>(); | 44 return std::unique_ptr<Buffer>(); |
| 45 } | 45 } |
| 46 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, | 46 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, |
| 47 const media::VideoCaptureFormat& frame_format, | 47 const media::VideoCaptureFormat& frame_format, |
| 48 base::TimeTicks reference_time, | 48 base::TimeTicks reference_time, |
| 49 base::TimeDelta timestamp) override { | 49 base::TimeDelta timestamp) override { |
| 50 DoOnIncomingCapturedBuffer(); | 50 DoOnIncomingCapturedBuffer(); |
| 51 } | 51 } |
| 52 void OnIncomingCapturedVideoFrame( | 52 void OnIncomingCapturedBufferExt( |
| 53 std::unique_ptr<Buffer> buffer, | 53 std::unique_ptr<Buffer> buffer, |
| 54 scoped_refptr<media::VideoFrame> frame) override { | 54 const media::VideoCaptureFormat& format, |
| 55 base::TimeTicks reference_time, |
| 56 base::TimeDelta timestamp, |
| 57 gfx::Rect visible_rect, |
| 58 const media::VideoFrameMetadata& additional_metadata) override { |
| 55 DoOnIncomingCapturedVideoFrame(); | 59 DoOnIncomingCapturedVideoFrame(); |
| 56 } | 60 } |
| 57 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( | 61 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( |
| 58 const gfx::Size& dimensions, | 62 const gfx::Size& dimensions, |
| 59 media::VideoPixelFormat format, | 63 media::VideoPixelFormat format, |
| 60 media::VideoPixelStorage storage, | 64 media::VideoPixelStorage storage, |
| 61 int frame_feedback_id) override { | 65 int frame_feedback_id) override { |
| 62 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); | 66 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); |
| 63 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); | 67 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); |
| 64 DoResurrectLastOutputBuffer(); | 68 DoResurrectLastOutputBuffer(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 92 media::VideoCaptureParams capture_params; | 96 media::VideoCaptureParams capture_params; |
| 93 capture_params.requested_format.frame_size.SetSize(640, 480); | 97 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 94 capture_params.requested_format.frame_rate = kFrameRate; | 98 capture_params.requested_format.frame_rate = kFrameRate; |
| 95 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 99 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 96 capture_device->AllocateAndStart(capture_params, std::move(client)); | 100 capture_device->AllocateAndStart(capture_params, std::move(client)); |
| 97 capture_device->StopAndDeAllocate(); | 101 capture_device->StopAndDeAllocate(); |
| 98 } | 102 } |
| 99 | 103 |
| 100 } // namespace | 104 } // namespace |
| 101 } // namespace Content | 105 } // namespace Content |
| OLD | NEW |