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

Side by Side Diff: webkit/plugins/ppapi/ppb_video_capture_impl.cc

Issue 8400084: refactor video capture in renderer process (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 9 years, 1 month 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
« no previous file with comments | « media/video/capture/video_capture.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_video_capture_impl.h" 5 #include "webkit/plugins/ppapi/ppb_video_capture_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // Clamp the buffer count to between 1 and |kMaxBuffers|. 95 // Clamp the buffer count to between 1 and |kMaxBuffers|.
96 buffer_count_hint_ = std::min(std::max(buffer_count, 1U), kMaxBuffers); 96 buffer_count_hint_ = std::min(std::max(buffer_count, 1U), kMaxBuffers);
97 media::VideoCapture::VideoCaptureCapability capability = { 97 media::VideoCapture::VideoCaptureCapability capability = {
98 requested_info.width, 98 requested_info.width,
99 requested_info.height, 99 requested_info.height,
100 requested_info.frames_per_second, 100 requested_info.frames_per_second,
101 0, // ignored. 101 0, // ignored.
102 media::VideoFrame::I420, 102 media::VideoFrame::I420,
103 false, // ignored 103 false, // ignored
104 false // resolution_fixed
105 }; 104 };
106 status_ = PP_VIDEO_CAPTURE_STATUS_STARTING; 105 status_ = PP_VIDEO_CAPTURE_STATUS_STARTING;
107 AddRef(); // Balanced in |OnRemoved()|. 106 AddRef(); // Balanced in |OnRemoved()|.
108 platform_video_capture_->StartCapture(this, capability); 107 platform_video_capture_->StartCapture(this, capability);
109 return PP_OK; 108 return PP_OK;
110 } 109 }
111 110
112 int32_t PPB_VideoCapture_Impl::ReuseBuffer(uint32_t buffer) { 111 int32_t PPB_VideoCapture_Impl::ReuseBuffer(uint32_t buffer) {
113 DCHECK(!is_dead_); 112 DCHECK(!is_dead_);
114 if (buffer >= buffers_.size() || !buffers_[buffer].in_use) 113 if (buffer >= buffers_.size() || !buffers_[buffer].in_use)
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 : in_use(false), 304 : in_use(false),
306 data(NULL), 305 data(NULL),
307 buffer() { 306 buffer() {
308 } 307 }
309 308
310 PPB_VideoCapture_Impl::BufferInfo::~BufferInfo() { 309 PPB_VideoCapture_Impl::BufferInfo::~BufferInfo() {
311 } 310 }
312 311
313 } // namespace ppapi 312 } // namespace ppapi
314 } // namespace webkit 313 } // namespace webkit
OLDNEW
« no previous file with comments | « media/video/capture/video_capture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698