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

Side by Side Diff: content/browser/renderer_host/media/video_capture_manager.cc

Issue 13616004: Switch event type when a capture device has been stopped from the render process. This make sure th… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed code review comments. Created 7 years, 8 months 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
OLDNEW
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/browser/renderer_host/media/video_capture_manager.h" 5 #include "content/browser/renderer_host/media/video_capture_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 FROM_HERE, 87 FROM_HERE,
88 base::Bind(&VideoCaptureManager::OnOpen, this, video_capture_session_id, 88 base::Bind(&VideoCaptureManager::OnOpen, this, video_capture_session_id,
89 device)); 89 device));
90 90
91 return video_capture_session_id; 91 return video_capture_session_id;
92 } 92 }
93 93
94 void VideoCaptureManager::Close(int capture_session_id) { 94 void VideoCaptureManager::Close(int capture_session_id) {
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
96 DCHECK(listener_); 96 DCHECK(listener_);
97 DVLOG(1) << "VideoCaptureManager::Close, id " << capture_session_id;
97 device_loop_->PostTask( 98 device_loop_->PostTask(
98 FROM_HERE, 99 FROM_HERE,
99 base::Bind(&VideoCaptureManager::OnClose, this, capture_session_id)); 100 base::Bind(&VideoCaptureManager::OnClose, this, capture_session_id));
100 } 101 }
101 102
102 void VideoCaptureManager::Start( 103 void VideoCaptureManager::Start(
103 const media::VideoCaptureParams& capture_params, 104 const media::VideoCaptureParams& capture_params,
104 media::VideoCaptureDevice::EventHandler* video_capture_receiver) { 105 media::VideoCaptureDevice::EventHandler* video_capture_receiver) {
105 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
106 device_loop_->PostTask( 107 device_loop_->PostTask(
107 FROM_HERE, 108 FROM_HERE,
108 base::Bind(&VideoCaptureManager::OnStart, this, capture_params, 109 base::Bind(&VideoCaptureManager::OnStart, this, capture_params,
109 video_capture_receiver)); 110 video_capture_receiver));
110 } 111 }
111 112
112 void VideoCaptureManager::Stop( 113 void VideoCaptureManager::Stop(
113 const media::VideoCaptureSessionId& capture_session_id, 114 const media::VideoCaptureSessionId& capture_session_id,
114 base::Closure stopped_cb) { 115 base::Closure stopped_cb) {
116 DVLOG(1) << "VideoCaptureManager::Stop, id " << capture_session_id;
115 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 117 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
116 device_loop_->PostTask( 118 device_loop_->PostTask(
117 FROM_HERE, 119 FROM_HERE,
118 base::Bind(&VideoCaptureManager::OnStop, this, capture_session_id, 120 base::Bind(&VideoCaptureManager::OnStop, this, capture_session_id,
119 stopped_cb)); 121 stopped_cb));
120 } 122 }
121 123
122 void VideoCaptureManager::UseFakeDevice() { 124 void VideoCaptureManager::UseFakeDevice() {
123 use_fake_device_ = true; 125 use_fake_device_ = true;
124 } 126 }
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 553
552 VideoCaptureDevices::iterator dit = devices_.find(capture_session_id); 554 VideoCaptureDevices::iterator dit = devices_.find(capture_session_id);
553 if (dit != devices_.end()) { 555 if (dit != devices_.end()) {
554 return dit->second.capture_device; 556 return dit->second.capture_device;
555 } 557 }
556 } 558 }
557 return NULL; 559 return NULL;
558 } 560 }
559 561
560 } // namespace content 562 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/video_capture_host.cc ('k') | content/common/media/video_capture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698