Use Android performance mode "none"

This commit is contained in:
badaix 2021-01-09 22:30:13 +01:00
parent 412861c891
commit 9fa648cebb
2 changed files with 4 additions and 1 deletions

View file

@ -79,7 +79,7 @@ oboe::Result OboePlayer::openStream()
// The builder set methods can be chained for convenience. // The builder set methods can be chained for convenience.
oboe::AudioStreamBuilder builder; oboe::AudioStreamBuilder builder;
auto result = builder.setSharingMode(sharing_mode) auto result = builder.setSharingMode(sharing_mode)
->setPerformanceMode(oboe::PerformanceMode::LowLatency) ->setPerformanceMode(oboe::PerformanceMode::None)
->setChannelCount(stream_->getFormat().channels()) ->setChannelCount(stream_->getFormat().channels())
->setSampleRate(stream_->getFormat().rate()) ->setSampleRate(stream_->getFormat().rate())
->setFormat(oboe::AudioFormat::I16) ->setFormat(oboe::AudioFormat::I16)

View file

@ -282,6 +282,9 @@ void OpenslPlayer::initOpensl()
//// SLint32 streamType = SL_ANDROID_STREAM_VOICE; //// SLint32 streamType = SL_ANDROID_STREAM_VOICE;
result = (*playerConfig)->SetConfiguration(playerConfig, SL_ANDROID_KEY_STREAM_TYPE, &streamType, sizeof(SLint32)); result = (*playerConfig)->SetConfiguration(playerConfig, SL_ANDROID_KEY_STREAM_TYPE, &streamType, sizeof(SLint32));
throwUnsuccess(kPhaseInit, "PlayerConfig::SetConfiguration", result); throwUnsuccess(kPhaseInit, "PlayerConfig::SetConfiguration", result);
// Set the performance mode.
SLuint32 performanceMode = SL_ANDROID_PERFORMANCE_NONE;
result = (*playerConfig)->SetConfiguration(playerConfig, SL_ANDROID_KEY_PERFORMANCE_MODE, &performanceMode, sizeof(performanceMode));
result = (*bqPlayerObject)->Realize(bqPlayerObject, SL_BOOLEAN_FALSE); result = (*bqPlayerObject)->Realize(bqPlayerObject, SL_BOOLEAN_FALSE);
throwUnsuccess(kPhaseInit, "PlayerObject::Realize", result); throwUnsuccess(kPhaseInit, "PlayerObject::Realize", result);