| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 int error_code) { | 160 int error_code) { |
| 161 // Today, the media layer only sends "1" as an error. | 161 // Today, the media layer only sends "1" as an error. |
| 162 DCHECK(error_code == 1); | 162 DCHECK(error_code == 1); |
| 163 // It either comes because some error was detected while starting (e.g. 2 | 163 // It either comes because some error was detected while starting (e.g. 2 |
| 164 // conflicting "master" resolution), or because the browser failed to start | 164 // conflicting "master" resolution), or because the browser failed to start |
| 165 // the capture. | 165 // the capture. |
| 166 status_ = PP_VIDEO_CAPTURE_STATUS_STOPPED; | 166 status_ = PP_VIDEO_CAPTURE_STATUS_STOPPED; |
| 167 ppp_videocapture_->OnError(pp_instance(), pp_resource(), PP_ERROR_FAILED); | 167 ppp_videocapture_->OnError(pp_instance(), pp_resource(), PP_ERROR_FAILED); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void PPB_VideoCapture_Impl::OnRemoved(media::VideoCapture* capture) { |
| 171 // TODO(vtl): add logic when this event handler is removed. |
| 172 } |
| 173 |
| 170 void PPB_VideoCapture_Impl::OnBufferReady( | 174 void PPB_VideoCapture_Impl::OnBufferReady( |
| 171 media::VideoCapture* capture, | 175 media::VideoCapture* capture, |
| 172 scoped_refptr<media::VideoCapture::VideoFrameBuffer> buffer) { | 176 scoped_refptr<media::VideoCapture::VideoFrameBuffer> buffer) { |
| 173 DCHECK(buffer.get()); | 177 DCHECK(buffer.get()); |
| 174 for (uint32_t i = 0; i < buffers_.size(); ++i) { | 178 for (uint32_t i = 0; i < buffers_.size(); ++i) { |
| 175 if (!buffers_[i].in_use) { | 179 if (!buffers_[i].in_use) { |
| 176 // TODO(piman): it looks like stride isn't actually used/filled. | 180 // TODO(piman): it looks like stride isn't actually used/filled. |
| 177 DCHECK(buffer->stride == 0); | 181 DCHECK(buffer->stride == 0); |
| 178 size_t size = std::min(static_cast<size_t>(buffers_[i].buffer->size()), | 182 size_t size = std::min(static_cast<size_t>(buffers_[i].buffer->size()), |
| 179 buffer->buffer_size); | 183 buffer->buffer_size); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 : in_use(false), | 258 : in_use(false), |
| 255 data(NULL), | 259 data(NULL), |
| 256 buffer() { | 260 buffer() { |
| 257 } | 261 } |
| 258 | 262 |
| 259 PPB_VideoCapture_Impl::BufferInfo::~BufferInfo() { | 263 PPB_VideoCapture_Impl::BufferInfo::~BufferInfo() { |
| 260 } | 264 } |
| 261 | 265 |
| 262 } // namespace ppapi | 266 } // namespace ppapi |
| 263 } // namespace webkit | 267 } // namespace webkit |
| OLD | NEW |