| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/pepper/pepper_platform_video_capture_impl.h" | 5 #include "content/renderer/pepper/pepper_platform_video_capture_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "content/renderer/media/video_capture_impl_manager.h" | 10 #include "content/renderer/media/video_capture_impl_manager.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 RenderThreadImpl::current()->video_capture_impl_manager(); | 48 RenderThreadImpl::current()->video_capture_impl_manager(); |
| 49 manager->RemoveDevice(session_id_, handler_proxy_.get()); | 49 manager->RemoveDevice(session_id_, handler_proxy_.get()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 if (plugin_delegate_ && !label_.empty()) | 52 if (plugin_delegate_ && !label_.empty()) |
| 53 plugin_delegate_->CloseDevice(label_); | 53 plugin_delegate_->CloseDevice(label_); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void PepperPlatformVideoCaptureImpl::StartCapture( | 56 void PepperPlatformVideoCaptureImpl::StartCapture( |
| 57 media::VideoCapture::EventHandler* handler, | 57 media::VideoCapture::EventHandler* handler, |
| 58 const VideoCaptureCapability& capability) { | 58 const media::VideoCaptureCapability& capability) { |
| 59 DCHECK(handler == handler_); | 59 DCHECK(handler == handler_); |
| 60 | 60 |
| 61 if (unbalanced_start_) | 61 if (unbalanced_start_) |
| 62 return; | 62 return; |
| 63 | 63 |
| 64 if (video_capture_) { | 64 if (video_capture_) { |
| 65 unbalanced_start_ = true; | 65 unbalanced_start_ = true; |
| 66 AddRef(); // Will be balanced in OnRemoved(). | 66 AddRef(); // Will be balanced in OnRemoved(). |
| 67 video_capture_->StartCapture(handler_proxy_.get(), capability); | 67 video_capture_->StartCapture(handler_proxy_.get(), capability); |
| 68 } | 68 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 session_id_ = plugin_delegate_->GetSessionID(PP_DEVICETYPE_DEV_VIDEOCAPTURE, | 170 session_id_ = plugin_delegate_->GetSessionID(PP_DEVICETYPE_DEV_VIDEOCAPTURE, |
| 171 label); | 171 label); |
| 172 Initialize(); | 172 Initialize(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 if (handler_) | 175 if (handler_) |
| 176 handler_->OnInitialized(this, succeeded); | 176 handler_->OnInitialized(this, succeeded); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace content | 179 } // namespace content |
| OLD | NEW |