| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_MANAGER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_MANAGER_H_ |
| 7 | 7 |
| 8 #include <array> | 8 #include <array> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 using MediaDeviceEnumeration = | 33 using MediaDeviceEnumeration = |
| 34 std::array<MediaDeviceInfoArray, NUM_MEDIA_DEVICE_TYPES>; | 34 std::array<MediaDeviceInfoArray, NUM_MEDIA_DEVICE_TYPES>; |
| 35 | 35 |
| 36 // MediaDevicesManager is responsible for doing media-device enumerations. | 36 // MediaDevicesManager is responsible for doing media-device enumerations. |
| 37 // In addition it implements caching for enumeration results and device | 37 // In addition it implements caching for enumeration results and device |
| 38 // monitoring in order to keep caches consistent. | 38 // monitoring in order to keep caches consistent. |
| 39 // All its methods must be called on the IO thread. | 39 // All its methods must be called on the IO thread. |
| 40 class CONTENT_EXPORT MediaDevicesManager | 40 class CONTENT_EXPORT MediaDevicesManager |
| 41 : public base::SystemMonitor::DevicesChangedObserver { | 41 : public base::SystemMonitor::DevicesChangedObserver { |
| 42 public: | 42 public: |
| 43 // Use MediaDeviceType values to index on this type. | 43 // Use MediaDeviceType values to index on this type. By default all device |
| 44 using BoolDeviceTypes = std::array<bool, NUM_MEDIA_DEVICE_TYPES>; | 44 // types are false. |
| 45 class BoolDeviceTypes final |
| 46 : public std::array<bool, NUM_MEDIA_DEVICE_TYPES> { |
| 47 public: |
| 48 BoolDeviceTypes() { fill(false); } |
| 49 }; |
| 45 | 50 |
| 46 using EnumerationCallback = | 51 using EnumerationCallback = |
| 47 base::Callback<void(const MediaDeviceEnumeration&)>; | 52 base::Callback<void(const MediaDeviceEnumeration&)>; |
| 48 | 53 |
| 49 MediaDevicesManager( | 54 MediaDevicesManager( |
| 50 media::AudioManager* audio_manager, | 55 media::AudioManager* audio_manager, |
| 51 const scoped_refptr<VideoCaptureManager>& video_capture_manager, | 56 const scoped_refptr<VideoCaptureManager>& video_capture_manager, |
| 52 MediaStreamManager* media_stream_manager); | 57 MediaStreamManager* media_stream_manager); |
| 53 ~MediaDevicesManager() override; | 58 ~MediaDevicesManager() override; |
| 54 | 59 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 bool monitoring_started_; | 150 bool monitoring_started_; |
| 146 | 151 |
| 147 base::WeakPtrFactory<MediaDevicesManager> weak_factory_; | 152 base::WeakPtrFactory<MediaDevicesManager> weak_factory_; |
| 148 | 153 |
| 149 DISALLOW_COPY_AND_ASSIGN(MediaDevicesManager); | 154 DISALLOW_COPY_AND_ASSIGN(MediaDevicesManager); |
| 150 }; | 155 }; |
| 151 | 156 |
| 152 } // namespace content | 157 } // namespace content |
| 153 | 158 |
| 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_MANAGER_H_ | 159 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_MANAGER_H_ |
| OLD | NEW |