feat(android): streaming cache budget and a hardware decoding switch

- Settings > Storage chooses the streaming cache's budget, 1 to 16 GiB,
  and shows what it holds against it. The bridge gains
  set_stream_cache_budget, which the next connection is built with and
  an open one evicts down to at once. Android keeps the choice in its own
  settings, like the desktop keeps it in desktop.json, and tells the
  engine as it is created. Unset stays at the shared 4 GiB default.
- Settings > Playback can turn hardware decoding off for a device whose
  decoder shows green or torn frames. pstr_mpv sets hwdec before each
  loadfile, so it applies from the next episode.
This commit is contained in:
nvrl committed 2026-10-03 04:12:20 +02:00
1 parent 8a1807c262
commit f2e69dc852
8 files changed
+120 -15

No files matched your search

@@ -1,6 +1,7 @@
package io.narl.protonstream.native
import android.content.Context
import io.narl.protonstream.settings.SettingsStore
import java.io.File
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -56,5 +57,9 @@ object NativeRuntime {
}
private fun createEngine(): AndroidEngine =
AndroidEngine(paths(), KeystoreSecretStore(appContext))
AndroidEngine(paths(), KeystoreSecretStore(appContext)).apply {
// The budget is Android's setting, so the engine starts on the
// default and is told the chosen one before anything streams.
setStreamCacheBudget(SettingsStore.gibToBytes(SettingsStore(appContext).cacheBudgetGib))
}
}