| 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 #ifndef CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace base { | 35 namespace base { |
| 36 class TaskRunner; | 36 class TaskRunner; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace content { | 39 namespace content { |
| 40 class PeerConnectionDependencyFactory; | 40 class PeerConnectionDependencyFactory; |
| 41 class MediaStreamAudioSource; | 41 class MediaStreamAudioSource; |
| 42 class MediaStreamDispatcher; | 42 class MediaStreamDispatcher; |
| 43 class MediaStreamVideoSource; | 43 class MediaStreamVideoSource; |
| 44 class VideoContentCaptureSourceSelectionResult; | 44 class VideoCaptureSettings; |
| 45 class VideoDeviceCaptureSourceSelectionResult; | |
| 46 | 45 |
| 47 // UserMediaClientImpl is a delegate for the Media Stream GetUserMedia API. | 46 // UserMediaClientImpl is a delegate for the Media Stream GetUserMedia API. |
| 48 // It ties together WebKit and MediaStreamManager | 47 // It ties together WebKit and MediaStreamManager |
| 49 // (via MediaStreamDispatcher and MediaStreamDispatcherHost) | 48 // (via MediaStreamDispatcher and MediaStreamDispatcherHost) |
| 50 // in the browser process. It must be created, called and destroyed on the | 49 // in the browser process. It must be created, called and destroyed on the |
| 51 // render thread. | 50 // render thread. |
| 52 class CONTENT_EXPORT UserMediaClientImpl | 51 class CONTENT_EXPORT UserMediaClientImpl |
| 53 : public RenderFrameObserver, | 52 : public RenderFrameObserver, |
| 54 NON_EXPORTED_BASE(public blink::WebUserMediaClient), | 53 NON_EXPORTED_BASE(public blink::WebUserMediaClient), |
| 55 public MediaStreamDispatcherEventHandler, | 54 public MediaStreamDispatcherEventHandler, |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 bool notify_dispatcher); | 227 bool notify_dispatcher); |
| 229 | 228 |
| 230 const ::mojom::MediaDevicesDispatcherHostPtr& GetMediaDevicesDispatcher(); | 229 const ::mojom::MediaDevicesDispatcherHostPtr& GetMediaDevicesDispatcher(); |
| 231 | 230 |
| 232 void SelectAudioInputDevice( | 231 void SelectAudioInputDevice( |
| 233 const blink::WebUserMediaRequest& user_media_request, | 232 const blink::WebUserMediaRequest& user_media_request, |
| 234 const EnumerationResult& device_enumeration); | 233 const EnumerationResult& device_enumeration); |
| 235 | 234 |
| 236 void SetupVideoInput(const blink::WebUserMediaRequest& user_media_request); | 235 void SetupVideoInput(const blink::WebUserMediaRequest& user_media_request); |
| 237 | 236 |
| 238 void SelectVideoDeviceSourceSettings( | 237 void SelectVideoDeviceSettings( |
| 239 const blink::WebUserMediaRequest& user_media_request, | 238 const blink::WebUserMediaRequest& user_media_request, |
| 240 std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> | 239 std::vector<::mojom::VideoInputDeviceCapabilitiesPtr> |
| 241 video_input_capabilities); | 240 video_input_capabilities); |
| 242 | 241 |
| 243 void FinalizeSelectVideoDeviceSourceSettings( | 242 void FinalizeSelectVideoDeviceSettings( |
| 244 const blink::WebUserMediaRequest& user_media_request, | 243 const blink::WebUserMediaRequest& user_media_request, |
| 245 const VideoDeviceCaptureSourceSelectionResult& selection_result); | 244 const VideoCaptureSettings& settings); |
| 246 | 245 |
| 247 void FinalizeSelectVideoContentSourceSettings( | 246 void FinalizeSelectVideoContentSettings( |
| 248 const blink::WebUserMediaRequest& user_media_request, | 247 const blink::WebUserMediaRequest& user_media_request, |
| 249 const VideoContentCaptureSourceSelectionResult& selection_result); | 248 const VideoCaptureSettings& settings); |
| 250 | 249 |
| 251 void GenerateStreamForCurrentRequestInfo(); | 250 void GenerateStreamForCurrentRequestInfo(); |
| 252 | 251 |
| 253 // Callback invoked by MediaDevicesEventDispatcher when a device-change | 252 // Callback invoked by MediaDevicesEventDispatcher when a device-change |
| 254 // notification arrives. | 253 // notification arrives. |
| 255 void DevicesChanged(MediaDeviceType device_type, | 254 void DevicesChanged(MediaDeviceType device_type, |
| 256 const MediaDeviceInfoArray& device_infos); | 255 const MediaDeviceInfoArray& device_infos); |
| 257 | 256 |
| 258 // Weak ref to a PeerConnectionDependencyFactory, owned by the RenderThread. | 257 // Weak ref to a PeerConnectionDependencyFactory, owned by the RenderThread. |
| 259 // It's valid for the lifetime of RenderThread. | 258 // It's valid for the lifetime of RenderThread. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 286 // Note: This member must be the last to ensure all outstanding weak pointers | 285 // Note: This member must be the last to ensure all outstanding weak pointers |
| 287 // are invalidated first. | 286 // are invalidated first. |
| 288 base::WeakPtrFactory<UserMediaClientImpl> weak_factory_; | 287 base::WeakPtrFactory<UserMediaClientImpl> weak_factory_; |
| 289 | 288 |
| 290 DISALLOW_COPY_AND_ASSIGN(UserMediaClientImpl); | 289 DISALLOW_COPY_AND_ASSIGN(UserMediaClientImpl); |
| 291 }; | 290 }; |
| 292 | 291 |
| 293 } // namespace content | 292 } // namespace content |
| 294 | 293 |
| 295 #endif // CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ | 294 #endif // CONTENT_RENDERER_MEDIA_USER_MEDIA_CLIENT_IMPL_H_ |
| OLD | NEW |