| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 int buffer_id) | 387 int buffer_id) |
| 388 : id_(buffer_id), | 388 : id_(buffer_id), |
| 389 pool_(pool), | 389 pool_(pool), |
| 390 buffer_handle_(buffer_handle.Pass()) { | 390 buffer_handle_(buffer_handle.Pass()) { |
| 391 DCHECK(pool_.get()); | 391 DCHECK(pool_.get()); |
| 392 } | 392 } |
| 393 int id() const override { return id_; } | 393 int id() const override { return id_; } |
| 394 size_t size() const override { return buffer_handle_->size(); } | 394 size_t size() const override { return buffer_handle_->size(); } |
| 395 void* data() override { return buffer_handle_->data(); } | 395 void* data() override { return buffer_handle_->data(); } |
| 396 ClientBuffer AsClientBuffer() override { return nullptr; } | 396 ClientBuffer AsClientBuffer() override { return nullptr; } |
| 397 base::PlatformFile AsPlatformFile() override { return 0; } |
| 397 | 398 |
| 398 private: | 399 private: |
| 399 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } | 400 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } |
| 400 | 401 |
| 401 const int id_; | 402 const int id_; |
| 402 const scoped_refptr<VideoCaptureBufferPool> pool_; | 403 const scoped_refptr<VideoCaptureBufferPool> pool_; |
| 403 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; | 404 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; |
| 404 }; | 405 }; |
| 405 | 406 |
| 406 scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 407 scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 source()->SetSolidColor(SK_ColorGREEN); | 872 source()->SetSolidColor(SK_ColorGREEN); |
| 872 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 873 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
| 873 source()->SetSolidColor(SK_ColorRED); | 874 source()->SetSolidColor(SK_ColorRED); |
| 874 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); | 875 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); |
| 875 | 876 |
| 876 device()->StopAndDeAllocate(); | 877 device()->StopAndDeAllocate(); |
| 877 } | 878 } |
| 878 | 879 |
| 879 } // namespace | 880 } // namespace |
| 880 } // namespace content | 881 } // namespace content |
| OLD | NEW |