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