1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Platform: Remove compatibility checks for Android 20 and earlier

This commit is contained in:
reuk 2024-07-01 18:49:16 +01:00
parent 483429f432
commit 8ba2dc2ae2
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
12 changed files with 167 additions and 321 deletions

View file

@ -84,10 +84,8 @@ namespace juce::AndroidHighPerformanceAudioHelpers
if (canUseHighPerformanceAudioPath (nativeBufferSize, nativeBufferSize, (int) requestedSampleRate))
{
// see https://developer.android.com/ndk/guides/audio/opensl/opensl-prog-notes.html#sandp
// "For Android 4.2 (API level 17) and earlier, a buffer count of two or more is required
// for lower latency. Beginning with Android 4.3 (API level 18), a buffer count of one
// is sufficient for lower latency."
return (getAndroidSDKVersion() >= 18 ? 1 : 2);
// > Beginning with Android 4.3 (API level 18), a buffer count of one is sufficient for lower latency.
return 1;
}
// not using low-latency path so we can use the absolute minimum number of buffers to queue

View file

@ -398,7 +398,7 @@ private:
oboe::Direction::Output,
oboe::SharingMode::Exclusive,
2,
getAndroidSDKVersion() >= 21 ? oboe::AudioFormat::Float : oboe::AudioFormat::I16,
oboe::AudioFormat::Float,
(int) AndroidHighPerformanceAudioHelpers::getNativeSampleRate(),
bufferSizeHint,
&callback);
@ -1023,19 +1023,18 @@ OboeAudioIODevice::OboeSessionBase* OboeAudioIODevice::OboeSessionBase::create (
int bufferSize)
{
std::unique_ptr<OboeSessionBase> session;
auto sdkVersion = getAndroidSDKVersion();
// SDK versions 21 and higher should natively support floating point...
if (sdkVersion >= 21)
{
session.reset (new OboeSessionImpl<float> (owner, inputDeviceId, outputDeviceId,
numInputChannels, numOutputChannels, sampleRate, bufferSize));
std::unique_ptr<OboeSessionBase> session = std::make_unique<OboeSessionImpl<float>> (owner,
inputDeviceId,
outputDeviceId,
numInputChannels,
numOutputChannels,
sampleRate,
bufferSize);
// ...however, some devices lie so re-try without floating point
if (session != nullptr && (! session->openedOk()))
session.reset();
}
// ...however, some devices lie so re-try without floating point
if (session != nullptr && (! session->openedOk()))
session.reset();
if (session == nullptr)
{