| 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 if (!native_source) { | 55 DCHECK(native_source); |
| 56 // TODO(perkj): Implement support for sources from | |
| 57 // remote MediaStreams. | |
| 58 NOTIMPLEMENTED(); | |
| 59 return; | |
| 60 } | |
| 61 blink::WebMediaStreamTrack writable_track(track); | 56 blink::WebMediaStreamTrack writable_track(track); |
| 62 writable_track.setExtraData( | 57 writable_track.setExtraData( |
| 63 new MediaStreamVideoTrack(native_source, source.constraints(), | 58 new MediaStreamVideoTrack(native_source, source.constraints(), |
| 64 MediaStreamVideoSource::ConstraintsCallback(), | 59 MediaStreamVideoSource::ConstraintsCallback(), |
| 65 track.isEnabled(), factory)); | 60 track.isEnabled(), factory)); |
| 66 } | 61 } |
| 67 | 62 |
| 68 void CreateNativeMediaStreamTrack(const blink::WebMediaStreamTrack& track, | 63 void CreateNativeMediaStreamTrack(const blink::WebMediaStreamTrack& track, |
| 69 MediaStreamDependencyFactory* factory) { | 64 MediaStreamDependencyFactory* factory) { |
| 70 DCHECK(!track.isNull() && !track.extraData()); | 65 DCHECK(!track.isNull() && !track.extraData()); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 device.type == MEDIA_DEVICE_AUDIO_CAPTURE | 266 device.type == MEDIA_DEVICE_AUDIO_CAPTURE |
| 272 ? blink::WebSourceInfo::SourceKindAudio | 267 ? blink::WebSourceInfo::SourceKindAudio |
| 273 : blink::WebSourceInfo::SourceKindVideo, | 268 : blink::WebSourceInfo::SourceKindVideo, |
| 274 blink::WebString::fromUTF8(device.name), | 269 blink::WebString::fromUTF8(device.name), |
| 275 video_facing); | 270 video_facing); |
| 276 } | 271 } |
| 277 request_it->second.requestSucceeded(sourceInfos); | 272 request_it->second.requestSucceeded(sourceInfos); |
| 278 } | 273 } |
| 279 | 274 |
| 280 } // namespace content | 275 } // namespace content |
| OLD | NEW |