| 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 "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 ~StubClient() override {} | 316 ~StubClient() override {} |
| 317 | 317 |
| 318 void OnIncomingCapturedData(const uint8* data, | 318 void OnIncomingCapturedData(const uint8* data, |
| 319 int length, | 319 int length, |
| 320 const media::VideoCaptureFormat& frame_format, | 320 const media::VideoCaptureFormat& frame_format, |
| 321 int rotation, | 321 int rotation, |
| 322 const base::TimeTicks& timestamp) override { | 322 const base::TimeTicks& timestamp) override { |
| 323 FAIL(); | 323 FAIL(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void OnIncomingCapturedYuvData(const uint8* y_data, | |
| 327 const uint8* u_data, | |
| 328 const uint8* v_data, | |
| 329 size_t y_stride, | |
| 330 size_t u_stride, | |
| 331 size_t v_stride, | |
| 332 const media::VideoCaptureFormat& frame_format, | |
| 333 int clockwise_rotation, | |
| 334 const base::TimeTicks& timestamp) override { | |
| 335 FAIL(); | |
| 336 } | |
| 337 | |
| 338 scoped_refptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( | 326 scoped_refptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( |
| 339 media::VideoFrame::Format format, | 327 media::VideoFrame::Format format, |
| 340 const gfx::Size& dimensions) override { | 328 const gfx::Size& dimensions) override { |
| 341 CHECK_EQ(format, media::VideoFrame::I420); | 329 CHECK_EQ(format, media::VideoFrame::I420); |
| 342 const size_t frame_bytes = | 330 const size_t frame_bytes = |
| 343 media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions); | 331 media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions); |
| 344 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. | 332 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. |
| 345 int buffer_id = | 333 int buffer_id = |
| 346 buffer_pool_->ReserveForProducer(frame_bytes, &buffer_id_to_drop); | 334 buffer_pool_->ReserveForProducer(frame_bytes, &buffer_id_to_drop); |
| 347 if (buffer_id == VideoCaptureBufferPool::kInvalidId) | 335 if (buffer_id == VideoCaptureBufferPool::kInvalidId) |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 source()->SetSolidColor(SK_ColorGREEN); | 857 source()->SetSolidColor(SK_ColorGREEN); |
| 870 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 858 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 871 source()->SetSolidColor(SK_ColorRED); | 859 source()->SetSolidColor(SK_ColorRED); |
| 872 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); | 860 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); |
| 873 | 861 |
| 874 device()->StopAndDeAllocate(); | 862 device()->StopAndDeAllocate(); |
| 875 } | 863 } |
| 876 | 864 |
| 877 } // namespace | 865 } // namespace |
| 878 } // namespace content | 866 } // namespace content |
| OLD | NEW |