OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_buffer_pool.h" | 5 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 DCHECK(base::SharedMemory::IsHandleValid(current_gmb_handle.handle)); | 167 DCHECK(base::SharedMemory::IsHandleValid(current_gmb_handle.handle)); |
168 base::SharedMemory shared_memory( | 168 base::SharedMemory shared_memory( |
169 base::SharedMemory::DuplicateHandle(current_gmb_handle.handle), | 169 base::SharedMemory::DuplicateHandle(current_gmb_handle.handle), |
170 false); | 170 false); |
171 shared_memory.ShareToProcess(process_handle, &new_handle->handle); | 171 shared_memory.ShareToProcess(process_handle, &new_handle->handle); |
172 DCHECK(base::SharedMemory::IsHandleValid(new_handle->handle)); | 172 DCHECK(base::SharedMemory::IsHandleValid(new_handle->handle)); |
173 new_handle->type = gfx::SHARED_MEMORY_BUFFER; | 173 new_handle->type = gfx::SHARED_MEMORY_BUFFER; |
174 return true; | 174 return true; |
175 } | 175 } |
176 case gfx::IO_SURFACE_BUFFER: | 176 case gfx::IO_SURFACE_BUFFER: |
177 case gfx::SURFACE_TEXTURE_BUFFER: | |
178 case gfx::OZONE_NATIVE_PIXMAP: | 177 case gfx::OZONE_NATIVE_PIXMAP: |
179 *new_handle = current_gmb_handle; | 178 *new_handle = current_gmb_handle; |
180 return true; | 179 return true; |
181 } | 180 } |
182 NOTREACHED(); | 181 NOTREACHED(); |
183 return true; | 182 return true; |
184 } | 183 } |
185 | 184 |
186 private: | 185 private: |
187 // A simple proxy that implements the BufferHandle interface, providing | 186 // A simple proxy that implements the BufferHandle interface, providing |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 return buffer_id; | 473 return buffer_id; |
475 } | 474 } |
476 | 475 |
477 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( | 476 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( |
478 int buffer_id) { | 477 int buffer_id) { |
479 TrackerMap::const_iterator it = trackers_.find(buffer_id); | 478 TrackerMap::const_iterator it = trackers_.find(buffer_id); |
480 return (it == trackers_.end()) ? NULL : it->second; | 479 return (it == trackers_.end()) ? NULL : it->second; |
481 } | 480 } |
482 | 481 |
483 } // namespace content | 482 } // namespace content |
OLD | NEW |