| 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 #include "content/renderer/media/media_stream_center.h" | 5 #include "content/renderer/media/media_stream_center.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // Only local audio track is supported now. | 147 // Only local audio track is supported now. |
| 148 // TODO(xians): Support remote audio track. | 148 // TODO(xians): Support remote audio track. |
| 149 if (!media_stream_track || !media_stream_track->is_local_track ()) { | 149 if (!media_stream_track || !media_stream_track->is_local_track ()) { |
| 150 NOTIMPLEMENTED(); | 150 NOTIMPLEMENTED(); |
| 151 return NULL; | 151 return NULL; |
| 152 } | 152 } |
| 153 | 153 |
| 154 blink::WebMediaStreamSource source = track.source(); | 154 blink::WebMediaStreamSource source = track.source(); |
| 155 DCHECK_EQ(source.type(), blink::WebMediaStreamSource::TypeAudio); | 155 DCHECK_EQ(source.type(), blink::WebMediaStreamSource::TypeAudio); |
| 156 WebRtcLocalAudioSourceProvider* source_provider = | 156 WebRtcLocalAudioSourceProvider* source_provider = |
| 157 new WebRtcLocalAudioSourceProvider(); | 157 new WebRtcLocalAudioSourceProvider(track); |
| 158 MediaStreamAudioSink::AddToAudioTrack(source_provider, track); | |
| 159 return source_provider; | 158 return source_provider; |
| 160 } | 159 } |
| 161 | 160 |
| 162 void MediaStreamCenter::didStopLocalMediaStream( | 161 void MediaStreamCenter::didStopLocalMediaStream( |
| 163 const blink::WebMediaStream& stream) { | 162 const blink::WebMediaStream& stream) { |
| 164 DVLOG(1) << "MediaStreamCenter::didStopLocalMediaStream"; | 163 DVLOG(1) << "MediaStreamCenter::didStopLocalMediaStream"; |
| 165 MediaStream* native_stream = MediaStream::GetMediaStream(stream); | 164 MediaStream* native_stream = MediaStream::GetMediaStream(stream); |
| 166 if (!native_stream) { | 165 if (!native_stream) { |
| 167 NOTREACHED(); | 166 NOTREACHED(); |
| 168 return; | 167 return; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 device.type == MEDIA_DEVICE_AUDIO_CAPTURE | 271 device.type == MEDIA_DEVICE_AUDIO_CAPTURE |
| 273 ? blink::WebSourceInfo::SourceKindAudio | 272 ? blink::WebSourceInfo::SourceKindAudio |
| 274 : blink::WebSourceInfo::SourceKindVideo, | 273 : blink::WebSourceInfo::SourceKindVideo, |
| 275 blink::WebString::fromUTF8(device.name), | 274 blink::WebString::fromUTF8(device.name), |
| 276 video_facing); | 275 video_facing); |
| 277 } | 276 } |
| 278 request_it->second.requestSucceeded(sourceInfos); | 277 request_it->second.requestSucceeded(sourceInfos); |
| 279 } | 278 } |
| 280 | 279 |
| 281 } // namespace content | 280 } // namespace content |
| OLD | NEW |