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

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

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: modify settings names Created 3 years, 11 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 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 301
302 void MediaStreamVideoTrack::getSettings( 302 void MediaStreamVideoTrack::getSettings(
303 blink::WebMediaStreamTrack::Settings& settings) { 303 blink::WebMediaStreamTrack::Settings& settings) {
304 if (source_) { 304 if (source_) {
305 const media::VideoCaptureFormat* format = source_->GetCurrentFormat(); 305 const media::VideoCaptureFormat* format = source_->GetCurrentFormat();
306 if (format) { 306 if (format) {
307 settings.frameRate = format->frame_rate; 307 settings.frameRate = format->frame_rate;
308 settings.width = format->frame_size.width(); 308 settings.width = format->frame_size.width();
309 settings.height = format->frame_size.height(); 309 settings.height = format->frame_size.height();
310 media::CameraFacing facing = source_->GetCameraFacing();
mcasas 2017/01/05 20:26:37 nit: const
shenghao 2017/01/06 09:43:01 Done.
311 switch (facing) {
312 case media::CameraFacing::FRONT:
313 settings.facingMode =
314 blink::WebMediaStreamTrack::Settings::VideoFacingMode::User;
315 break;
316 case media::CameraFacing::BACK:
317 settings.facingMode = blink::WebMediaStreamTrack::Settings::
318 VideoFacingMode::Environment;
319 break;
320 default:
miu 2017/01/05 21:55:33 Don't include default clauses: Let the compiler fo
shenghao 2017/01/06 09:43:01 Done.
321 DVLOG(1) << "Unrecongnized CameraFacing value" << facing;
mcasas 2017/01/05 20:26:37 s/Unrecongnized/Unrecognized/ s/DVLOG(1)/DLOG(ERR
shenghao 2017/01/06 09:43:01 Deleted
322 break;
323 }
310 } 324 }
311 } 325 }
312 // TODO(hta): Extract the real value. 326 // TODO(hta): Extract the real value.
313 settings.deviceId = blink::WebString("video device ID"); 327 settings.deviceId = blink::WebString("video device ID");
314 } 328 }
315 329
316 void MediaStreamVideoTrack::OnReadyStateChanged( 330 void MediaStreamVideoTrack::OnReadyStateChanged(
317 blink::WebMediaStreamSource::ReadyState state) { 331 blink::WebMediaStreamSource::ReadyState state) {
318 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 332 DCHECK(main_render_thread_checker_.CalledOnValidThread());
319 for (auto* sink : sinks_) 333 for (auto* sink : sinks_)
320 sink->OnReadyStateChanged(state); 334 sink->OnReadyStateChanged(state);
321 } 335 }
322 336
323 } // namespace content 337 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698