OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer_host/media/video_capture_device_client.h" | 5 #include "content/browser/renderer_host/media/video_capture_device_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "content/browser/compositor/image_transport_factory.h" | 10 #include "content/browser/compositor/image_transport_factory.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 int id() const override { return id_; } | 117 int id() const override { return id_; } |
118 size_t size() const override { return buffer_handle_->size(); } | 118 size_t size() const override { return buffer_handle_->size(); } |
119 void* data() override { return buffer_handle_->data(); } | 119 void* data() override { return buffer_handle_->data(); } |
120 gfx::GpuMemoryBufferType GetType() override { | 120 gfx::GpuMemoryBufferType GetType() override { |
121 return buffer_handle_->GetType(); | 121 return buffer_handle_->GetType(); |
122 } | 122 } |
123 ClientBuffer AsClientBuffer() override { | 123 ClientBuffer AsClientBuffer() override { |
124 return buffer_handle_->AsClientBuffer(); | 124 return buffer_handle_->AsClientBuffer(); |
125 } | 125 } |
| 126 base::PlatformFile AsPlatformFile() override { |
| 127 return buffer_handle_->AsPlatformFile(); |
| 128 } |
126 | 129 |
127 private: | 130 private: |
128 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } | 131 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } |
129 | 132 |
130 const int id_; | 133 const int id_; |
131 const scoped_refptr<VideoCaptureBufferPool> pool_; | 134 const scoped_refptr<VideoCaptureBufferPool> pool_; |
132 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; | 135 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; |
133 }; | 136 }; |
134 | 137 |
135 // Internal ref-counted class wrapping an incoming GpuMemoryBuffer into a | 138 // Internal ref-counted class wrapping an incoming GpuMemoryBuffer into a |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( | 670 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( |
668 const std::string& message) { | 671 const std::string& message) { |
669 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 672 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
670 DLOG(ERROR) << message; | 673 DLOG(ERROR) << message; |
671 BrowserThread::PostTask( | 674 BrowserThread::PostTask( |
672 BrowserThread::IO, FROM_HERE, | 675 BrowserThread::IO, FROM_HERE, |
673 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); | 676 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); |
674 } | 677 } |
675 | 678 |
676 } // namespace content | 679 } // namespace content |
OLD | NEW |