| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 void CreateNativeVideoMediaStreamTrack( | 47 void CreateNativeVideoMediaStreamTrack( |
| 48 const blink::WebMediaStreamTrack& track, | 48 const blink::WebMediaStreamTrack& track, |
| 49 MediaStreamDependencyFactory* factory) { | 49 MediaStreamDependencyFactory* factory) { |
| 50 DCHECK(track.extraData() == NULL); | 50 DCHECK(track.extraData() == NULL); |
| 51 blink::WebMediaStreamSource source = track.source(); | 51 blink::WebMediaStreamSource source = track.source(); |
| 52 DCHECK_EQ(source.type(), blink::WebMediaStreamSource::TypeVideo); | 52 DCHECK_EQ(source.type(), blink::WebMediaStreamSource::TypeVideo); |
| 53 MediaStreamVideoSource* native_source = | 53 MediaStreamVideoSource* native_source = |
| 54 MediaStreamVideoSource::GetVideoSource(source); | 54 MediaStreamVideoSource::GetVideoSource(source); |
| 55 DCHECK(native_source); | 55 if (!native_source) { |
| 56 // TODO(perkj): Implement support for sources from |
| 57 // remote MediaStreams. |
| 58 NOTIMPLEMENTED(); |
| 59 return; |
| 60 } |
| 56 blink::WebMediaStreamTrack writable_track(track); | 61 blink::WebMediaStreamTrack writable_track(track); |
| 57 writable_track.setExtraData( | 62 writable_track.setExtraData( |
| 58 new MediaStreamVideoTrack(native_source, source.constraints(), | 63 new MediaStreamVideoTrack(native_source, source.constraints(), |
| 59 MediaStreamVideoSource::ConstraintsCallback(), | 64 MediaStreamVideoSource::ConstraintsCallback(), |
| 60 track.isEnabled(), factory)); | 65 track.isEnabled(), factory)); |
| 61 } | 66 } |
| 62 | 67 |
| 63 void CreateNativeMediaStreamTrack(const blink::WebMediaStreamTrack& track, | 68 void CreateNativeMediaStreamTrack(const blink::WebMediaStreamTrack& track, |
| 64 MediaStreamDependencyFactory* factory) { | 69 MediaStreamDependencyFactory* factory) { |
| 65 DCHECK(!track.isNull() && !track.extraData()); | 70 DCHECK(!track.isNull() && !track.extraData()); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 device.type == MEDIA_DEVICE_AUDIO_CAPTURE | 258 device.type == MEDIA_DEVICE_AUDIO_CAPTURE |
| 254 ? blink::WebSourceInfo::SourceKindAudio | 259 ? blink::WebSourceInfo::SourceKindAudio |
| 255 : blink::WebSourceInfo::SourceKindVideo, | 260 : blink::WebSourceInfo::SourceKindVideo, |
| 256 blink::WebString::fromUTF8(device.name), | 261 blink::WebString::fromUTF8(device.name), |
| 257 video_facing); | 262 video_facing); |
| 258 } | 263 } |
| 259 request_it->second.requestSucceeded(sourceInfos); | 264 request_it->second.requestSucceeded(sourceInfos); |
| 260 } | 265 } |
| 261 | 266 |
| 262 } // namespace content | 267 } // namespace content |
| OLD | NEW |