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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 gfx::GpuMemoryBufferType GetType() override { | 396 gfx::GpuMemoryBufferType GetType() override { |
397 return gfx::SHARED_MEMORY_BUFFER; | 397 return gfx::SHARED_MEMORY_BUFFER; |
398 } | 398 } |
399 ClientBuffer AsClientBuffer() override { return nullptr; } | 399 ClientBuffer AsClientBuffer() override { return nullptr; } |
| 400 base::PlatformFile AsPlatformFile() override { return 0; } |
400 | 401 |
401 private: | 402 private: |
402 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } | 403 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } |
403 | 404 |
404 const int id_; | 405 const int id_; |
405 const scoped_refptr<VideoCaptureBufferPool> pool_; | 406 const scoped_refptr<VideoCaptureBufferPool> pool_; |
406 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; | 407 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; |
407 }; | 408 }; |
408 | 409 |
409 scoped_refptr<VideoCaptureBufferPool> buffer_pool_; | 410 scoped_refptr<VideoCaptureBufferPool> buffer_pool_; |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 source()->SetSolidColor(SK_ColorGREEN); | 875 source()->SetSolidColor(SK_ColorGREEN); |
875 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 876 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
876 source()->SetSolidColor(SK_ColorRED); | 877 source()->SetSolidColor(SK_ColorRED); |
877 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); | 878 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); |
878 | 879 |
879 device()->StopAndDeAllocate(); | 880 device()->StopAndDeAllocate(); |
880 } | 881 } |
881 | 882 |
882 } // namespace | 883 } // namespace |
883 } // namespace content | 884 } // namespace content |
OLD | NEW |