Commit 56d99045 authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

Remove hack to detect facing mode on Android based on device label.

After crrev.com/c/1025213, facing mode is properly supported on
Android, so this hack becomes obsolete.

Bug: 672856
Change-Id: I7ccdc4f9535074bb7fc1fc2140b441df117ce962
Reviewed-on: https://chromium-review.googlesource.com/1029859
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553992}
parent c4b7a5db
......@@ -226,16 +226,6 @@ void MediaDevicesDispatcherHost::FinalizeGetVideoInputCapabilities(
media_stream_manager_->media_devices_manager()->GetVideoInputFormats(
descriptor.device_id, true /* try_in_use_first */);
capabilities->facing_mode = descriptor.facing;
#if defined(OS_ANDROID)
// On Android, the facing mode is not available in the |facing| field,
// 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 (descriptor.GetNameAndModel().find("front") != std::string::npos)
capabilities->facing_mode = media::MEDIA_VIDEO_FACING_USER;
else if (descriptor.GetNameAndModel().find("back") != std::string::npos)
capabilities->facing_mode = media::MEDIA_VIDEO_FACING_ENVIRONMENT;
#endif
if (descriptor.device_id == default_device_id) {
video_input_capabilities.insert(video_input_capabilities.begin(),
std::move(capabilities));
......
......@@ -604,16 +604,6 @@ MediaDevicesManager::ComputeVideoInputCapabilities(
capabilities->formats = GetVideoInputFormats(device_info.device_id,
false /* try_in_use_first */);
capabilities->facing_mode = device_info.video_facing;
#if defined(OS_ANDROID)
// On Android, the facing mode is not available in the |facing| field,
// 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 (device_info.label.find("front") != std::string::npos)
capabilities->facing_mode = media::MEDIA_VIDEO_FACING_USER;
else if (device_info.label.find("back") != std::string::npos)
capabilities->facing_mode = media::MEDIA_VIDEO_FACING_ENVIRONMENT;
#endif
video_input_capabilities.push_back(std::move(capabilities));
}
return video_input_capabilities;
......
......@@ -22,8 +22,7 @@ bool IsVideoMediaType(MediaStreamType type) {
}
bool IsScreenCaptureMediaType(MediaStreamType type) {
return (type == MEDIA_TAB_AUDIO_CAPTURE ||
type == MEDIA_TAB_VIDEO_CAPTURE ||
return (type == MEDIA_TAB_AUDIO_CAPTURE || type == MEDIA_TAB_VIDEO_CAPTURE ||
type == MEDIA_DESKTOP_AUDIO_CAPTURE ||
type == MEDIA_DESKTOP_VIDEO_CAPTURE);
}
......@@ -40,15 +39,7 @@ MediaStreamDevice::MediaStreamDevice(MediaStreamType type,
: type(type),
id(id),
video_facing(media::MEDIA_VIDEO_FACING_NONE),
name(name) {
#if defined(OS_ANDROID)
if (name.find("front") != std::string::npos) {
video_facing = media::MEDIA_VIDEO_FACING_USER;
} else if (name.find("back") != std::string::npos) {
video_facing = media::MEDIA_VIDEO_FACING_ENVIRONMENT;
}
#endif
}
name(name) {}
MediaStreamDevice::MediaStreamDevice(MediaStreamType type,
const std::string& id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment