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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 media::VideoPixelFormat format, 107 media::VideoPixelFormat format,
108 media::VideoPixelStorage storage_type, 108 media::VideoPixelStorage storage_type,
109 base::Lock* lock) override { 109 base::Lock* lock) override {
110 DVLOG(2) << "allocating GMB for " << dimensions.ToString(); 110 DVLOG(2) << "allocating GMB for " << dimensions.ToString();
111 // BrowserGpuMemoryBufferManager::current() may not be accessed on IO 111 // BrowserGpuMemoryBufferManager::current() may not be accessed on IO
112 // Thread. 112 // Thread.
113 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); 113 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
114 DCHECK(BrowserGpuMemoryBufferManager::current()); 114 DCHECK(BrowserGpuMemoryBufferManager::current());
115 // This class is only expected to be called with I420 buffer requests at 115 // This class is only expected to be called with I420 buffer requests at
116 // this point. 116 // this point.
117 DCHECK_EQ(format, media::PIXEL_FORMAT_I420); 117 DCHECK(media::PIXEL_FORMAT_I420 == format ||
118 media::PIXEL_FORMAT_Y16 == format);
118 set_dimensions(dimensions); 119 set_dimensions(dimensions);
119 set_max_pixel_count(dimensions.GetArea()); 120 set_max_pixel_count(dimensions.GetArea());
120 set_pixel_format(format); 121 set_pixel_format(format);
121 set_storage_type(storage_type); 122 set_storage_type(storage_type);
122 // |dimensions| can be 0x0 for trackers that do not require memory backing. 123 // |dimensions| can be 0x0 for trackers that do not require memory backing.
123 if (dimensions.GetArea() == 0u) 124 if (dimensions.GetArea() == 0u)
124 return true; 125 return true;
125 126
126 base::AutoUnlock auto_unlock(*lock); 127 base::AutoUnlock auto_unlock(*lock);
127 const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format()); 128 const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format());
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 return buffer_id; 475 return buffer_id;
475 } 476 }
476 477
477 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker( 478 VideoCaptureBufferPool::Tracker* VideoCaptureBufferPool::GetTracker(
478 int buffer_id) { 479 int buffer_id) {
479 TrackerMap::const_iterator it = trackers_.find(buffer_id); 480 TrackerMap::const_iterator it = trackers_.find(buffer_id);
480 return (it == trackers_.end()) ? NULL : it->second; 481 return (it == trackers_.end()) ? NULL : it->second;
481 } 482 }
482 483
483 } // namespace content 484 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698