| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |