| 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_utils.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" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 web_media_stream->addTrack(web_media_stream_track); | 112 web_media_stream->addTrack(web_media_stream_track); |
| 113 return true; | 113 return true; |
| 114 } | 114 } |
| 115 | 115 |
| 116 const media::VideoCaptureFormat* GetCurrentVideoTrackFormat( | 116 const media::VideoCaptureFormat* GetCurrentVideoTrackFormat( |
| 117 const blink::WebMediaStreamTrack& video_track) { | 117 const blink::WebMediaStreamTrack& video_track) { |
| 118 if (video_track.isNull()) | 118 if (video_track.isNull()) |
| 119 return nullptr; | 119 return nullptr; |
| 120 | 120 |
| 121 content::MediaStreamVideoSource* source = | 121 MediaStreamVideoSource* const source = |
| 122 content::MediaStreamVideoSource::GetVideoSource(video_track.source()); | 122 MediaStreamVideoSource::GetVideoSource(video_track.source()); |
| 123 if (!source) | 123 if (!source) |
| 124 return nullptr; | 124 return nullptr; |
| 125 | 125 |
| 126 return source->GetCurrentFormat(); | 126 return source->GetCurrentFormat(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void RequestRefreshFrameFromVideoTrack( |
| 130 const blink::WebMediaStreamTrack& video_track) { |
| 131 if (video_track.isNull()) |
| 132 return; |
| 133 MediaStreamVideoSource* const source = |
| 134 MediaStreamVideoSource::GetVideoSource(video_track.source()); |
| 135 if (source) |
| 136 source->RequestRefreshFrame(); |
| 137 } |
| 138 |
| 129 } // namespace content | 139 } // namespace content |
| OLD | NEW |