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/public/common/media_stream_request.h" | 5 #include "content/public/common/media_stream_request.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 bool IsAudioMediaType(MediaStreamDeviceType type) { | 9 bool IsAudioMediaType(MediaStreamDeviceType type) { |
10 return (type == content::MEDIA_DEVICE_AUDIO_CAPTURE || | 10 return (type == content::MEDIA_DEVICE_AUDIO_CAPTURE || |
11 type == content::MEDIA_TAB_AUDIO_CAPTURE); | 11 type == content::MEDIA_TAB_AUDIO_CAPTURE); |
12 } | 12 } |
13 | 13 |
14 bool IsVideoMediaType(MediaStreamDeviceType type) { | 14 bool IsVideoMediaType(MediaStreamDeviceType type) { |
15 return (type == content::MEDIA_DEVICE_VIDEO_CAPTURE || | 15 return (type == content::MEDIA_DEVICE_VIDEO_CAPTURE || |
16 type == content::MEDIA_TAB_VIDEO_CAPTURE); | 16 type == content::MEDIA_TAB_VIDEO_CAPTURE); |
17 } | 17 } |
18 | 18 |
| 19 const char kMediaStreamTabDeviceScheme[] = "virtual://"; |
| 20 |
19 MediaStreamDevice::MediaStreamDevice( | 21 MediaStreamDevice::MediaStreamDevice( |
20 MediaStreamDeviceType type, | 22 MediaStreamDeviceType type, |
21 const std::string& device_id, | 23 const std::string& device_id, |
22 const std::string& name) | 24 const std::string& name) |
23 : type(type), | 25 : type(type), |
24 device_id(device_id), | 26 device_id(device_id), |
25 name(name) { | 27 name(name) { |
26 } | 28 } |
27 | 29 |
28 MediaStreamDevice::~MediaStreamDevice() {} | 30 MediaStreamDevice::~MediaStreamDevice() {} |
(...skipping 10 matching lines...) Expand all Loading... |
39 MediaStreamRequest::~MediaStreamRequest() { | 41 MediaStreamRequest::~MediaStreamRequest() { |
40 for (MediaStreamDeviceMap::iterator iter = devices.begin(); | 42 for (MediaStreamDeviceMap::iterator iter = devices.begin(); |
41 iter != devices.end(); | 43 iter != devices.end(); |
42 ++iter) { | 44 ++iter) { |
43 iter->second.clear(); | 45 iter->second.clear(); |
44 } | 46 } |
45 devices.clear(); | 47 devices.clear(); |
46 } | 48 } |
47 | 49 |
48 } // namespace content | 50 } // namespace content |
OLD | NEW |