| 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_api.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_source.h" |
| 16 #include "content/renderer/media/media_stream_video_track.h" | 17 #include "content/renderer/media/media_stream_video_track.h" |
| 17 #include "content/renderer/render_thread_impl.h" | 18 #include "content/renderer/render_thread_impl.h" |
| 18 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 19 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 19 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 20 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 20 #include "third_party/WebKit/public/platform/WebURL.h" | 21 #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 #include "url/gurl.h" |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 | 26 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 blink::WebMediaStreamTrack web_media_stream_track; | 106 blink::WebMediaStreamTrack web_media_stream_track; |
| 106 web_media_stream_track.initialize(web_media_stream_source); | 107 web_media_stream_track.initialize(web_media_stream_source); |
| 107 RenderThreadImpl::current() | 108 RenderThreadImpl::current() |
| 108 ->GetPeerConnectionDependencyFactory() | 109 ->GetPeerConnectionDependencyFactory() |
| 109 ->CreateLocalAudioTrack(web_media_stream_track); | 110 ->CreateLocalAudioTrack(web_media_stream_track); |
| 110 | 111 |
| 111 web_media_stream->addTrack(web_media_stream_track); | 112 web_media_stream->addTrack(web_media_stream_track); |
| 112 return true; | 113 return true; |
| 113 } | 114 } |
| 114 | 115 |
| 116 const media::VideoCaptureFormat* GetCurrentVideoTrackFormat( |
| 117 const blink::WebMediaStreamTrack& video_track) { |
| 118 if (video_track.isNull()) |
| 119 return nullptr; |
| 120 |
| 121 content::MediaStreamVideoSource* source = |
| 122 content::MediaStreamVideoSource::GetVideoSource(video_track.source()); |
| 123 if (!source) |
| 124 return nullptr; |
| 125 |
| 126 return source->GetCurrentFormat(); |
| 127 } |
| 128 |
| 115 } // namespace content | 129 } // namespace content |
| OLD | NEW |