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

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

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: change comments 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 } 310 }
311 switch (source_->device_info().device.video_facing) { 311 switch (source_->device_info().device.video_facing) {
312 case MEDIA_VIDEO_FACING_NONE: 312 case media::MEDIA_VIDEO_FACING_NONE:
313 settings.facingMode = blink::WebMediaStreamTrack::FacingMode::None; 313 settings.facingMode = blink::WebMediaStreamTrack::FacingMode::None;
314 break; 314 break;
315 case MEDIA_VIDEO_FACING_USER: 315 case media::MEDIA_VIDEO_FACING_USER:
316 settings.facingMode = blink::WebMediaStreamTrack::FacingMode::User; 316 settings.facingMode = blink::WebMediaStreamTrack::FacingMode::User;
317 break; 317 break;
318 case MEDIA_VIDEO_FACING_ENVIRONMENT: 318 case media::MEDIA_VIDEO_FACING_ENVIRONMENT:
319 settings.facingMode = 319 settings.facingMode =
320 blink::WebMediaStreamTrack::FacingMode::Environment; 320 blink::WebMediaStreamTrack::FacingMode::Environment;
321 break; 321 break;
322 default: 322 default:
323 settings.facingMode = blink::WebMediaStreamTrack::FacingMode::None; 323 settings.facingMode = blink::WebMediaStreamTrack::FacingMode::None;
324 break; 324 break;
325 } 325 }
326 } 326 }
327 // TODO(hta): Extract the real value. 327 // TODO(hta): Extract the real value.
328 settings.deviceId = blink::WebString("video device ID"); 328 settings.deviceId = blink::WebString("video device ID");
329 } 329 }
330 330
331 void MediaStreamVideoTrack::OnReadyStateChanged( 331 void MediaStreamVideoTrack::OnReadyStateChanged(
332 blink::WebMediaStreamSource::ReadyState state) { 332 blink::WebMediaStreamSource::ReadyState state) {
333 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 333 DCHECK(main_render_thread_checker_.CalledOnValidThread());
334 for (auto* sink : sinks_) 334 for (auto* sink : sinks_)
335 sink->OnReadyStateChanged(state); 335 sink->OnReadyStateChanged(state);
336 } 336 }
337 337
338 } // namespace content 338 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/media_stream_request.cc ('k') | content/renderer/media/mock_media_stream_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698