| 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 pool_(pool), | 410 pool_(pool), |
| 411 buffer_handle_(buffer_handle.Pass()) { | 411 buffer_handle_(buffer_handle.Pass()) { |
| 412 DCHECK(pool_.get()); | 412 DCHECK(pool_.get()); |
| 413 } | 413 } |
| 414 int id() const override { return id_; } | 414 int id() const override { return id_; } |
| 415 size_t size() const override { return buffer_handle_->size(); } | 415 size_t size() const override { return buffer_handle_->size(); } |
| 416 void* data() override { return buffer_handle_->data(); } | 416 void* data() override { return buffer_handle_->data(); } |
| 417 gfx::GpuMemoryBufferType GetType() override { | 417 gfx::GpuMemoryBufferType GetType() override { |
| 418 return gfx::SHARED_MEMORY_BUFFER; | 418 return gfx::SHARED_MEMORY_BUFFER; |
| 419 } | 419 } |
| 420 base::PlatformFile AsPlatformFile() const override { |
| 421 return base::PlatformFile(); |
| 422 } |
| 420 ClientBuffer AsClientBuffer() override { return nullptr; } | 423 ClientBuffer AsClientBuffer() override { return nullptr; } |
| 421 | 424 |
| 422 private: | 425 private: |
| 423 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } | 426 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } |
| 424 | 427 |
| 425 const int id_; | 428 const int id_; |
| 426 const scoped_refptr<VideoCaptureBufferPool> pool_; | 429 const scoped_refptr<VideoCaptureBufferPool> pool_; |
| 427 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; | 430 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; |
| 428 }; | 431 }; |
| 429 | 432 |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 SK_ColorBLACK, gfx::Size(kTestWidth, | 1087 SK_ColorBLACK, gfx::Size(kTestWidth, |
| 1085 kTestWidth * arbitrary_source_size.height() / | 1088 kTestWidth * arbitrary_source_size.height() / |
| 1086 arbitrary_source_size.width()))); | 1089 arbitrary_source_size.width()))); |
| 1087 } | 1090 } |
| 1088 | 1091 |
| 1089 device()->StopAndDeAllocate(); | 1092 device()->StopAndDeAllocate(); |
| 1090 } | 1093 } |
| 1091 | 1094 |
| 1092 } // namespace | 1095 } // namespace |
| 1093 } // namespace content | 1096 } // namespace content |
| OLD | NEW |