Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 2395913003: Cleanup of passing GpuMemoryBuffer backed video frames (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 base::SharedMemoryHandle handle, 58 base::SharedMemoryHandle handle,
59 int length, 59 int length,
60 int buffer_id) { 60 int buffer_id) {
61 DCHECK_CURRENTLY_ON(BrowserThread::IO); 61 DCHECK_CURRENTLY_ON(BrowserThread::IO);
62 if (controllers_.find(controller_id) == controllers_.end()) 62 if (controllers_.find(controller_id) == controllers_.end())
63 return; 63 return;
64 64
65 Send(new VideoCaptureMsg_NewBuffer(controller_id, handle, length, buffer_id)); 65 Send(new VideoCaptureMsg_NewBuffer(controller_id, handle, length, buffer_id));
66 } 66 }
67 67
68 void VideoCaptureHost::OnBufferCreated2(
69 VideoCaptureControllerID controller_id,
70 const std::vector<gfx::GpuMemoryBufferHandle>& handles,
71 const gfx::Size& size,
72 int buffer_id) {
73 DCHECK_CURRENTLY_ON(BrowserThread::IO);
74 if (controllers_.find(controller_id) == controllers_.end())
75 return;
76
77 Send(new VideoCaptureMsg_NewBuffer2(controller_id, handles, size, buffer_id));
78 }
79
80 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, 68 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id,
81 int buffer_id) { 69 int buffer_id) {
82 DCHECK_CURRENTLY_ON(BrowserThread::IO); 70 DCHECK_CURRENTLY_ON(BrowserThread::IO);
83 if (controllers_.find(controller_id) == controllers_.end()) 71 if (controllers_.find(controller_id) == controllers_.end())
84 return; 72 return;
85 73
86 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); 74 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id));
87 } 75 }
88 76
89 void VideoCaptureHost::OnBufferReady( 77 void VideoCaptureHost::OnBufferReady(
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 return; 297 return;
310 298
311 if (it->second) { 299 if (it->second) {
312 media_stream_manager_->video_capture_manager()->StopCaptureForClient( 300 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
313 it->second.get(), controller_id, this, on_error); 301 it->second.get(), controller_id, this, on_error);
314 } 302 }
315 controllers_.erase(it); 303 controllers_.erase(it);
316 } 304 }
317 305
318 } // namespace content 306 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698