| 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) { |
| 10 return (type == content::MEDIA_DEVICE_AUDIO_CAPTURE || |
| 11 type == content::MEDIA_TAB_AUDIO_CAPTURE); |
| 12 } |
| 13 |
| 14 bool IsVideoMediaType(MediaStreamDeviceType type) { |
| 15 return (type == content::MEDIA_DEVICE_VIDEO_CAPTURE || |
| 16 type == content::MEDIA_TAB_VIDEO_CAPTURE); |
| 17 } |
| 18 |
| 9 MediaStreamDevice::MediaStreamDevice( | 19 MediaStreamDevice::MediaStreamDevice( |
| 10 MediaStreamDeviceType type, | 20 MediaStreamDeviceType type, |
| 11 const std::string& device_id, | 21 const std::string& device_id, |
| 12 const std::string& name) | 22 const std::string& name) |
| 13 : type(type), | 23 : type(type), |
| 14 device_id(device_id), | 24 device_id(device_id), |
| 15 name(name) { | 25 name(name) { |
| 16 } | 26 } |
| 17 | 27 |
| 18 MediaStreamDevice::~MediaStreamDevice() {} | 28 MediaStreamDevice::~MediaStreamDevice() {} |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 MediaStreamRequest::~MediaStreamRequest() { | 39 MediaStreamRequest::~MediaStreamRequest() { |
| 30 for (MediaStreamDeviceMap::iterator iter = devices.begin(); | 40 for (MediaStreamDeviceMap::iterator iter = devices.begin(); |
| 31 iter != devices.end(); | 41 iter != devices.end(); |
| 32 ++iter) { | 42 ++iter) { |
| 33 iter->second.clear(); | 43 iter->second.clear(); |
| 34 } | 44 } |
| 35 devices.clear(); | 45 devices.clear(); |
| 36 } | 46 } |
| 37 | 47 |
| 38 } // namespace content | 48 } // namespace content |
| OLD | NEW |