OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/public/renderer/media_stream_api.h" | 5 #include "content/public/renderer/media_stream_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "content/renderer/media/media_stream_audio_source.h" | 14 #include "content/renderer/media/media_stream_audio_source.h" |
15 #include "content/renderer/media/media_stream_video_capturer_source.h" | 15 #include "content/renderer/media/media_stream_video_capturer_source.h" |
16 #include "content/renderer/media/media_stream_video_track.h" | 16 #include "content/renderer/media/media_stream_video_track.h" |
17 #include "content/renderer/render_thread_impl.h" | 17 #include "content/renderer/render_thread_impl.h" |
| 18 #include "media/base/audio_capturer_source.h" |
| 19 #include "media/base/video_capturer_source.h" |
18 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 20 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
19 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 21 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
20 #include "third_party/WebKit/public/platform/WebURL.h" | |
21 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 22 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
22 #include "url/gurl.h" | |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 bool AddVideoTrackToMediaStream( | 26 bool AddVideoTrackToMediaStream( |
27 scoped_ptr<media::VideoCapturerSource> video_source, | 27 scoped_ptr<media::VideoCapturerSource> video_source, |
28 bool is_remote, | 28 bool is_remote, |
29 bool is_readonly, | 29 bool is_readonly, |
30 blink::WebMediaStream* web_media_stream) { | 30 blink::WebMediaStream* web_media_stream) { |
31 DCHECK(video_source.get()); | 31 DCHECK(video_source.get()); |
32 if (!web_media_stream || web_media_stream->isNull()) { | 32 if (!web_media_stream || web_media_stream->isNull()) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 web_media_stream_track.initialize(web_media_stream_source); | 106 web_media_stream_track.initialize(web_media_stream_source); |
107 RenderThreadImpl::current() | 107 RenderThreadImpl::current() |
108 ->GetPeerConnectionDependencyFactory() | 108 ->GetPeerConnectionDependencyFactory() |
109 ->CreateLocalAudioTrack(web_media_stream_track); | 109 ->CreateLocalAudioTrack(web_media_stream_track); |
110 | 110 |
111 web_media_stream->addTrack(web_media_stream_track); | 111 web_media_stream->addTrack(web_media_stream_track); |
112 return true; | 112 return true; |
113 } | 113 } |
114 | 114 |
115 } // namespace content | 115 } // namespace content |
OLD | NEW |