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

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

Issue 2609863004: Pass camera facing to WebKit (Closed)
Patch Set: address review 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 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..dda31a044836b2a511b036c6b87e53e2443ecbfa 100644
--- a/content/renderer/media/media_stream_video_track.cc
+++ b/content/renderer/media/media_stream_video_track.cc
@@ -307,6 +307,21 @@ void MediaStreamVideoTrack::getSettings(
settings.frameRate = format->frame_rate;
settings.width = format->frame_size.width();
settings.height = format->frame_size.height();
+ const media::CameraFacing facing = source_->GetCameraFacing();
+ switch (facing) {
+ case media::CameraFacing::FRONT:
+ settings.facingMode =
+ blink::WebMediaStreamTrack::Settings::VideoFacingMode::User;
+ break;
+ case media::CameraFacing::BACK:
+ settings.facingMode = blink::WebMediaStreamTrack::Settings::
+ VideoFacingMode::Environment;
+ break;
+ case media::CameraFacing::DEFAULT:
+ // TODO(hta): assign VideoFacingMode::Unknown once we have it:
+ // b/34118695.
+ break;
+ }
}
}
// TODO(hta): Extract the real value.

Powered by Google App Engine
This is Rietveld 408576698