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

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

Issue 418283003: "Buttery Smooth" Tab Capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now pixel-weighted. Lots of add'l unit tests. (rebased against ToT) Created 6 years, 4 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 | Annotate | Revision Log
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/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "media/base/video_frame.h" 12 #include "media/base/video_frame.h"
13 #include "media/base/video_util.h" 13 #include "media/base/video_util.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 const int VideoCaptureBufferPool::kInvalidId = -1; 17 const int VideoCaptureBufferPool::kInvalidId = -1;
18 18
19 VideoCaptureBufferPool::VideoCaptureBufferPool(int count) 19 VideoCaptureBufferPool::VideoCaptureBufferPool(int count)
20 : count_(count), 20 : count_(count),
21 next_buffer_id_(0) { 21 next_buffer_id_(0) {
22 DCHECK_GT(count, 0);
22 } 23 }
23 24
24 VideoCaptureBufferPool::~VideoCaptureBufferPool() { 25 VideoCaptureBufferPool::~VideoCaptureBufferPool() {
25 STLDeleteValues(&buffers_); 26 STLDeleteValues(&buffers_);
26 } 27 }
27 28
28 base::SharedMemoryHandle VideoCaptureBufferPool::ShareToProcess( 29 base::SharedMemoryHandle VideoCaptureBufferPool::ShareToProcess(
29 int buffer_id, 30 int buffer_id,
30 base::ProcessHandle process_handle, 31 base::ProcessHandle process_handle,
31 size_t* memory_size) { 32 size_t* memory_size) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 162
162 VideoCaptureBufferPool::Buffer* VideoCaptureBufferPool::GetBuffer( 163 VideoCaptureBufferPool::Buffer* VideoCaptureBufferPool::GetBuffer(
163 int buffer_id) { 164 int buffer_id) {
164 BufferMap::iterator it = buffers_.find(buffer_id); 165 BufferMap::iterator it = buffers_.find(buffer_id);
165 if (it == buffers_.end()) 166 if (it == buffers_.end())
166 return NULL; 167 return NULL;
167 return it->second; 168 return it->second;
168 } 169 }
169 170
170 } // namespace content 171 } // namespace content
171
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698