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>& gmb_handles, | |
reveman
2015/08/26 11:54:04
nit: s/gmb_handles/handles/
emircan
2015/08/26 21:23:11
Done.
| |
72 const gfx::Size& size, | |
73 int buffer_id) { | |
74 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
75 if (entries_.find(controller_id) == entries_.end()) | |
reveman
2015/08/26 11:54:04
can this be a DCHECK?
emircan
2015/08/26 21:23:11
I read through and it all goes down to this CL [0]
reveman
2015/08/27 00:21:24
Sounds good. Thanks.
| |
76 return; | |
77 | |
78 Send(new VideoCaptureMsg_NewBuffer2(controller_id, gmb_handles, size, | |
79 buffer_id)); | |
80 } | |
81 | |
69 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, | 82 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, |
70 int buffer_id) { | 83 int buffer_id) { |
71 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 84 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
72 if (entries_.find(controller_id) == entries_.end()) | 85 if (entries_.find(controller_id) == entries_.end()) |
73 return; | 86 return; |
74 | 87 |
75 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); | 88 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); |
76 } | 89 } |
77 | 90 |
78 void VideoCaptureHost::OnBufferReady( | 91 void VideoCaptureHost::OnBufferReady( |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 return; | 332 return; |
320 | 333 |
321 if (it->second) { | 334 if (it->second) { |
322 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 335 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
323 it->second.get(), controller_id, this, on_error); | 336 it->second.get(), controller_id, this, on_error); |
324 } | 337 } |
325 entries_.erase(it); | 338 entries_.erase(it); |
326 } | 339 } |
327 | 340 |
328 } // namespace content | 341 } // namespace content |
OLD | NEW |