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 |
326 scoped_refptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( | 338 scoped_refptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( |
327 media::VideoFrame::Format format, | 339 media::VideoFrame::Format format, |
328 const gfx::Size& dimensions) override { | 340 const gfx::Size& dimensions) override { |
329 CHECK_EQ(format, media::VideoFrame::I420); | 341 CHECK_EQ(format, media::VideoFrame::I420); |
330 const size_t frame_bytes = | 342 const size_t frame_bytes = |
331 media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions); | 343 media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions); |
332 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. | 344 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. |
333 int buffer_id = | 345 int buffer_id = |
334 buffer_pool_->ReserveForProducer(frame_bytes, &buffer_id_to_drop); | 346 buffer_pool_->ReserveForProducer(frame_bytes, &buffer_id_to_drop); |
335 if (buffer_id == VideoCaptureBufferPool::kInvalidId) | 347 if (buffer_id == VideoCaptureBufferPool::kInvalidId) |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 source()->SetSolidColor(SK_ColorGREEN); | 869 source()->SetSolidColor(SK_ColorGREEN); |
858 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 870 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
859 source()->SetSolidColor(SK_ColorRED); | 871 source()->SetSolidColor(SK_ColorRED); |
860 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); | 872 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); |
861 | 873 |
862 device()->StopAndDeAllocate(); | 874 device()->StopAndDeAllocate(); |
863 } | 875 } |
864 | 876 |
865 } // namespace | 877 } // namespace |
866 } // namespace content | 878 } // namespace content |
OLD | NEW |