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

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

Issue 9389006: Changed VideoCaptureController to use correct session id when stopping the capture device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright year Created 8 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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_controller.h" 5 #include "content/browser/renderer_host/media/video_capture_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/browser/renderer_host/media/media_stream_manager.h" 10 #include "content/browser/renderer_host/media/media_stream_manager.h"
11 #include "content/browser/renderer_host/media/video_capture_manager.h" 11 #include "content/browser/renderer_host/media/video_capture_manager.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // Normal way to stop capture. 183 // Normal way to stop capture.
184 if (!client->buffers.empty()) { 184 if (!client->buffers.empty()) {
185 // There are still some buffers held by the client. 185 // There are still some buffers held by the client.
186 client->report_ready_to_delete = true; 186 client->report_ready_to_delete = true;
187 return; 187 return;
188 } 188 }
189 // No buffer is held by the client. Ready to delete. 189 // No buffer is held by the client. Ready to delete.
190 client->event_handler->OnReadyToDelete(client->controller_id); 190 client->event_handler->OnReadyToDelete(client->controller_id);
191 } 191 }
192 192
193 int session_id = client->parameters.session_id;
193 delete client; 194 delete client;
194 controller_clients_.remove(client); 195 controller_clients_.remove(client);
195 196
196 // No more clients. Stop device. 197 // No more clients. Stop device.
197 if (controller_clients_.empty()) { 198 if (controller_clients_.empty()) {
198 video_capture_manager_->Stop(current_params_.session_id, 199 video_capture_manager_->Stop(session_id,
199 base::Bind(&VideoCaptureController::OnDeviceStopped, this)); 200 base::Bind(&VideoCaptureController::OnDeviceStopped, this));
200 frame_info_available_ = false; 201 frame_info_available_ = false;
201 state_ = video_capture::kStopping; 202 state_ = video_capture::kStopping;
202 } 203 }
203 } 204 }
204 205
205 void VideoCaptureController::ReturnBuffer( 206 void VideoCaptureController::ReturnBuffer(
206 const VideoCaptureControllerID& id, 207 const VideoCaptureControllerID& id,
207 VideoCaptureControllerEventHandler* event_handler, 208 VideoCaptureControllerEventHandler* event_handler,
208 int buffer_id) { 209 int buffer_id) {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 524 }
524 525
525 void VideoCaptureController::DoDeviceStoppedOnIOThread() { 526 void VideoCaptureController::DoDeviceStoppedOnIOThread() {
526 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 527 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
527 device_in_use_ = false; 528 device_in_use_ = false;
528 if (state_ == video_capture::kStopping) { 529 if (state_ == video_capture::kStopping) {
529 PostStopping(); 530 PostStopping();
530 } 531 }
531 } 532 }
532 533
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698