| 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_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // ::mojom::MediaDevicesDispatcherHost implementation. | 50 // ::mojom::MediaDevicesDispatcherHost implementation. |
| 51 void EnumerateDevices(bool request_audio_input, | 51 void EnumerateDevices(bool request_audio_input, |
| 52 bool request_video_input, | 52 bool request_video_input, |
| 53 bool request_audio_output, | 53 bool request_audio_output, |
| 54 const url::Origin& security_origin, | 54 const url::Origin& security_origin, |
| 55 EnumerateDevicesCallback client_callback) override; | 55 EnumerateDevicesCallback client_callback) override; |
| 56 void GetVideoInputCapabilities( | 56 void GetVideoInputCapabilities( |
| 57 const url::Origin& security_origin, | 57 const url::Origin& security_origin, |
| 58 GetVideoInputCapabilitiesCallback client_callback) override; | 58 GetVideoInputCapabilitiesCallback client_callback) override; |
| 59 void GetAudioInputCapabilities( |
| 60 const url::Origin& security_origin, |
| 61 GetAudioInputCapabilitiesCallback client_callback) override; |
| 59 void SubscribeDeviceChangeNotifications( | 62 void SubscribeDeviceChangeNotifications( |
| 60 MediaDeviceType type, | 63 MediaDeviceType type, |
| 61 uint32_t subscription_id, | 64 uint32_t subscription_id, |
| 62 const url::Origin& security_origin) override; | 65 const url::Origin& security_origin) override; |
| 63 void UnsubscribeDeviceChangeNotifications(MediaDeviceType type, | 66 void UnsubscribeDeviceChangeNotifications(MediaDeviceType type, |
| 64 uint32_t subscription_id) override; | 67 uint32_t subscription_id) override; |
| 65 | 68 |
| 66 // MediaDeviceChangeSubscriber implementation. | 69 // MediaDeviceChangeSubscriber implementation. |
| 67 void OnDevicesChanged(MediaDeviceType type, | 70 void OnDevicesChanged(MediaDeviceType type, |
| 68 const MediaDeviceInfoArray& device_infos) override; | 71 const MediaDeviceInfoArray& device_infos) override; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 91 const url::Origin& security_origin, | 94 const url::Origin& security_origin, |
| 92 GetVideoInputCapabilitiesCallback client_callback, | 95 GetVideoInputCapabilitiesCallback client_callback, |
| 93 const std::string& default_device_id); | 96 const std::string& default_device_id); |
| 94 | 97 |
| 95 void FinalizeGetVideoInputCapabilities( | 98 void FinalizeGetVideoInputCapabilities( |
| 96 const url::Origin& security_origin, | 99 const url::Origin& security_origin, |
| 97 GetVideoInputCapabilitiesCallback client_callback, | 100 GetVideoInputCapabilitiesCallback client_callback, |
| 98 const std::string& default_device_id, | 101 const std::string& default_device_id, |
| 99 const media::VideoCaptureDeviceDescriptors& device_descriptors); | 102 const media::VideoCaptureDeviceDescriptors& device_descriptors); |
| 100 | 103 |
| 104 void GotDefaultAudioInputDeviceID(const url::Origin& security_origin, |
| 105 const std::string& default_device_id); |
| 106 |
| 107 void GotAudioInputEnumeration(const url::Origin& security_origin, |
| 108 const std::string& default_device_id, |
| 109 const MediaDeviceEnumeration& enumeration); |
| 110 |
| 111 void GotAudioInputParameters(size_t index, |
| 112 const media::AudioParameters& parameters); |
| 113 |
| 114 void FinalizeGetAudioInputCapabilities(); |
| 115 |
| 101 // Returns the currently supported video formats for the given |device_id|. | 116 // Returns the currently supported video formats for the given |device_id|. |
| 102 media::VideoCaptureFormats GetVideoInputFormats(const std::string& device_id); | 117 media::VideoCaptureFormats GetVideoInputFormats(const std::string& device_id); |
| 103 | 118 |
| 104 struct SubscriptionInfo; | 119 struct SubscriptionInfo; |
| 105 void NotifyDeviceChangeOnUIThread( | 120 void NotifyDeviceChangeOnUIThread( |
| 106 const std::vector<SubscriptionInfo>& subscriptions, | 121 const std::vector<SubscriptionInfo>& subscriptions, |
| 107 MediaDeviceType type, | 122 MediaDeviceType type, |
| 108 const MediaDeviceInfoArray& device_infos); | 123 const MediaDeviceInfoArray& device_infos); |
| 109 | 124 |
| 110 // The following const fields can be accessed on any thread. | 125 // The following const fields can be accessed on any thread. |
| 111 const int render_process_id_; | 126 const int render_process_id_; |
| 112 const int render_frame_id_; | 127 const int render_frame_id_; |
| 113 const std::string device_id_salt_; | 128 const std::string device_id_salt_; |
| 114 const std::string group_id_salt_; | 129 const std::string group_id_salt_; |
| 115 | 130 |
| 116 // The following fields can only be accessed on the IO thread. | 131 // The following fields can only be accessed on the IO thread. |
| 117 MediaStreamManager* media_stream_manager_; | 132 MediaStreamManager* media_stream_manager_; |
| 118 std::unique_ptr<MediaDevicesPermissionChecker> permission_checker_; | 133 std::unique_ptr<MediaDevicesPermissionChecker> permission_checker_; |
| 119 std::vector<SubscriptionInfo> | 134 std::vector<SubscriptionInfo> |
| 120 device_change_subscriptions_[NUM_MEDIA_DEVICE_TYPES]; | 135 device_change_subscriptions_[NUM_MEDIA_DEVICE_TYPES]; |
| 121 | 136 |
| 122 // This field can only be accessed on the UI thread. | 137 // This field can only be accessed on the UI thread. |
| 123 ::mojom::MediaDevicesListenerPtr device_change_listener_; | 138 ::mojom::MediaDevicesListenerPtr device_change_listener_; |
| 124 | 139 |
| 140 // Queued requests for audio-input capabilities. |
| 141 std::vector<GetAudioInputCapabilitiesCallback> |
| 142 pending_audio_input_capabilities_callbacks_; |
| 143 size_t num_pending_audio_input_parameters_; |
| 144 std::vector<::mojom::AudioInputDeviceCapabilities> |
| 145 current_audio_input_capabilities_; |
| 146 |
| 125 base::WeakPtrFactory<MediaDevicesDispatcherHost> weak_factory_; | 147 base::WeakPtrFactory<MediaDevicesDispatcherHost> weak_factory_; |
| 126 | 148 |
| 127 DISALLOW_COPY_AND_ASSIGN(MediaDevicesDispatcherHost); | 149 DISALLOW_COPY_AND_ASSIGN(MediaDevicesDispatcherHost); |
| 128 }; | 150 }; |
| 129 | 151 |
| 130 } // namespace content | 152 } // namespace content |
| 131 | 153 |
| 132 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ | 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ |
| OLD | NEW |