| Index: content/renderer/media/user_media_client_impl.h
|
| diff --git a/content/renderer/media/user_media_client_impl.h b/content/renderer/media/user_media_client_impl.h
|
| index a4b77df11aab7201f1575c2ebcbf76402d12f0e7..2492ccc00bebd8fc887990a2b46527f765a0e549 100644
|
| --- a/content/renderer/media/user_media_client_impl.h
|
| +++ b/content/renderer/media/user_media_client_impl.h
|
| @@ -119,8 +119,7 @@
|
| // These are virtual for test purposes.
|
| virtual MediaStreamAudioSource* CreateAudioSource(
|
| const StreamDeviceInfo& device,
|
| - const blink::WebMediaConstraints& constraints,
|
| - const MediaStreamSource::ConstraintsCallback& source_ready);
|
| + const blink::WebMediaConstraints& constraints);
|
| virtual MediaStreamVideoSource* CreateVideoSource(
|
| const StreamDeviceInfo& device,
|
| const MediaStreamSource::SourceStoppedCallback& stop_callback);
|
| @@ -147,8 +146,7 @@
|
| blink::WebMediaStream web_stream;
|
| blink::WebUserMediaRequest request;
|
|
|
| - void StartAudioTrack(const blink::WebMediaStreamTrack& track,
|
| - bool source_initialized);
|
| + void StartAudioTrack(const blink::WebMediaStreamTrack& track);
|
|
|
| blink::WebMediaStreamTrack CreateAndStartVideoTrack(
|
| const blink::WebMediaStreamSource& source,
|
| @@ -158,19 +156,16 @@
|
| // successfully started, or a source has failed to start.
|
| void CallbackOnTracksStarted(const ResourcesReady& callback);
|
|
|
| + bool IsSourceUsed(const blink::WebMediaStreamSource& source) const;
|
| + void RemoveSource(const blink::WebMediaStreamSource& source);
|
| +
|
| bool HasPendingSources() const;
|
| -
|
| - // Called when a local audio source has finished (or failed) initializing.
|
| - void OnAudioSourceStarted(MediaStreamSource* source,
|
| - MediaStreamRequestResult result,
|
| - const blink::WebString& result_name);
|
|
|
| private:
|
| void OnTrackStarted(
|
| MediaStreamSource* source,
|
| MediaStreamRequestResult result,
|
| const blink::WebString& result_name);
|
| -
|
| void CheckAllTracksStarted();
|
|
|
| ResourcesReady ready_callback_;
|
| @@ -198,16 +193,11 @@
|
|
|
| // Creates a WebKit representation of stream sources based on
|
| // |devices| from the MediaStreamDispatcher.
|
| - void InitializeVideoSourceObject(
|
| + void InitializeSourceObject(
|
| const StreamDeviceInfo& device,
|
| + blink::WebMediaStreamSource::Type type,
|
| const blink::WebMediaConstraints& constraints,
|
| blink::WebMediaStreamSource* webkit_source);
|
| -
|
| - void InitializeAudioSourceObject(
|
| - const StreamDeviceInfo& device,
|
| - const blink::WebMediaConstraints& constraints,
|
| - blink::WebMediaStreamSource* webkit_source,
|
| - bool* source_initialized);
|
|
|
| void CreateVideoTracks(
|
| const StreamDeviceInfoArray& devices,
|
| @@ -232,23 +222,6 @@
|
| const StreamDeviceInfoArray& audio_array,
|
| const StreamDeviceInfoArray& video_array);
|
|
|
| - static void OnAudioSourceStartedOnAudioThread(
|
| - scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| - base::WeakPtr<UserMediaClientImpl> weak_ptr,
|
| - MediaStreamSource* source,
|
| - MediaStreamRequestResult result,
|
| - const blink::WebString& result_name);
|
| -
|
| - static void OnAudioSourceStartedOnMainThread(
|
| - base::WeakPtr<UserMediaClientImpl> weak_ptr,
|
| - MediaStreamSource* source,
|
| - MediaStreamRequestResult result,
|
| - const blink::WebString& result_name);
|
| -
|
| - void OnAudioSourceStarted(MediaStreamSource* source,
|
| - MediaStreamRequestResult result,
|
| - const blink::WebString& result_name);
|
| -
|
| using EnumerationResult = std::vector<MediaDeviceInfoArray>;
|
| void FinalizeEnumerateDevices(blink::WebMediaDevicesRequest request,
|
| const EnumerationResult& result);
|
| @@ -258,21 +231,7 @@
|
| // Returns the source that use a device with |device.session_id|
|
| // and |device.device.id|. NULL if such source doesn't exist.
|
| const blink::WebMediaStreamSource* FindLocalSource(
|
| - const StreamDeviceInfo& device) const {
|
| - return FindLocalSource(local_sources_, device);
|
| - }
|
| - const blink::WebMediaStreamSource* FindPendingLocalSource(
|
| - const StreamDeviceInfo& device) const {
|
| - return FindLocalSource(pending_local_sources_, device);
|
| - }
|
| - const blink::WebMediaStreamSource* FindLocalSource(
|
| - const LocalStreamSources& sources,
|
| const StreamDeviceInfo& device) const;
|
| -
|
| - // Looks up a local source and returns it if found. If not found, prepares
|
| - // a new WebMediaStreamSource with a NULL extraData pointer.
|
| - blink::WebMediaStreamSource FindOrInitializeSourceObject(
|
| - const StreamDeviceInfo& device);
|
|
|
| // Returns true if we do find and remove the |source|.
|
| // Otherwise returns false.
|
| @@ -315,7 +274,6 @@
|
| ::mojom::MediaDevicesDispatcherHostPtr media_devices_dispatcher_;
|
|
|
| LocalStreamSources local_sources_;
|
| - LocalStreamSources pending_local_sources_;
|
|
|
| UserMediaRequests user_media_requests_;
|
| MediaDevicesEventDispatcher::SubscriptionIdList
|
|
|