| 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 30 matching lines...) Expand all Loading... |
| 41 MediaStreamManager* media_stream_manager, | 41 MediaStreamManager* media_stream_manager, |
| 42 ::mojom::MediaDevicesDispatcherHostRequest request); | 42 ::mojom::MediaDevicesDispatcherHostRequest request); |
| 43 | 43 |
| 44 // ::mojom::MediaDevicesDispatcherHost implementation. | 44 // ::mojom::MediaDevicesDispatcherHost implementation. |
| 45 void EnumerateDevices( | 45 void EnumerateDevices( |
| 46 bool request_audio_input, | 46 bool request_audio_input, |
| 47 bool request_video_input, | 47 bool request_video_input, |
| 48 bool request_audio_output, | 48 bool request_audio_output, |
| 49 const url::Origin& security_origin, | 49 const url::Origin& security_origin, |
| 50 const EnumerateDevicesCallback& client_callback) override; | 50 const EnumerateDevicesCallback& client_callback) override; |
| 51 void GetVideoInputCapabilities( |
| 52 const url::Origin& security_origin, |
| 53 const GetVideoInputCapabilitiesCallback& client_callback) override; |
| 51 void SubscribeDeviceChangeNotifications( | 54 void SubscribeDeviceChangeNotifications( |
| 52 MediaDeviceType type, | 55 MediaDeviceType type, |
| 53 uint32_t subscription_id, | 56 uint32_t subscription_id, |
| 54 const url::Origin& security_origin) override; | 57 const url::Origin& security_origin) override; |
| 55 void UnsubscribeDeviceChangeNotifications(MediaDeviceType type, | 58 void UnsubscribeDeviceChangeNotifications(MediaDeviceType type, |
| 56 uint32_t subscription_id) override; | 59 uint32_t subscription_id) override; |
| 57 | 60 |
| 58 // MediaDeviceChangeSubscriber implementation. | 61 // MediaDeviceChangeSubscriber implementation. |
| 59 void OnDevicesChanged(MediaDeviceType type, | 62 void OnDevicesChanged(MediaDeviceType type, |
| 60 const MediaDeviceInfoArray& device_infos) override; | 63 const MediaDeviceInfoArray& device_infos) override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 72 const EnumerateDevicesCallback& client_callback, | 75 const EnumerateDevicesCallback& client_callback, |
| 73 const MediaDevicesManager::BoolDeviceTypes& permissions); | 76 const MediaDevicesManager::BoolDeviceTypes& permissions); |
| 74 | 77 |
| 75 void DevicesEnumerated( | 78 void DevicesEnumerated( |
| 76 const MediaDevicesManager::BoolDeviceTypes& requested_types, | 79 const MediaDevicesManager::BoolDeviceTypes& requested_types, |
| 77 const url::Origin& security_origin, | 80 const url::Origin& security_origin, |
| 78 const EnumerateDevicesCallback& client_callback, | 81 const EnumerateDevicesCallback& client_callback, |
| 79 const MediaDevicesManager::BoolDeviceTypes& has_permissions, | 82 const MediaDevicesManager::BoolDeviceTypes& has_permissions, |
| 80 const MediaDeviceEnumeration& enumeration); | 83 const MediaDeviceEnumeration& enumeration); |
| 81 | 84 |
| 85 void GotDefaultVideoInputDeviceID( |
| 86 const url::Origin& security_origin, |
| 87 const GetVideoInputCapabilitiesCallback& client_callback, |
| 88 const std::string& default_device_id); |
| 89 |
| 90 void FinalizeGetVideoInputCapabilities( |
| 91 const url::Origin& security_origin, |
| 92 const GetVideoInputCapabilitiesCallback& client_callback, |
| 93 const std::string& default_device_id, |
| 94 const MediaDeviceEnumeration& enumeration); |
| 95 |
| 96 // Returns the currently supported video formats for the given |device_id|. |
| 97 media::VideoCaptureFormats GetVideoInputFormats(const std::string& device_id); |
| 98 |
| 82 struct SubscriptionInfo; | 99 struct SubscriptionInfo; |
| 83 void NotifyDeviceChangeOnUIThread( | 100 void NotifyDeviceChangeOnUIThread( |
| 84 const std::vector<SubscriptionInfo>& subscriptions, | 101 const std::vector<SubscriptionInfo>& subscriptions, |
| 85 MediaDeviceType type, | 102 MediaDeviceType type, |
| 86 const MediaDeviceInfoArray& device_infos); | 103 const MediaDeviceInfoArray& device_infos); |
| 87 | 104 |
| 88 // The following const fields can be accessed on any thread. | 105 // The following const fields can be accessed on any thread. |
| 89 const int render_process_id_; | 106 const int render_process_id_; |
| 90 const int render_frame_id_; | 107 const int render_frame_id_; |
| 91 const std::string device_id_salt_; | 108 const std::string device_id_salt_; |
| 92 const std::string group_id_salt_; | 109 const std::string group_id_salt_; |
| 93 | 110 |
| 94 // The following fields can only be accessed on the IO thread. | 111 // The following fields can only be accessed on the IO thread. |
| 95 MediaStreamManager* media_stream_manager_; | 112 MediaStreamManager* media_stream_manager_; |
| 96 std::unique_ptr<MediaDevicesPermissionChecker> permission_checker_; | 113 std::unique_ptr<MediaDevicesPermissionChecker> permission_checker_; |
| 97 std::vector<SubscriptionInfo> | 114 std::vector<SubscriptionInfo> |
| 98 device_change_subscriptions_[NUM_MEDIA_DEVICE_TYPES]; | 115 device_change_subscriptions_[NUM_MEDIA_DEVICE_TYPES]; |
| 99 | 116 |
| 100 // This field can only be accessed on the UI thread. | 117 // This field can only be accessed on the UI thread. |
| 101 ::mojom::MediaDevicesListenerPtr device_change_listener_; | 118 ::mojom::MediaDevicesListenerPtr device_change_listener_; |
| 102 | 119 |
| 103 base::WeakPtrFactory<MediaDevicesDispatcherHost> weak_factory_; | 120 base::WeakPtrFactory<MediaDevicesDispatcherHost> weak_factory_; |
| 104 | 121 |
| 105 DISALLOW_COPY_AND_ASSIGN(MediaDevicesDispatcherHost); | 122 DISALLOW_COPY_AND_ASSIGN(MediaDevicesDispatcherHost); |
| 106 }; | 123 }; |
| 107 | 124 |
| 108 } // namespace content | 125 } // namespace content |
| 109 | 126 |
| 110 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ | 127 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_DEVICES_DISPATCHER_HOST_H_ |
| OLD | NEW |