Commit 87229204 authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Re-enable float audio for Vivo M+ devices.

Vivo has confirmed these devices should work with float audio and
has asked us to re-enable support.

BUG=737188, b/112714561
TEST=none

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I7286d65f47bb56a8ff2750dec58d9c783519b65f
Reviewed-on: https://chromium-review.googlesource.com/1180064Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584214}
parent 7843cb75
...@@ -25,6 +25,21 @@ ...@@ -25,6 +25,21 @@
namespace media { namespace media {
static bool IsFloatAudioSupported() {
const auto* build_info = base::android::BuildInfo::GetInstance();
if (build_info->sdk_int() < base::android::SDK_VERSION_LOLLIPOP)
return false;
// Vivo devices up until Lollipop used their own Audio Mixer which does not
// support float audio output. https://crbug.com/737188.
if (build_info->sdk_int() == base::android::SDK_VERSION_LOLLIPOP &&
base::EqualsCaseInsensitiveASCII(build_info->manufacturer(), "vivo")) {
return false;
}
return true;
}
OpenSLESOutputStream::OpenSLESOutputStream(AudioManagerAndroid* manager, OpenSLESOutputStream::OpenSLESOutputStream(AudioManagerAndroid* manager,
const AudioParameters& params, const AudioParameters& params,
SLint32 stream_type) SLint32 stream_type)
...@@ -39,16 +54,8 @@ OpenSLESOutputStream::OpenSLESOutputStream(AudioManagerAndroid* manager, ...@@ -39,16 +54,8 @@ OpenSLESOutputStream::OpenSLESOutputStream(AudioManagerAndroid* manager,
muted_(false), muted_(false),
volume_(1.0), volume_(1.0),
samples_per_second_(params.sample_rate()), samples_per_second_(params.sample_rate()),
sample_format_( sample_format_(IsFloatAudioSupported() ? kSampleFormatF32
(base::android::BuildInfo::GetInstance()->sdk_int() >= : kSampleFormatS16),
base::android::SDK_VERSION_LOLLIPOP &&
// See http://crbug.com/737188; still shipping Lollipop in 2017, so
// no idea if later phones will be glitch free; thus blacklist all.
!base::EqualsCaseInsensitiveASCII(
base::android::BuildInfo::GetInstance()->manufacturer(),
"vivo"))
? kSampleFormatF32
: kSampleFormatS16),
bytes_per_frame_(params.GetBytesPerFrame(sample_format_)), bytes_per_frame_(params.GetBytesPerFrame(sample_format_)),
buffer_size_bytes_(params.GetBytesPerBuffer(sample_format_)), buffer_size_bytes_(params.GetBytesPerBuffer(sample_format_)),
performance_mode_(SL_ANDROID_PERFORMANCE_NONE), performance_mode_(SL_ANDROID_PERFORMANCE_NONE),
......
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