| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "content/renderer/media/media_stream.h" | 11 #include "content/renderer/media/media_stream.h" |
| 12 #include "content/renderer/media/media_stream_dependency_factory.h" | |
| 13 #include "content/renderer/media/media_stream_video_track.h" | 12 #include "content/renderer/media/media_stream_video_track.h" |
| 14 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" | 13 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" |
| 14 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
| 15 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 void InitializeWebkitTrack(webrtc::MediaStreamTrackInterface* track, | 21 void InitializeWebkitTrack(webrtc::MediaStreamTrackInterface* track, |
| 22 blink::WebMediaStreamTrack* webkit_track, | 22 blink::WebMediaStreamTrack* webkit_track, |
| 23 blink::WebMediaStreamSource::Type type) { | 23 blink::WebMediaStreamSource::Type type) { |
| 24 blink::WebMediaStreamSource webkit_source; | 24 blink::WebMediaStreamSource webkit_source; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 35 // Initial constraints must be provided to a MediaStreamVideoTrack. But | 35 // Initial constraints must be provided to a MediaStreamVideoTrack. But |
| 36 // no constraints are available initially on a remote video track. | 36 // no constraints are available initially on a remote video track. |
| 37 blink::WebMediaConstraints constraints; | 37 blink::WebMediaConstraints constraints; |
| 38 constraints.initialize(); | 38 constraints.initialize(); |
| 39 webkit_track->setExtraData( | 39 webkit_track->setExtraData( |
| 40 new MediaStreamVideoTrack(video_source, constraints, | 40 new MediaStreamVideoTrack(video_source, constraints, |
| 41 MediaStreamVideoSource::ConstraintsCallback(), | 41 MediaStreamVideoSource::ConstraintsCallback(), |
| 42 track->enabled())); | 42 track->enabled())); |
| 43 } else { | 43 } else { |
| 44 DCHECK(type == blink::WebMediaStreamSource::TypeAudio); | 44 DCHECK(type == blink::WebMediaStreamSource::TypeAudio); |
| 45 content::MediaStreamDependencyFactory::AddNativeAudioTrackToBlinkTrack( | 45 content::PeerConnectionDependencyFactory::AddNativeAudioTrackToBlinkTrack( |
| 46 track, *webkit_track, false); | 46 track, *webkit_track, false); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 // Base class used for mapping between webrtc and blink MediaStream tracks. | 52 // Base class used for mapping between webrtc and blink MediaStream tracks. |
| 53 // An instance of a RemoteMediaStreamTrackAdapter is stored in | 53 // An instance of a RemoteMediaStreamTrackAdapter is stored in |
| 54 // RemoteMediaStreamImpl per remote audio and video track. | 54 // RemoteMediaStreamImpl per remote audio and video track. |
| 55 class RemoteMediaStreamTrackAdapter { | 55 class RemoteMediaStreamTrackAdapter { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 InitializeWebkitTrack(*it, &new_track, | 248 InitializeWebkitTrack(*it, &new_track, |
| 249 blink::WebMediaStreamSource::TypeVideo); | 249 blink::WebMediaStreamSource::TypeVideo); |
| 250 video_track_observers_.push_back( | 250 video_track_observers_.push_back( |
| 251 new RemoteMediaStreamTrackAdapter(*it, new_track)); | 251 new RemoteMediaStreamTrackAdapter(*it, new_track)); |
| 252 webkit_stream_.addTrack(new_track); | 252 webkit_stream_.addTrack(new_track); |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace content | 257 } // namespace content |
| OLD | NEW |