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/renderer_host/media/video_capture_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/browser/browser_main_loop.h" | 10 #include "content/browser/browser_main_loop.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 base::SharedMemoryHandle handle, | 59 base::SharedMemoryHandle handle, |
60 int length, | 60 int length, |
61 int buffer_id) { | 61 int buffer_id) { |
62 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 62 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
63 if (entries_.find(controller_id) == entries_.end()) | 63 if (entries_.find(controller_id) == entries_.end()) |
64 return; | 64 return; |
65 | 65 |
66 Send(new VideoCaptureMsg_NewBuffer(controller_id, handle, length, buffer_id)); | 66 Send(new VideoCaptureMsg_NewBuffer(controller_id, handle, length, buffer_id)); |
67 } | 67 } |
68 | 68 |
| 69 void VideoCaptureHost::OnBufferCreated2( |
| 70 VideoCaptureControllerID controller_id, |
| 71 const std::vector<gfx::GpuMemoryBufferHandle>& handles, |
| 72 const gfx::Size& size, |
| 73 int buffer_id) { |
| 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 75 if (entries_.find(controller_id) == entries_.end()) |
| 76 return; |
| 77 |
| 78 Send(new VideoCaptureMsg_NewBuffer2(controller_id, handles, size, buffer_id)); |
| 79 } |
| 80 |
69 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, | 81 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, |
70 int buffer_id) { | 82 int buffer_id) { |
71 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 83 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
72 if (entries_.find(controller_id) == entries_.end()) | 84 if (entries_.find(controller_id) == entries_.end()) |
73 return; | 85 return; |
74 | 86 |
75 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); | 87 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); |
76 } | 88 } |
77 | 89 |
78 void VideoCaptureHost::OnBufferReady( | 90 void VideoCaptureHost::OnBufferReady( |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return; | 331 return; |
320 | 332 |
321 if (it->second) { | 333 if (it->second) { |
322 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 334 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
323 it->second.get(), controller_id, this, on_error); | 335 it->second.get(), controller_id, this, on_error); |
324 } | 336 } |
325 entries_.erase(it); | 337 entries_.erase(it); |
326 } | 338 } |
327 | 339 |
328 } // namespace content | 340 } // namespace content |
OLD | NEW |