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 <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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (entries_.find(controller_id) == entries_.end()) | 64 if (entries_.find(controller_id) == entries_.end()) |
65 return; | 65 return; |
66 | 66 |
67 Send(new VideoCaptureMsg_NewBuffer(controller_id, handle, length, buffer_id)); | 67 Send(new VideoCaptureMsg_NewBuffer(controller_id, handle, length, buffer_id)); |
68 } | 68 } |
69 | 69 |
70 void VideoCaptureHost::OnBufferCreated2( | 70 void VideoCaptureHost::OnBufferCreated2( |
71 VideoCaptureControllerID controller_id, | 71 VideoCaptureControllerID controller_id, |
72 const std::vector<gfx::GpuMemoryBufferHandle>& handles, | 72 const std::vector<gfx::GpuMemoryBufferHandle>& handles, |
73 const gfx::Size& size, | 73 const gfx::Size& size, |
| 74 media::VideoPixelFormat format, |
74 int buffer_id) { | 75 int buffer_id) { |
75 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 76 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
76 if (entries_.find(controller_id) == entries_.end()) | 77 if (entries_.find(controller_id) == entries_.end()) |
77 return; | 78 return; |
78 | 79 |
79 Send(new VideoCaptureMsg_NewBuffer2(controller_id, handles, size, buffer_id)); | 80 Send(new VideoCaptureMsg_NewBuffer2(controller_id, handles, size, format, |
| 81 buffer_id)); |
80 } | 82 } |
81 | 83 |
82 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, | 84 void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id, |
83 int buffer_id) { | 85 int buffer_id) { |
84 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 86 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
85 if (entries_.find(controller_id) == entries_.end()) | 87 if (entries_.find(controller_id) == entries_.end()) |
86 return; | 88 return; |
87 | 89 |
88 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); | 90 Send(new VideoCaptureMsg_FreeBuffer(controller_id, buffer_id)); |
89 } | 91 } |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return; | 342 return; |
341 | 343 |
342 if (it->second) { | 344 if (it->second) { |
343 media_stream_manager_->video_capture_manager()->StopCaptureForClient( | 345 media_stream_manager_->video_capture_manager()->StopCaptureForClient( |
344 it->second.get(), controller_id, this, on_error); | 346 it->second.get(), controller_id, this, on_error); |
345 } | 347 } |
346 entries_.erase(it); | 348 entries_.erase(it); |
347 } | 349 } |
348 | 350 |
349 } // namespace content | 351 } // namespace content |
OLD | NEW |