| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/renderer/media/remote_media_stream_impl.h" | 5 #include "content/renderer/media/remote_media_stream_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 void InitializeWebkitVideoTrack(std::unique_ptr<TrackObserver> observer, | 156 void InitializeWebkitVideoTrack(std::unique_ptr<TrackObserver> observer, |
| 157 bool enabled) { | 157 bool enabled) { |
| 158 DCHECK(main_thread_->BelongsToCurrentThread()); | 158 DCHECK(main_thread_->BelongsToCurrentThread()); |
| 159 std::unique_ptr<MediaStreamRemoteVideoSource> video_source( | 159 std::unique_ptr<MediaStreamRemoteVideoSource> video_source( |
| 160 new MediaStreamRemoteVideoSource(std::move(observer))); | 160 new MediaStreamRemoteVideoSource(std::move(observer))); |
| 161 InitializeWebkitTrack(blink::WebMediaStreamSource::TypeVideo); | 161 InitializeWebkitTrack(blink::WebMediaStreamSource::TypeVideo); |
| 162 webkit_track()->source().setExtraData(video_source.get()); | 162 webkit_track()->source().setExtraData(video_source.get()); |
| 163 MediaStreamVideoTrack::InitializeTrack(video_source.release(), |
| 164 *webkit_track()); |
| 163 // Initial constraints must be provided to a MediaStreamVideoTrack. But | 165 // Initial constraints must be provided to a MediaStreamVideoTrack. But |
| 164 // no constraints are available initially on a remote video track. | 166 // no constraints are available initially on a remote video track. |
| 165 blink::WebMediaConstraints constraints; | 167 /* blink::WebMediaConstraints constraints; |
| 166 constraints.initialize(); | 168 constraints.initialize(); |
| 167 MediaStreamVideoTrack* media_stream_track = | 169 MediaStreamVideoTrack* media_stream_track = |
| 168 new MediaStreamVideoTrack(video_source.release(), constraints, | 170 new MediaStreamVideoTrack(video_source.release(), constraints, |
| 169 MediaStreamVideoSource::ConstraintsCallback(), enabled); | 171 MediaStreamVideoSource::ConstraintsCallback(), enabled); |
| 170 webkit_track()->setTrackData(media_stream_track); | 172 webkit_track()->setTrackData(media_stream_track);*/ |
| 171 } | 173 } |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 // RemoteAudioTrackAdapter is responsible for listening on state | 176 // RemoteAudioTrackAdapter is responsible for listening on state |
| 175 // change notifications on a remote webrtc audio MediaStreamTracks and notify | 177 // change notifications on a remote webrtc audio MediaStreamTracks and notify |
| 176 // WebKit. | 178 // WebKit. |
| 177 class RemoteAudioTrackAdapter | 179 class RemoteAudioTrackAdapter |
| 178 : public RemoteMediaStreamTrackAdapter<webrtc::AudioTrackInterface>, | 180 : public RemoteMediaStreamTrackAdapter<webrtc::AudioTrackInterface>, |
| 179 public webrtc::ObserverInterface { | 181 public webrtc::ObserverInterface { |
| 180 public: | 182 public: |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // Unregister all the audio track observers that were not used. | 425 // Unregister all the audio track observers that were not used. |
| 424 // We need to do this before destruction since the observers can't unregister | 426 // We need to do this before destruction since the observers can't unregister |
| 425 // from within the dtor due to a race. | 427 // from within the dtor due to a race. |
| 426 for (auto& track : *audio_tracks.get()) { | 428 for (auto& track : *audio_tracks.get()) { |
| 427 if (track.get()) | 429 if (track.get()) |
| 428 track->Unregister(); | 430 track->Unregister(); |
| 429 } | 431 } |
| 430 } | 432 } |
| 431 | 433 |
| 432 } // namespace content | 434 } // namespace content |
| OLD | NEW |