Chromium Code Reviews| 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/browser/renderer_host/media/media_stream_manager.h" | 5 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 requests_.erase(it++); | 210 requests_.erase(it++); |
| 211 } else { | 211 } else { |
| 212 ++it; | 212 ++it; |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 } | 215 } |
| 216 | 216 |
| 217 void MediaStreamManager::CancelGeneratedStream(const std::string& label) { | |
|
wjia(left Chromium)
2012/06/06 06:18:21
This would be MediaStreamManager::CancelGenerateSt
| |
| 218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 219 | |
| 220 DeviceRequests::iterator it = requests_.find(label); | |
| 221 if (it != requests_.end()) { | |
| 222 device_settings_->RemovePendingCaptureRequest(label); | |
| 223 requests_.erase(it); | |
| 224 } | |
| 225 } | |
| 226 | |
| 217 void MediaStreamManager::StopGeneratedStream(const std::string& label) { | 227 void MediaStreamManager::StopGeneratedStream(const std::string& label) { |
| 218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 228 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 219 // Find the request and close all open devices for the request. | 229 // Find the request and close all open devices for the request. |
| 220 DeviceRequests::iterator it = requests_.find(label); | 230 DeviceRequests::iterator it = requests_.find(label); |
| 221 if (it != requests_.end()) { | 231 if (it != requests_.end()) { |
| 222 for (StreamDeviceInfoArray::iterator audio_it = | 232 for (StreamDeviceInfoArray::iterator audio_it = |
| 223 it->second.audio_devices.begin(); | 233 it->second.audio_devices.begin(); |
| 224 audio_it != it->second.audio_devices.end(); ++audio_it) { | 234 audio_it != it->second.audio_devices.end(); ++audio_it) { |
| 225 audio_input_device_manager()->Close(audio_it->session_id); | 235 audio_input_device_manager()->Close(audio_it->session_id); |
| 226 } | 236 } |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 if (stream_type == content::MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE) { | 666 if (stream_type == content::MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE) { |
| 657 return video_capture_manager(); | 667 return video_capture_manager(); |
| 658 } else if (stream_type == content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE) { | 668 } else if (stream_type == content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE) { |
| 659 return audio_input_device_manager(); | 669 return audio_input_device_manager(); |
| 660 } | 670 } |
| 661 NOTREACHED(); | 671 NOTREACHED(); |
| 662 return NULL; | 672 return NULL; |
| 663 } | 673 } |
| 664 | 674 |
| 665 } // namespace media_stream | 675 } // namespace media_stream |
| OLD | NEW |