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

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

Issue 418283003: "Buttery Smooth" Tab Capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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) 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_controller.h" 5 #include "content/browser/renderer_host/media/video_capture_controller.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 24 matching lines...) Expand all
35 namespace { 35 namespace {
36 36
37 static const int kInfiniteRatio = 99999; 37 static const int kInfiniteRatio = 99999;
38 38
39 #define UMA_HISTOGRAM_ASPECT_RATIO(name, width, height) \ 39 #define UMA_HISTOGRAM_ASPECT_RATIO(name, width, height) \
40 UMA_HISTOGRAM_SPARSE_SLOWLY( \ 40 UMA_HISTOGRAM_SPARSE_SLOWLY( \
41 name, \ 41 name, \
42 (height) ? ((width) * 100) / (height) : kInfiniteRatio); 42 (height) ? ((width) * 100) / (height) : kInfiniteRatio);
43 43
44 // The number of buffers that VideoCaptureBufferPool should allocate. 44 // The number of buffers that VideoCaptureBufferPool should allocate.
45 const int kNoOfBuffers = 3; 45 const int kNoOfBuffers = 5;
46 46
47 class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer { 47 class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer {
48 public: 48 public:
49 PoolBuffer(const scoped_refptr<VideoCaptureBufferPool>& pool, 49 PoolBuffer(const scoped_refptr<VideoCaptureBufferPool>& pool,
50 int buffer_id, 50 int buffer_id,
51 void* data, 51 void* data,
52 size_t size) 52 size_t size)
53 : Buffer(buffer_id, data, size), pool_(pool) { 53 : Buffer(buffer_id, data, size), pool_(pool) {
54 DCHECK(pool_); 54 DCHECK(pool_);
55 } 55 }
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 679 }
680 return NULL; 680 return NULL;
681 } 681 }
682 682
683 int VideoCaptureController::GetClientCount() { 683 int VideoCaptureController::GetClientCount() {
684 DCHECK_CURRENTLY_ON(BrowserThread::IO); 684 DCHECK_CURRENTLY_ON(BrowserThread::IO);
685 return controller_clients_.size(); 685 return controller_clients_.size();
686 } 686 }
687 687
688 } // namespace content 688 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698