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

Unified Diff: content/renderer/media/media_stream_video_track.cc

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: use =default syntax 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_video_track.cc
diff --git a/content/renderer/media/media_stream_video_track.cc b/content/renderer/media/media_stream_video_track.cc
index dede54fecb104f1e46e97f43eb0ba1d2ed1dea20..a8c1a2a94cd9a06d23c47a6d2fa7d60239896e31 100644
--- a/content/renderer/media/media_stream_video_track.cc
+++ b/content/renderer/media/media_stream_video_track.cc
@@ -307,6 +307,25 @@ void MediaStreamVideoTrack::getSettings(
settings.frameRate = format->frame_rate;
settings.width = format->frame_size.width();
settings.height = format->frame_size.height();
+ const media::VideoFacingMode facing = source_->GetVideoFacing();
+ switch (facing) {
+ case media::VideoFacingMode::USER:
+ settings.facingMode =
+ blink::WebMediaStreamTrack::Settings::VideoFacingMode::User;
+ break;
+ case media::VideoFacingMode::ENVIRONMENT:
+ settings.facingMode = blink::WebMediaStreamTrack::Settings::
+ VideoFacingMode::Environment;
+ break;
+ case media::VideoFacingMode::LEFT:
+ settings.facingMode =
+ blink::WebMediaStreamTrack::Settings::VideoFacingMode::Left;
+ break;
+ case media::VideoFacingMode::RIGHT:
+ settings.facingMode =
+ blink::WebMediaStreamTrack::Settings::VideoFacingMode::Right;
+ break;
+ }
}
}
// TODO(hta): Extract the real value.

Powered by Google App Engine
This is Rietveld 408576698