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

Side by Side Diff: content/renderer/media/media_stream_video_track.cc

Issue 2037573004: Add video width and height to getSettings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_video_track.h" 5 #include "content/renderer/media/media_stream_video_track.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 source_->RemoveTrack(this); 285 source_->RemoveTrack(this);
286 source_ = NULL; 286 source_ = NULL;
287 } 287 }
288 OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded); 288 OnReadyStateChanged(blink::WebMediaStreamSource::ReadyStateEnded);
289 } 289 }
290 290
291 void MediaStreamVideoTrack::getSettings( 291 void MediaStreamVideoTrack::getSettings(
292 blink::WebMediaStreamTrack::Settings& settings) { 292 blink::WebMediaStreamTrack::Settings& settings) {
293 if (source_) { 293 if (source_) {
294 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); 294 const media::VideoCaptureFormat* format = source_->GetCurrentFormat();
295 if (format) 295 if (format) {
296 settings.frameRate = format->frame_rate; 296 settings.frameRate = format->frame_rate;
297 settings.width = format->frame_size.width();
298 settings.height = format->frame_size.height();
299 }
297 } 300 }
298 // TODO(hta): Extract the real value. 301 // TODO(hta): Extract the real value.
299 settings.deviceId = blink::WebString("video device ID"); 302 settings.deviceId = blink::WebString("video device ID");
300 } 303 }
301 304
302 void MediaStreamVideoTrack::OnReadyStateChanged( 305 void MediaStreamVideoTrack::OnReadyStateChanged(
303 blink::WebMediaStreamSource::ReadyState state) { 306 blink::WebMediaStreamSource::ReadyState state) {
304 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 307 DCHECK(main_render_thread_checker_.CalledOnValidThread());
305 for (auto* sink : sinks_) 308 for (auto* sink : sinks_)
306 sink->OnReadyStateChanged(state); 309 sink->OnReadyStateChanged(state);
307 } 310 }
308 311
309 } // namespace content 312 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698