| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/web_contents_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 public: | 329 public: |
| 330 StubClient( | 330 StubClient( |
| 331 const base::Callback<void(SkColor, const gfx::Size&)>& report_callback, | 331 const base::Callback<void(SkColor, const gfx::Size&)>& report_callback, |
| 332 const base::Closure& error_callback) | 332 const base::Closure& error_callback) |
| 333 : report_callback_(report_callback), | 333 : report_callback_(report_callback), |
| 334 error_callback_(error_callback) { | 334 error_callback_(error_callback) { |
| 335 buffer_pool_ = new VideoCaptureBufferPool(2); | 335 buffer_pool_ = new VideoCaptureBufferPool(2); |
| 336 } | 336 } |
| 337 ~StubClient() override {} | 337 ~StubClient() override {} |
| 338 | 338 |
| 339 MOCK_METHOD5(OnIncomingCapturedData, | 339 MOCK_METHOD6(OnIncomingCapturedData, |
| 340 void(const uint8_t* data, | 340 void(const uint8_t* data, |
| 341 int length, | 341 int length, |
| 342 const media::VideoCaptureFormat& frame_format, | 342 const media::VideoCaptureFormat& frame_format, |
| 343 int rotation, | 343 int rotation, |
| 344 const base::TimeTicks& timestamp)); | 344 base::TimeTicks reference_time, |
| 345 MOCK_METHOD9(OnIncomingCapturedYuvData, | 345 base::TimeDelta timestamp)); |
| 346 void(const uint8_t* y_data, | |
| 347 const uint8_t* u_data, | |
| 348 const uint8_t* v_data, | |
| 349 size_t y_stride, | |
| 350 size_t u_stride, | |
| 351 size_t v_stride, | |
| 352 const media::VideoCaptureFormat& frame_format, | |
| 353 int clockwise_rotation, | |
| 354 const base::TimeTicks& timestamp)); | |
| 355 | 346 |
| 356 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); | 347 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); |
| 357 | 348 |
| 358 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> | 349 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> |
| 359 ReserveOutputBuffer(const gfx::Size& dimensions, | 350 ReserveOutputBuffer(const gfx::Size& dimensions, |
| 360 media::VideoPixelFormat format, | 351 media::VideoPixelFormat format, |
| 361 media::VideoPixelStorage storage) override { | 352 media::VideoPixelStorage storage) override { |
| 362 CHECK_EQ(format, media::PIXEL_FORMAT_I420); | 353 CHECK_EQ(format, media::PIXEL_FORMAT_I420); |
| 363 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. | 354 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. |
| 364 const int buffer_id = buffer_pool_->ReserveForProducer( | 355 const int buffer_id = buffer_pool_->ReserveForProducer( |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 for (int i = 0; i < 3; ++i) { | 1209 for (int i = 0; i < 3; ++i) { |
| 1219 SimulateRefreshFrameRequest(); | 1210 SimulateRefreshFrameRequest(); |
| 1220 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 1211 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 1221 } | 1212 } |
| 1222 | 1213 |
| 1223 device()->StopAndDeAllocate(); | 1214 device()->StopAndDeAllocate(); |
| 1224 } | 1215 } |
| 1225 | 1216 |
| 1226 } // namespace | 1217 } // namespace |
| 1227 } // namespace content | 1218 } // namespace content |
| OLD | NEW |