Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Side by Side Diff: content/public/renderer/media_stream_utils.cc

Issue 1849003002: Add video frame refresh to MediaStream and VideoCapture stacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nick's PS3 comments (moving non-observer impl out of MSVideoSink interface). Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/public/renderer/media_stream_utils.h ('k') | content/public/renderer/media_stream_video_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698