Chromium Code Reviews| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 } | 254 } |
| 255 NOTREACHED(); | 255 NOTREACHED(); |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 // static | 259 // static |
| 260 scoped_ptr<VideoCaptureBufferPool::Tracker> | 260 scoped_ptr<VideoCaptureBufferPool::Tracker> |
| 261 VideoCaptureBufferPool::Tracker::CreateTracker( | 261 VideoCaptureBufferPool::Tracker::CreateTracker( |
| 262 media::VideoPixelStorage storage) { | 262 media::VideoPixelStorage storage) { |
| 263 DCHECK(storage == media::PIXEL_STORAGE_GPUMEMORYBUFFER || | 263 DCHECK(storage == media::PIXEL_STORAGE_GPUMEMORYBUFFER || |
| 264 storage == media::PIXEL_STORAGE_CPU || | 264 storage == media::PIXEL_STORAGE_CPU); |
|
mcasas
2015/11/13 19:13:57
Actually, these are all the cases now, remove this
miu
2015/11/14 03:43:47
Done. Replaced with switch statement to ensure co
| |
| 265 storage == media::PIXEL_STORAGE_TEXTURE); | |
| 266 | 265 |
| 267 if (storage == media::PIXEL_STORAGE_GPUMEMORYBUFFER) | 266 if (storage == media::PIXEL_STORAGE_GPUMEMORYBUFFER) |
| 268 return make_scoped_ptr(new GpuMemoryBufferTracker()); | 267 return make_scoped_ptr(new GpuMemoryBufferTracker()); |
| 269 else | 268 else |
| 270 return make_scoped_ptr(new SharedMemTracker()); | 269 return make_scoped_ptr(new SharedMemTracker()); |
| 271 } | 270 } |
| 272 | 271 |
| 273 VideoCaptureBufferPool::Tracker::~Tracker() {} | 272 VideoCaptureBufferPool::Tracker::~Tracker() {} |
| 274 | 273 |
| 275 VideoCaptureBufferPool::VideoCaptureBufferPool(int count) | 274 VideoCaptureBufferPool::VideoCaptureBufferPool(int count) |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 return buffer_id; | 454 return buffer_id; |
| 456 } | 455 } |
| 457 | 456 |
| 458 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( | 457 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( |
| 459 int buffer_id) { | 458 int buffer_id) { |
| 460 TrackerMap::const_iterator it = trackers_.find(buffer_id); | 459 TrackerMap::const_iterator it = trackers_.find(buffer_id); |
| 461 return (it == trackers_.end()) ? NULL : it->second; | 460 return (it == trackers_.end()) ? NULL : it->second; |
| 462 } | 461 } |
| 463 | 462 |
| 464 } // namespace content | 463 } // namespace content |
| OLD | NEW |