| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 class AutoReleaseBuffer : public media::VideoCaptureDevice::Client::Buffer { | 114 class AutoReleaseBuffer : public media::VideoCaptureDevice::Client::Buffer { |
| 115 public: | 115 public: |
| 116 AutoReleaseBuffer(const scoped_refptr<VideoCaptureBufferPool>& pool, | 116 AutoReleaseBuffer(const scoped_refptr<VideoCaptureBufferPool>& pool, |
| 117 int buffer_id) | 117 int buffer_id) |
| 118 : id_(buffer_id), | 118 : id_(buffer_id), |
| 119 pool_(pool), | 119 pool_(pool), |
| 120 buffer_handle_(pool_->GetBufferHandle(buffer_id).Pass()) { | 120 buffer_handle_(pool_->GetBufferHandle(buffer_id).Pass()) { |
| 121 DCHECK(pool_.get()); | 121 DCHECK(pool_.get()); |
| 122 } | 122 } |
| 123 int id() const override { return id_; } | 123 int id() const override { return id_; } |
| 124 size_t size() const override { return buffer_handle_->size(); } | 124 gfx::Size dimensions() const override { return buffer_handle_->dimensions(); } |
| 125 size_t mapped_size() const override { return buffer_handle_->mapped_size(); } |
| 125 void* data(int plane) override { return buffer_handle_->data(plane); } | 126 void* data(int plane) override { return buffer_handle_->data(plane); } |
| 126 ClientBuffer AsClientBuffer(int plane) override { | 127 ClientBuffer AsClientBuffer(int plane) override { |
| 127 return buffer_handle_->AsClientBuffer(plane); | 128 return buffer_handle_->AsClientBuffer(plane); |
| 128 } | 129 } |
| 129 #if defined(OS_POSIX) | 130 #if defined(OS_POSIX) |
| 130 base::FileDescriptor AsPlatformFile() override { | 131 base::FileDescriptor AsPlatformFile() override { |
| 131 return buffer_handle_->AsPlatformFile(); | 132 return buffer_handle_->AsPlatformFile(); |
| 132 } | 133 } |
| 133 #endif | 134 #endif |
| 134 | 135 |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( | 768 void VideoCaptureDeviceClient::TextureWrapHelper::OnError( |
| 768 const std::string& message) { | 769 const std::string& message) { |
| 769 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 770 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| 770 DLOG(ERROR) << message; | 771 DLOG(ERROR) << message; |
| 771 BrowserThread::PostTask( | 772 BrowserThread::PostTask( |
| 772 BrowserThread::IO, FROM_HERE, | 773 BrowserThread::IO, FROM_HERE, |
| 773 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); | 774 base::Bind(&VideoCaptureController::DoErrorOnIOThread, controller_)); |
| 774 } | 775 } |
| 775 | 776 |
| 776 } // namespace content | 777 } // namespace content |
| OLD | NEW |