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

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

Issue 1417363006: ui: Add support for creating GLImage instances from shared memory pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usage-rename
Patch Set: static_cast<off_t> to make windows build happy Created 5 years, 1 month 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
« no previous file with comments | « components/mus/gles2/mojo_gpu_memory_buffer.cc ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/mus/gles2/mojo_gpu_memory_buffer.cc ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698