| Index: trunk/src/content/renderer/pepper/pepper_platform_video_capture.cc
|
| ===================================================================
|
| --- trunk/src/content/renderer/pepper/pepper_platform_video_capture.cc (revision 244357)
|
| +++ trunk/src/content/renderer/pepper/pepper_platform_video_capture.cc (working copy)
|
| @@ -28,6 +28,7 @@
|
| handler_proxy_(new media::VideoCaptureHandlerProxy(
|
| this, base::MessageLoopProxy::current())),
|
| handler_(handler),
|
| + video_capture_(NULL),
|
| unbalanced_start_(false),
|
| pending_open_device_(false),
|
| pending_open_device_id_(-1) {
|
| @@ -82,7 +83,12 @@
|
| handler_ = NULL;
|
| StopCapture(NULL);
|
|
|
| - video_capture_.reset();
|
| + if (video_capture_) {
|
| + VideoCaptureImplManager* manager =
|
| + RenderThreadImpl::current()->video_capture_impl_manager();
|
| + manager->RemoveDevice(session_id_, handler_proxy_.get());
|
| + video_capture_ = NULL;
|
| + }
|
|
|
| if (render_view_.get()) {
|
| if (!label_.empty()) {
|
| @@ -141,7 +147,7 @@
|
| void PepperPlatformVideoCapture::Initialize() {
|
| VideoCaptureImplManager* manager =
|
| RenderThreadImpl::current()->video_capture_impl_manager();
|
| - video_capture_ = manager->UseDevice(session_id_);
|
| + video_capture_ = manager->AddDevice(session_id_, handler_proxy_.get());
|
| }
|
|
|
| void PepperPlatformVideoCapture::OnDeviceOpened(int request_id,
|
|
|