Chromium Code Reviews| Index: content/browser/renderer_host/media/media_stream_manager.cc |
| diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc |
| index e8c23abce0aa7e5a1a4d2480de8e5c991a1ac471..8bd1bc4bc13eb92f0a812d4d39aae7c0c4415592 100644 |
| --- a/content/browser/renderer_host/media/media_stream_manager.cc |
| +++ b/content/browser/renderer_host/media/media_stream_manager.cc |
| @@ -597,6 +597,21 @@ void MediaStreamManager::StopStreamDevice(int render_process_id, |
| } |
| } |
| +int MediaStreamManager::VideoDeviceIdToSessionId( |
|
miu
2016/05/04 23:45:50
The device_id is mapped to a session_id, and then
mcasas
2016/05/05 00:57:12
I wish it was that simple. The MSM has a map from
miu
2016/05/05 22:04:24
OIC. One more thought: Could the renderer provide
|
| + const std::string& device_id) const { |
| + DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| + |
| + for (const LabeledDeviceRequest& device_request : requests_) { |
| + for (const StreamDeviceInfo& info : device_request.second->devices) { |
| + if (info.device.id == device_id) { |
| + DCHECK_EQ(MEDIA_DEVICE_VIDEO_CAPTURE, info.device.type); |
| + return info.session_id; |
| + } |
| + } |
| + } |
| + return StreamDeviceInfo::kNoId; |
| +} |
| + |
| void MediaStreamManager::StopDevice(MediaStreamType type, int session_id) { |
| DVLOG(1) << "StopDevice" |
| << "{type = " << type << "}" |