Chromium Code Reviews| 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 d23adb2d19126a68a59d0401d10207d8309ec4fa..cbee6762eac852f07c6e090860cb2d0aa6e9e6a8 100644 |
| --- a/content/renderer/media/media_stream_video_track.cc |
| +++ b/content/renderer/media/media_stream_video_track.cc |
| @@ -4,6 +4,7 @@ |
| #include "content/renderer/media/media_stream_video_track.h" |
| +#include <string> |
| #include <utility> |
| #include "base/bind.h" |
| @@ -12,6 +13,7 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/single_thread_task_runner.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| +#include "build/build_config.h" |
| #include "content/renderer/media/media_stream_constraints_util_video_device.h" |
| #include "media/capture/video_capture_types.h" |
| @@ -426,6 +428,19 @@ void MediaStreamVideoTrack::GetSettings( |
| settings.facing_mode = blink::WebMediaStreamTrack::FacingMode::kNone; |
| break; |
| } |
| +#if defined(OS_ANDROID) |
| + // On Android, the facing mode is not available in the |facing| field, |
|
hbos_chromium
2017/07/05 10:21:04
nit: video_facing field
Guido Urdaneta
2017/07/06 08:20:16
Done.
|
| + // but is available as part of the label. |
| + // TODO(guidou): Remove this code once the |facing| field is supported |
| + // on Android. See http://crbug.com/672856. |
| + if (source_->device_info().device.name.find("front") != std::string::npos) { |
| + settings.facing_mode = blink::WebMediaStreamTrack::FacingMode::kUser; |
| + } else if (source_->device_info().device.name.find("back") != |
| + std::string::npos) { |
| + settings.facing_mode = blink::WebMediaStreamTrack::FacingMode::kEnvironment; |
| + } |
| +#endif |
| + |
| const base::Optional<CameraCalibration> calibration = |
| source_->device_info().device.camera_calibration; |
| if (calibration) { |