| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 NOTREACHED(); | 241 NOTREACHED(); |
| 242 return false; | 242 return false; |
| 243 case gfx::SHARED_MEMORY_BUFFER: { | 243 case gfx::SHARED_MEMORY_BUFFER: { |
| 244 DCHECK(base::SharedMemory::IsHandleValid(current_gmb_handle.handle)); | 244 DCHECK(base::SharedMemory::IsHandleValid(current_gmb_handle.handle)); |
| 245 base::SharedMemory shared_memory( | 245 base::SharedMemory shared_memory( |
| 246 base::SharedMemory::DuplicateHandle(current_gmb_handle.handle), | 246 base::SharedMemory::DuplicateHandle(current_gmb_handle.handle), |
| 247 false); | 247 false); |
| 248 shared_memory.ShareToProcess(process_handle, &new_handle->handle); | 248 shared_memory.ShareToProcess(process_handle, &new_handle->handle); |
| 249 DCHECK(base::SharedMemory::IsHandleValid(new_handle->handle)); | 249 DCHECK(base::SharedMemory::IsHandleValid(new_handle->handle)); |
| 250 new_handle->type = gfx::SHARED_MEMORY_BUFFER; | 250 new_handle->type = gfx::SHARED_MEMORY_BUFFER; |
| 251 new_handle->offset = current_gmb_handle.offset; |
| 251 return true; | 252 return true; |
| 252 } | 253 } |
| 253 case gfx::IO_SURFACE_BUFFER: | 254 case gfx::IO_SURFACE_BUFFER: |
| 254 case gfx::SURFACE_TEXTURE_BUFFER: | 255 case gfx::SURFACE_TEXTURE_BUFFER: |
| 255 case gfx::OZONE_NATIVE_PIXMAP: | 256 case gfx::OZONE_NATIVE_PIXMAP: |
| 256 *new_handle = current_gmb_handle; | 257 *new_handle = current_gmb_handle; |
| 257 return true; | 258 return true; |
| 258 } | 259 } |
| 259 NOTREACHED(); | 260 NOTREACHED(); |
| 260 return true; | 261 return true; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 return buffer_id; | 454 return buffer_id; |
| 454 } | 455 } |
| 455 | 456 |
| 456 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( | 457 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( |
| 457 int buffer_id) { | 458 int buffer_id) { |
| 458 TrackerMap::const_iterator it = trackers_.find(buffer_id); | 459 TrackerMap::const_iterator it = trackers_.find(buffer_id); |
| 459 return (it == trackers_.end()) ? NULL : it->second; | 460 return (it == trackers_.end()) ? NULL : it->second; |
| 460 } | 461 } |
| 461 | 462 |
| 462 } // namespace content | 463 } // namespace content |
| OLD | NEW |