diff --git a/app/src/main/assets/steam-startup/droiddeck-startup-60.webm b/app/src/main/assets/steam-startup/droiddeck-startup-60.webm new file mode 100644 index 0000000000..3ecf0b37c3 Binary files /dev/null and b/app/src/main/assets/steam-startup/droiddeck-startup-60.webm differ diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index 4a08ade05a..f4a9c0d238 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -209,6 +209,9 @@ class MainActivity : ComponentActivity() { private val pickDeckyPluginZip = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r -> if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let { decky.importPluginZip(it) } } + private val pickBootMovie = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r -> + if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let { importBootMovie(it) } + } private val pickAnyDriver = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r -> if (r.resultCode == RESULT_OK) InAppFilePicker.pickedUri(r.data)?.let { drivers.importDriver(it, linux = null) } } @@ -253,6 +256,38 @@ class MainActivity : ComponentActivity() { }, "lossless-sync").start() } + private fun importBootMovie(file: File) { + bootMovieImporting = true + bootMovieProgress = -1 + Thread({ + val result = com.droiddeck.launcher.session.BootMovie.import( + this, file, + onStart = { ui.post { android.widget.Toast.makeText(this, getString(R.string.boot_movie_converting_started, file.name), android.widget.Toast.LENGTH_LONG).show() } }, + onProgress = { percent -> ui.post { bootMovieProgress = percent } }, + ) + val message = when (result) { + is com.droiddeck.launcher.session.BootMovie.Import.Done -> getString( + if (result.audioDropped) R.string.boot_movie_imported_silent else R.string.boot_movie_imported, result.name) + com.droiddeck.launcher.session.BootMovie.Import.TooLong -> + getString(R.string.boot_movie_too_long, com.droiddeck.launcher.session.BootMovie.MAX_CONVERT_SECONDS) + is com.droiddeck.launcher.session.BootMovie.Import.Unsupported -> getString(R.string.boot_movie_unsupported) + com.droiddeck.launcher.session.BootMovie.Import.Failed -> getString(R.string.boot_movie_import_failed) + } + ui.post { + bootMovieImporting = false + bootMovieProgress = -1 + loadBootMovie() + android.widget.Toast.makeText(this, message, android.widget.Toast.LENGTH_LONG).show() + } + }, "boot-movie-import").start() + } + + private fun loadBootMovie() { + bootMovie = com.droiddeck.launcher.session.BootMovie.choice(this) + bootMovieSound = SessionPrefs.bootMovieSound(this) + bootMovieCustomName = com.droiddeck.launcher.session.BootMovie.customName(this) + } + private fun importLossless(dll: File) { Thread({ val message = Lossless.message(this, Lossless.import(this, dll)) @@ -329,6 +364,11 @@ class MainActivity : ComponentActivity() { private var fexPreset by mutableStateOf("") private var forceSsbs by mutableStateOf(false) private var runSteamAtStartup by mutableStateOf(false) + private var bootMovie by mutableStateOf(com.droiddeck.launcher.session.BootMovie.DROIDDECK_30) + private var bootMovieSound by mutableStateOf(true) + private var bootMovieCustomName by mutableStateOf(null) + private var bootMovieImporting by mutableStateOf(false) + private var bootMovieProgress by mutableStateOf(-1) private var theme by mutableStateOf("graphite") private var appScale by mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.DEFAULT_SCALE) private var hdrOn by mutableStateOf(false) @@ -1318,6 +1358,11 @@ class MainActivity : ComponentActivity() { mangoapp = mangoapp, steamController = if (mode == SessionService.MODE_STEAM) steamController else null, runSteamAtStartup = mode == SessionService.MODE_STEAM && runSteamAtStartup, + bootMovie = if (mode == SessionService.MODE_STEAM) bootMovie else null, + bootMovieSound = bootMovieSound, + bootMovieCustomName = bootMovieCustomName, + bootMovieImporting = bootMovieImporting, + bootMovieProgress = bootMovieProgress, wifiDiscovery = if (mode == SessionService.MODE_STEAM) wifiDiscovery else null, wifiDiscoveryPermission = wifiDiscoveryPermission, wifiDiscoveryLocation = wifiDiscoveryLocation, @@ -1398,6 +1443,12 @@ class MainActivity : ComponentActivity() { SessionPrefs.setRunSteamAtStartup(this, on) runSteamAtStartup = on }, + onBootMovie = { id -> SessionPrefs.setBootMovie(this, id); loadBootMovie() }, + onBootMovieSound = { on -> SessionPrefs.setBootMovieSound(this, on); bootMovieSound = on }, + onImportBootMovie = { + pickBootMovie.launch(InAppFilePicker.buildIntent(this, com.droiddeck.launcher.session.BootMovie.PICKER_EXTENSIONS, getString(R.string.boot_movie_pick))) + }, + onRemoveBootMovie = { com.droiddeck.launcher.session.BootMovie.removeCustom(this); loadBootMovie() }, onDeckyInstall = { release -> decky.installDecky(release) }, onDeckyCheck = { decky.refreshDecky() }, onDeckyEnabled = { enabled -> DeckyManager.setSupervisorEnabled(this, enabled); decky.deckySupervisor = enabled }, @@ -1522,6 +1573,7 @@ class MainActivity : ComponentActivity() { mangoapp = SessionPrefs.mangoapp(this) steamController = SessionPrefs.steamController(this) runSteamAtStartup = SessionPrefs.runSteamAtStartup(this) + loadBootMovie() hdrOn = SessionPrefs.hdr(this, mode) fpsLimit = SessionPrefs.fpsLimit(this, mode) upscaler = SessionPrefs.upscaler(this) diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt new file mode 100644 index 0000000000..3641caec51 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovie.kt @@ -0,0 +1,208 @@ +package com.droiddeck.launcher.session + +import android.content.Context +import android.media.MediaCodec +import android.media.MediaExtractor +import android.media.MediaFormat +import android.media.MediaMuxer +import android.util.Log +import com.droiddeck.launcher.core.FileUtils +import java.io.File +import java.nio.ByteBuffer + +object BootMovie { + private const val TAG = "BootMovie" + const val DROIDDECK_30 = "dd30" + const val DROIDDECK_60 = "dd60" + const val CUSTOM = "custom" + const val MAX_BYTES = 50L shl 20 + const val MAX_CONVERT_SECONDS = 60 + val PICKER_EXTENSIONS = listOf("webm", "mkv", "mp4", "mov", "m4v", "3gp") + + private val ASSETS = mapOf( + DROIDDECK_30 to "droiddeck-startup.webm", + DROIDDECK_60 to "droiddeck-startup-60.webm", + ) + + // Steam's CEF player only takes WebM codecs; MediaMuxer's WebM writer cannot take AV1. + internal val VIDEO_CODECS = setOf(MediaFormat.MIMETYPE_VIDEO_VP8, MediaFormat.MIMETYPE_VIDEO_VP9, MediaFormat.MIMETYPE_VIDEO_AV1) + private val REMUX_CODECS = setOf(MediaFormat.MIMETYPE_VIDEO_VP8, MediaFormat.MIMETYPE_VIDEO_VP9) + internal val AUDIO_CODECS = setOf(MediaFormat.MIMETYPE_AUDIO_OPUS, MediaFormat.MIMETYPE_AUDIO_VORBIS) + + sealed class Import { + data class Done(val name: String, val audioDropped: Boolean) : Import() + object TooLong : Import() + data class Unsupported(val codec: String?) : Import() + object Failed : Import() + } + + private fun dir(context: Context) = File(context.filesDir, "boot-movie") + private fun customFile(context: Context) = File(dir(context), "custom.webm") + + fun customName(context: Context): String? = + if (customFile(context).isFile) SessionPrefs.bootMovieCustomName(context) ?: "custom.webm" else null + + fun choice(context: Context): String { + val chosen = SessionPrefs.bootMovie(context) + return when { + chosen == CUSTOM && customFile(context).isFile -> CUSTOM + chosen in ASSETS -> chosen + else -> DROIDDECK_30 + } + } + + fun prepare(context: Context): File? { + val choice = choice(context) + val source = if (choice == CUSTOM) customFile(context) else extractAsset(context, ASSETS.getValue(choice)) ?: return null + if (SessionPrefs.bootMovieSound(context)) return source + val muted = File(source.parentFile, source.nameWithoutExtension + "-muted.webm") + if (muted.isFile && muted.lastModified() >= source.lastModified()) return muted + if (remux(source, muted, audio = false)) return muted + if (BootMovieTranscoder.transcode(source, muted, keepAudio = false) {} != null) return muted + Log.e(TAG, "could not strip audio from ${source.name}; not staging it") + return null + } + + private fun extractAsset(context: Context, name: String): File? { + val target = File(dir(context), name) + val updated = runCatching { context.packageManager.getPackageInfo(context.packageName, 0).lastUpdateTime }.getOrDefault(Long.MAX_VALUE) + if (target.isFile && target.lastModified() >= updated) return target + val staged = File(target.parentFile, "$name.staged") + return try { + target.parentFile?.mkdirs() + context.assets.open("steam-startup/$name").use { input -> + staged.outputStream().use { output -> FileUtils.copy(input, output) } + } + if (staged.renameTo(target)) target else null + } catch (e: Exception) { + Log.w(TAG, "could not extract $name", e) + null + } finally { + staged.delete() + } + } + + fun import(context: Context, file: File, onStart: () -> Unit = {}, onProgress: (Int) -> Unit = {}): Import { + val (format, audio) = probe(file) ?: return Import.Unsupported(null) + val video = format.getString(MediaFormat.KEY_MIME) + val audioPlayable = audio == null || audio in AUDIO_CODECS + val playable = video in VIDEO_CODECS && file.length() <= MAX_BYTES + val copy = playable && audioPlayable && isWebm(file) + val remux = !copy && playable && video in REMUX_CODECS + if (!copy && !remux) { + if (!BootMovieTranscoder.canDecode(format)) return Import.Unsupported(video) + val durationUs = if (format.containsKey(MediaFormat.KEY_DURATION)) format.getLong(MediaFormat.KEY_DURATION) else 0L + if (durationUs > MAX_CONVERT_SECONDS * 1_000_000L) return Import.TooLong + onStart() + } + val target = customFile(context) + val staged = File(dir(context), "custom.webm.staged") + var audioDropped = remux && !audioPlayable + return try { + target.parentFile?.mkdirs() + val ok = when { + copy -> { + file.inputStream().use { input -> staged.outputStream().use { output -> FileUtils.copy(input, output) } } + true + } + remux -> remux(file, staged, audio = true) + else -> BootMovieTranscoder.transcode(file, staged, onProgress = onProgress)?.also { audioDropped = it.audioDropped } != null + } + if (!ok || !staged.renameTo(target)) return Import.Failed + File(target.parentFile, "custom-muted.webm").delete() + SessionPrefs.setBootMovieCustomName(context, file.name) + SessionPrefs.setBootMovie(context, CUSTOM) + Import.Done(file.name, audioDropped) + } catch (e: Exception) { + Log.w(TAG, "could not import ${file.name}", e) + Import.Failed + } finally { + staged.delete() + } + } + + fun removeCustom(context: Context) { + customFile(context).delete() + File(dir(context), "custom-muted.webm").delete() + SessionPrefs.setBootMovieCustomName(context, null) + if (SessionPrefs.bootMovie(context) == CUSTOM) SessionPrefs.setBootMovie(context, DROIDDECK_30) + } + + private fun isWebm(file: File): Boolean { + if (!file.name.endsWith(".webm", ignoreCase = true)) return false + val magic = ByteArray(4) + val read = runCatching { file.inputStream().use { it.read(magic) } }.getOrDefault(0) + return read == 4 && magic.contentEquals(byteArrayOf(0x1A, 0x45, 0xDF.toByte(), 0xA3.toByte())) + } + + private fun probe(file: File): Pair? { + val extractor = MediaExtractor() + return try { + extractor.setDataSource(file.path) + var video: MediaFormat? = null + var audio: String? = null + for (i in 0 until extractor.trackCount) { + val format = extractor.getTrackFormat(i) + val mime = format.getString(MediaFormat.KEY_MIME) ?: continue + if (video == null && mime.startsWith("video/")) video = format + if (audio == null && mime.startsWith("audio/")) audio = mime + } + video?.let { it to audio } + } catch (e: Exception) { + Log.w(TAG, "could not read ${file.name}", e) + null + } finally { + extractor.release() + } + } + + private fun remux(source: File, target: File, audio: Boolean): Boolean { + val staged = File(target.parentFile, target.name + ".remux") + val extractor = MediaExtractor() + var muxer: MediaMuxer? = null + return try { + extractor.setDataSource(source.path) + val output = MediaMuxer(staged.path, MediaMuxer.OutputFormat.MUXER_OUTPUT_WEBM).also { muxer = it } + val tracks = HashMap() + var hasVideo = false + var hasAudio = false + var bufferSize = 8 shl 20 + for (i in 0 until extractor.trackCount) { + val format = extractor.getTrackFormat(i) + val mime = format.getString(MediaFormat.KEY_MIME) ?: continue + val keep = mime in VIDEO_CODECS && !hasVideo || audio && mime in AUDIO_CODECS && !hasAudio + if (!keep) continue + if (mime in VIDEO_CODECS) hasVideo = true else hasAudio = true + extractor.selectTrack(i) + tracks[i] = output.addTrack(format) + if (format.containsKey(MediaFormat.KEY_MAX_INPUT_SIZE)) bufferSize = maxOf(bufferSize, format.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE)) + } + if (!hasVideo) return false + output.start() + val buffer = ByteBuffer.allocate(bufferSize) + val info = MediaCodec.BufferInfo() + while (true) { + val size = extractor.readSampleData(buffer, 0) + if (size < 0) break + val track = tracks[extractor.sampleTrackIndex] + if (track != null) { + val key = extractor.sampleFlags and MediaExtractor.SAMPLE_FLAG_SYNC != 0 + info.set(0, size, extractor.sampleTime, if (key) MediaCodec.BUFFER_FLAG_KEY_FRAME else 0) + output.writeSampleData(track, buffer, info) + } + extractor.advance() + } + output.stop() + output.release() + muxer = null + staged.renameTo(target) + } catch (e: Exception) { + Log.w(TAG, "could not remux ${source.name}", e) + false + } finally { + runCatching { muxer?.release() } + extractor.release() + staged.delete() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt b/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt new file mode 100644 index 0000000000..ff1275d851 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/session/BootMovieTranscoder.kt @@ -0,0 +1,499 @@ +package com.droiddeck.launcher.session + +import android.graphics.SurfaceTexture +import android.media.MediaCodec +import android.media.MediaCodecInfo +import android.media.MediaCodecList +import android.media.MediaExtractor +import android.media.MediaFormat +import android.media.MediaMuxer +import android.opengl.EGL14 +import android.opengl.EGLConfig +import android.opengl.EGLExt +import android.opengl.GLES11Ext +import android.opengl.GLES20 +import android.os.Handler +import android.os.HandlerThread +import android.util.Log +import android.view.Surface +import java.io.ByteArrayOutputStream +import java.io.File +import java.nio.ByteBuffer +import java.nio.ByteOrder +import java.nio.FloatBuffer + +internal object BootMovieTranscoder { + private const val TAG = "BootMovieTranscoder" + private const val TIMEOUT_US = 10_000L + private const val MAX_FPS = 60 + private const val OPUS_RATE = 48_000 + + class Result(val audioDropped: Boolean) + + private class Sample(val data: ByteArray, val timeUs: Long) + private class Audio(val format: MediaFormat, val samples: List) + + fun canDecode(format: MediaFormat): Boolean = runCatching { + MediaCodecList(MediaCodecList.REGULAR_CODECS).findDecoderForFormat(format) != null + }.getOrDefault(false) + + fun transcode(source: File, target: File, keepAudio: Boolean = true, onProgress: (Int) -> Unit): Result? { + val hadAudio = keepAudio && trackFormat(source, "audio/") != null + val audio = if (hadAudio) runCatching { encodeAudio(source) } + .onFailure { Log.w(TAG, "could not convert the audio of ${source.name}", it) }.getOrNull() else null + val muxedAudio = runCatching { encodeVideo(source, target, audio, onProgress) } + .onFailure { Log.w(TAG, "could not convert ${source.name}", it) }.getOrNull() ?: return null + return Result(audioDropped = hadAudio && !muxedAudio) + } + + private fun trackFormat(source: File, prefix: String): Pair? { + val extractor = MediaExtractor() + return try { + extractor.setDataSource(source.path) + (0 until extractor.trackCount).map { it to extractor.getTrackFormat(it) } + .firstOrNull { it.second.getString(MediaFormat.KEY_MIME)?.startsWith(prefix) == true } + } finally { + extractor.release() + } + } + + internal class Layout(val width: Int, val height: Int, val x: Int, val y: Int, val contentWidth: Int, val contentHeight: Int) + + // Steam fills the screen with its startup movie, so portrait clips are pillarboxed into 16:9 instead of cropped. + internal fun layout(width: Int, height: Int, rotation: Int): Layout { + val (w, h) = if (rotation % 180 != 0) height to width else width to height + fun even(v: Double) = maxOf(2, (v.toInt() / 2) * 2) + if (w >= h) { + val scale = minOf(1.0, 1280.0 / w, 720.0 / h) + val cw = even(w * scale) + val ch = even(h * scale) + return Layout(cw, ch, 0, 0, cw, ch) + } + val ch = even(minOf(h, 720).toDouble()) + val cw = even(w * ch.toDouble() / h) + val canvas = even(ch * 16 / 9.0) + return Layout(canvas, ch, (canvas - cw) / 2, 0, cw, ch) + } + + internal fun resample(pcm: ShortArray, channels: Int, rate: Int): ShortArray { + if (rate == OPUS_RATE) return pcm + val frames = pcm.size / channels + val outFrames = (frames.toLong() * OPUS_RATE / rate).toInt() + val out = ShortArray(outFrames * channels) + for (i in 0 until outFrames) { + val pos = i.toDouble() * rate / OPUS_RATE + val i0 = pos.toInt().coerceAtMost(frames - 1) + val i1 = (i0 + 1).coerceAtMost(frames - 1) + val frac = pos - i0 + for (c in 0 until channels) { + val a = pcm[i0 * channels + c] + val b = pcm[i1 * channels + c] + out[i * channels + c] = (a + (b - a) * frac).toInt().toShort() + } + } + return out + } + + private fun encodeAudio(source: File): Audio? { + val (track, inFormat) = trackFormat(source, "audio/") ?: return null + val extractor = MediaExtractor() + var decoder: MediaCodec? = null + var encoder: MediaCodec? = null + try { + extractor.setDataSource(source.path) + extractor.selectTrack(track) + var rate = inFormat.getInteger(MediaFormat.KEY_SAMPLE_RATE) + var channels = inFormat.getInteger(MediaFormat.KEY_CHANNEL_COUNT) + val dec = MediaCodec.createDecoderByType(inFormat.getString(MediaFormat.KEY_MIME)!!).also { decoder = it } + dec.configure(inFormat, null, null, 0) + dec.start() + val pcm = ByteArrayOutputStream() + val info = MediaCodec.BufferInfo() + var inputDone = false + while (true) { + if (!inputDone) { + val index = dec.dequeueInputBuffer(TIMEOUT_US) + if (index >= 0) { + val size = extractor.readSampleData(dec.getInputBuffer(index)!!, 0) + if (size < 0) { + dec.queueInputBuffer(index, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM) + inputDone = true + } else { + dec.queueInputBuffer(index, 0, size, extractor.sampleTime, 0) + extractor.advance() + } + } + } + val index = dec.dequeueOutputBuffer(info, TIMEOUT_US) + if (index == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { + val format = dec.outputFormat + rate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE) + channels = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT) + if (format.containsKey(MediaFormat.KEY_PCM_ENCODING) && + format.getInteger(MediaFormat.KEY_PCM_ENCODING) != android.media.AudioFormat.ENCODING_PCM_16BIT) return null + } else if (index >= 0) { + if (info.size > 0) { + val bytes = ByteArray(info.size) + dec.getOutputBuffer(index)!!.apply { position(info.offset); get(bytes) } + pcm.write(bytes) + } + dec.releaseOutputBuffer(index, false) + if (info.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) break + } + } + if (channels !in 1..2) return null + val raw = pcm.toByteArray() + val shorts = ShortArray(raw.size / 2) + ByteBuffer.wrap(raw).order(ByteOrder.nativeOrder()).asShortBuffer().get(shorts) + val samples = resample(shorts, channels, rate) + + val format = MediaFormat.createAudioFormat(MediaFormat.MIMETYPE_AUDIO_OPUS, OPUS_RATE, channels) + format.setInteger(MediaFormat.KEY_BIT_RATE, 128_000) + val name = MediaCodecList(MediaCodecList.REGULAR_CODECS).findEncoderForFormat(format) ?: return null + val enc = MediaCodec.createByCodecName(name).also { encoder = it } + enc.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE) + enc.start() + val packets = ArrayList() + var outFormat: MediaFormat? = null + var offset = 0 + var encodeInputDone = false + while (true) { + if (!encodeInputDone) { + val index = enc.dequeueInputBuffer(TIMEOUT_US) + if (index >= 0) { + val buffer = enc.getInputBuffer(index)!! + buffer.clear() + val count = minOf(buffer.remaining() / 2, samples.size - offset) / channels * channels + val timeUs = offset.toLong() / channels * 1_000_000L / OPUS_RATE + if (count == 0) { + enc.queueInputBuffer(index, 0, 0, timeUs, MediaCodec.BUFFER_FLAG_END_OF_STREAM) + encodeInputDone = true + } else { + buffer.order(ByteOrder.nativeOrder()).asShortBuffer().put(samples, offset, count) + enc.queueInputBuffer(index, 0, count * 2, timeUs, 0) + offset += count + } + } + } + val index = enc.dequeueOutputBuffer(info, TIMEOUT_US) + if (index == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { + outFormat = enc.outputFormat + } else if (index >= 0) { + if (info.size > 0 && info.flags and MediaCodec.BUFFER_FLAG_CODEC_CONFIG == 0) { + val bytes = ByteArray(info.size) + enc.getOutputBuffer(index)!!.apply { position(info.offset); get(bytes) } + packets.add(Sample(bytes, info.presentationTimeUs)) + } + enc.releaseOutputBuffer(index, false) + if (info.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) break + } + } + return outFormat?.let { Audio(it, packets) } + } finally { + runCatching { decoder?.stop() } + decoder?.release() + runCatching { encoder?.stop() } + encoder?.release() + extractor.release() + } + } + + private fun MediaFormat.intOrNull(key: String): Int? = if (!containsKey(key)) null else + runCatching { getInteger(key) }.getOrElse { runCatching { getFloat(key).toInt() }.getOrNull() } + + private fun encodeVideo(source: File, target: File, audio: Audio?, onProgress: (Int) -> Unit): Boolean { + val (track, inFormat) = trackFormat(source, "video/") ?: throw IllegalStateException("no video track") + val rotation = (inFormat.intOrNull(MediaFormat.KEY_ROTATION) ?: 0).mod(360) + val layout = layout(inFormat.getInteger(MediaFormat.KEY_WIDTH), inFormat.getInteger(MediaFormat.KEY_HEIGHT), rotation) + val width = layout.width + val height = layout.height + val fps = (inFormat.intOrNull(MediaFormat.KEY_FRAME_RATE) ?: 30).coerceIn(1, MAX_FPS) + val durationUs = if (inFormat.containsKey(MediaFormat.KEY_DURATION)) inFormat.getLong(MediaFormat.KEY_DURATION) else 0L + val minIntervalUs = 1_000_000L / MAX_FPS - 2_000 + + val encFormat = MediaFormat.createVideoFormat(MediaFormat.MIMETYPE_VIDEO_VP8, width, height).apply { + setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface) + setInteger(MediaFormat.KEY_BIT_RATE, (width.toLong() * height * fps / 10).coerceIn(1_000_000, 8_000_000).toInt()) + setInteger(MediaFormat.KEY_FRAME_RATE, fps) + setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 2) + } + val encoderName = MediaCodecList(MediaCodecList.REGULAR_CODECS).findEncoderForFormat(encFormat) + ?: throw IllegalStateException("no VP8 encoder") + + val extractor = MediaExtractor() + var encoder: MediaCodec? = null + var decoder: MediaCodec? = null + var egl: EglWindow? = null + var renderer: FrameRenderer? = null + var muxer: MediaMuxer? = null + val staged = File(target.parentFile, target.name + ".convert") + try { + extractor.setDataSource(source.path) + extractor.selectTrack(track) + val enc = MediaCodec.createByCodecName(encoderName).also { encoder = it } + enc.configure(encFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE) + val window = EglWindow(enc.createInputSurface()).also { egl = it } + val frames = FrameRenderer(rotation).also { renderer = it } + enc.start() + inFormat.setInteger(MediaFormat.KEY_ROTATION, 0) + val dec = MediaCodec.createDecoderByType(inFormat.getString(MediaFormat.KEY_MIME)!!).also { decoder = it } + dec.configure(inFormat, frames.surface, null, 0) + dec.start() + val mux = MediaMuxer(staged.path, MediaMuxer.OutputFormat.MUXER_OUTPUT_WEBM).also { muxer = it } + + var videoTrack = -1 + var audioTrack = -1 + var audioIndex = 0 + fun writeAudioUpTo(timeUs: Long) { + if (audioTrack < 0 || audio == null) return + val info = MediaCodec.BufferInfo() + while (audioIndex < audio.samples.size && audio.samples[audioIndex].timeUs <= timeUs) { + val sample = audio.samples[audioIndex++] + info.set(0, sample.data.size, sample.timeUs, 0) + mux.writeSampleData(audioTrack, ByteBuffer.wrap(sample.data), info) + } + } + + val decInfo = MediaCodec.BufferInfo() + val encInfo = MediaCodec.BufferInfo() + var inputDone = false + var decoderDone = false + var lastKept = Long.MIN_VALUE + var lastProgress = -1 + while (true) { + if (!inputDone) { + val index = dec.dequeueInputBuffer(TIMEOUT_US) + if (index >= 0) { + val size = extractor.readSampleData(dec.getInputBuffer(index)!!, 0) + if (size < 0) { + dec.queueInputBuffer(index, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM) + inputDone = true + } else { + dec.queueInputBuffer(index, 0, size, extractor.sampleTime, 0) + extractor.advance() + } + } + } + if (!decoderDone) { + val index = dec.dequeueOutputBuffer(decInfo, TIMEOUT_US) + if (index >= 0) { + val timeUs = decInfo.presentationTimeUs + val keep = decInfo.size > 0 && (lastKept == Long.MIN_VALUE || timeUs - lastKept >= minIntervalUs) + dec.releaseOutputBuffer(index, keep) + if (keep) { + if (!frames.awaitFrame()) throw IllegalStateException("decoder frame timed out") + frames.draw(layout) + window.swap(timeUs * 1000) + lastKept = timeUs + if (durationUs > 0) { + val percent = (timeUs * 100 / durationUs).toInt().coerceIn(0, 99) + if (percent != lastProgress) { lastProgress = percent; onProgress(percent) } + } + } + if (decInfo.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) { + enc.signalEndOfInputStream() + decoderDone = true + } + } + } + var encoderDone = false + while (true) { + val index = enc.dequeueOutputBuffer(encInfo, if (decoderDone) TIMEOUT_US else 0) + if (index == MediaCodec.INFO_TRY_AGAIN_LATER) break + if (index == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { + videoTrack = mux.addTrack(enc.outputFormat) + if (audio != null) audioTrack = runCatching { mux.addTrack(audio.format) } + .onFailure { Log.w(TAG, "WebM muxer refused the Opus track", it) }.getOrDefault(-1) + mux.start() + } else if (index >= 0) { + if (encInfo.size > 0 && encInfo.flags and MediaCodec.BUFFER_FLAG_CODEC_CONFIG == 0) { + check(videoTrack >= 0) { "encoder produced data before its format" } + writeAudioUpTo(encInfo.presentationTimeUs) + mux.writeSampleData(videoTrack, enc.getOutputBuffer(index)!!, encInfo) + } + enc.releaseOutputBuffer(index, false) + if (encInfo.flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0) { encoderDone = true; break } + } + } + if (encoderDone) break + } + writeAudioUpTo(Long.MAX_VALUE) + mux.stop() + mux.release() + muxer = null + if (!staged.renameTo(target)) throw IllegalStateException("could not move the converted movie") + onProgress(100) + return audioTrack >= 0 + } finally { + runCatching { muxer?.release() } + runCatching { decoder?.stop() } + decoder?.release() + runCatching { encoder?.stop() } + encoder?.release() + renderer?.release() + egl?.release() + extractor.release() + staged.delete() + } + } + + private class EglWindow(private val surface: Surface) { + private val display = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY) + private val context: android.opengl.EGLContext + private val window: android.opengl.EGLSurface + + init { + val version = IntArray(2) + check(EGL14.eglInitialize(display, version, 0, version, 1)) { "eglInitialize failed" } + val attributes = intArrayOf( + EGL14.EGL_RED_SIZE, 8, EGL14.EGL_GREEN_SIZE, 8, EGL14.EGL_BLUE_SIZE, 8, + EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT, EGL_RECORDABLE_ANDROID, 1, EGL14.EGL_NONE, + ) + val configs = arrayOfNulls(1) + val count = IntArray(1) + check(EGL14.eglChooseConfig(display, attributes, 0, configs, 0, 1, count, 0) && count[0] > 0) { "no recordable EGL config" } + context = EGL14.eglCreateContext(display, configs[0], EGL14.EGL_NO_CONTEXT, + intArrayOf(EGL14.EGL_CONTEXT_CLIENT_VERSION, 2, EGL14.EGL_NONE), 0) + window = EGL14.eglCreateWindowSurface(display, configs[0], surface, intArrayOf(EGL14.EGL_NONE), 0) + check(EGL14.eglMakeCurrent(display, window, window, context)) { "eglMakeCurrent failed" } + } + + fun swap(timeNs: Long) { + EGLExt.eglPresentationTimeANDROID(display, window, timeNs) + EGL14.eglSwapBuffers(display, window) + } + + fun release() { + EGL14.eglMakeCurrent(display, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT) + EGL14.eglDestroySurface(display, window) + EGL14.eglDestroyContext(display, context) + EGL14.eglReleaseThread() + EGL14.eglTerminate(display) + surface.release() + } + + companion object { + private const val EGL_RECORDABLE_ANDROID = 0x3142 + } + } + + private class FrameRenderer(rotation: Int) { + private val thread = HandlerThread("boot-movie-frames").apply { start() } + private val lock = Object() + private var available = false + private val texture = IntArray(1).also { GLES20.glGenTextures(1, it, 0) }[0] + private val surfaceTexture: SurfaceTexture + val surface: Surface + private val program: Int + private val transform = FloatArray(16) + private val positions: FloatBuffer + private val coords: FloatBuffer = floats(0f, 0f, 1f, 0f, 0f, 1f, 1f, 1f) + + init { + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texture) + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR) + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR) + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE) + GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE) + surfaceTexture = SurfaceTexture(texture) + surfaceTexture.setOnFrameAvailableListener({ + synchronized(lock) { available = true; lock.notifyAll() } + }, Handler(thread.looper)) + surface = Surface(surfaceTexture) + program = link(VERTEX, FRAGMENT) + val radians = Math.toRadians(rotation.toDouble()) + val cos = Math.cos(radians).toFloat() + val sin = Math.sin(radians).toFloat() + val corners = floatArrayOf(-1f, -1f, 1f, -1f, -1f, 1f, 1f, 1f) + positions = floats(*FloatArray(8) { i -> + val x = corners[i - i % 2] + val y = corners[i - i % 2 + 1] + if (i % 2 == 0) x * cos + y * sin else -x * sin + y * cos + }) + } + + fun awaitFrame(): Boolean { + synchronized(lock) { + val deadline = System.currentTimeMillis() + 2_500 + while (!available) { + val wait = deadline - System.currentTimeMillis() + if (wait <= 0) return false + lock.wait(wait) + } + available = false + } + surfaceTexture.updateTexImage() + return true + } + + fun draw(layout: Layout) { + surfaceTexture.getTransformMatrix(transform) + GLES20.glViewport(0, 0, layout.width, layout.height) + GLES20.glClearColor(0f, 0f, 0f, 1f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + GLES20.glViewport(layout.x, layout.y, layout.contentWidth, layout.contentHeight) + GLES20.glUseProgram(program) + GLES20.glActiveTexture(GLES20.GL_TEXTURE0) + GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, texture) + val position = GLES20.glGetAttribLocation(program, "aPosition") + val coord = GLES20.glGetAttribLocation(program, "aCoord") + GLES20.glEnableVertexAttribArray(position) + GLES20.glVertexAttribPointer(position, 2, GLES20.GL_FLOAT, false, 0, positions) + GLES20.glEnableVertexAttribArray(coord) + GLES20.glVertexAttribPointer(coord, 2, GLES20.GL_FLOAT, false, 0, coords) + GLES20.glUniformMatrix4fv(GLES20.glGetUniformLocation(program, "uTransform"), 1, false, transform, 0) + GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4) + } + + fun release() { + surface.release() + surfaceTexture.release() + GLES20.glDeleteProgram(program) + GLES20.glDeleteTextures(1, intArrayOf(texture), 0) + thread.quitSafely() + } + + private fun floats(vararg values: Float): FloatBuffer = + ByteBuffer.allocateDirect(values.size * 4).order(ByteOrder.nativeOrder()).asFloatBuffer().apply { put(values); position(0) } + + private fun link(vertex: String, fragment: String): Int { + fun compile(type: Int, code: String): Int = GLES20.glCreateShader(type).also { + GLES20.glShaderSource(it, code) + GLES20.glCompileShader(it) + val ok = IntArray(1) + GLES20.glGetShaderiv(it, GLES20.GL_COMPILE_STATUS, ok, 0) + check(ok[0] != 0) { GLES20.glGetShaderInfoLog(it) } + } + return GLES20.glCreateProgram().also { + GLES20.glAttachShader(it, compile(GLES20.GL_VERTEX_SHADER, vertex)) + GLES20.glAttachShader(it, compile(GLES20.GL_FRAGMENT_SHADER, fragment)) + GLES20.glLinkProgram(it) + val ok = IntArray(1) + GLES20.glGetProgramiv(it, GLES20.GL_LINK_STATUS, ok, 0) + check(ok[0] != 0) { GLES20.glGetProgramInfoLog(it) } + } + } + + companion object { + private val VERTEX = """ + attribute vec4 aPosition; + attribute vec4 aCoord; + uniform mat4 uTransform; + varying vec2 vCoord; + void main() { + gl_Position = aPosition; + vCoord = (uTransform * aCoord).xy; + } + """.trimIndent() + private val FRAGMENT = """ + #extension GL_OES_EGL_image_external : require + precision mediump float; + varying vec2 vCoord; + uniform samplerExternalOES sTexture; + void main() { + gl_FragColor = texture2D(sTexture, vCoord); + } + """.trimIndent() + } + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt index 3a61f1b472..a0df0c7382 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt @@ -188,27 +188,29 @@ object SessionFiles { } val startupMovieDir = File(root, "root/.local/share/Steam/config/uioverrides/movies") - val bigPictureMovieInstalled = stageStartupMovie( - context, - startupMovieDir, - "bigpicture_startup.webm", - ) - stageStartupMovie(context, startupMovieDir, "steam_os_startup.webm") + val startupMovie = BootMovie.prepare(context) + val bigPictureMovieInstalled = startupMovie != null && + stageStartupMovie(startupMovie, startupMovieDir, "bigpicture_startup.webm") + if (startupMovie != null) stageStartupMovie(startupMovie, startupMovieDir, "steam_os_startup.webm") if (bigPictureMovieInstalled) { ensureStartupMovieDefault(File(root, "root/.local/share/Steam/config/config.vdf")) } } - private fun stageStartupMovie(context: Context, directory: File, name: String): Boolean { + private fun stageStartupMovie(source: File, directory: File, name: String): Boolean { val movie = File(directory, name) + val stamp = File(directory, ".$name.source") + val identity = "${source.absolutePath}\n${source.length()}\n${source.lastModified()}" + if (movie.length() == source.length() && runCatching { stamp.readText() }.getOrNull() == identity) return true val staged = File(directory, "$name.staged") var installed = false try { directory.mkdirs() - context.assets.open("steam-startup/droiddeck-startup.webm").use { input -> + source.inputStream().use { input -> staged.outputStream().use { output -> FileUtils.copy(input, output) } } installed = staged.setReadable(true, false) && staged.renameTo(movie) + if (installed) FileUtils.writeString(stamp, identity) } catch (e: Exception) { Log.w(TAG, "could not stage Steam startup movie $name", e) } finally { diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt index 0b8f928ca1..f61c6c1a89 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionPrefs.kt @@ -499,6 +499,16 @@ object SessionPrefs { .onFailure { android.util.Log.e("GameEnvironment", "Could not update game environment", it) } } + fun bootMovie(context: Context): String = + prefs(context).getString("bootMovie", BootMovie.DROIDDECK_30) ?: BootMovie.DROIDDECK_30 + fun setBootMovie(context: Context, id: String) { prefs(context).edit().putString("bootMovie", id).apply() } + fun bootMovieSound(context: Context): Boolean = prefs(context).getBoolean("bootMovieSound", true) + fun setBootMovieSound(context: Context, on: Boolean) { prefs(context).edit().putBoolean("bootMovieSound", on).apply() } + fun bootMovieCustomName(context: Context): String? = prefs(context).getString("bootMovieCustomName", null) + fun setBootMovieCustomName(context: Context, name: String?) { + prefs(context).edit().apply { if (name == null) remove("bootMovieCustomName") else putString("bootMovieCustomName", name) }.apply() + } + fun runSteamAtStartup(context: Context): Boolean = prefs(context).getBoolean("runSteamAtStartup", false) fun setRunSteamAtStartup(context: Context, on: Boolean) { diff --git a/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt b/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt index 6f2771f7d2..f5304ed1ea 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SettingsReset.kt @@ -21,7 +21,7 @@ object SettingsReset { "noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "guestHostname", "fexPreset", "forceSsbs", "logs", "storageDiagnostics", "upscaler", "upscaleSharpness", "screenEffects", "textureAnisotropy", "textureLodBias", - "steamDownloadsInBackground", "steam_offline", + "steamDownloadsInBackground", "steam_offline", "bootMovie", "bootMovieSound", "questDefaultsV1", ) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt index 89471658ef..15bc39e5c9 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/ModeSettingsDialog.kt @@ -27,6 +27,7 @@ import androidx.compose.ui.layout.boundsInRoot import androidx.compose.ui.layout.onGloballyPositioned import com.droiddeck.launcher.core.FexPreset import com.droiddeck.launcher.runtime.DeckyManager +import com.droiddeck.launcher.session.BootMovie import com.droiddeck.launcher.session.SessionPrefs import com.droiddeck.launcher.session.SessionService @@ -84,6 +85,11 @@ class ModeSettings( val steamController: String? = null, val unfoldedControls: Boolean? = null, val runSteamAtStartup: Boolean = false, + val bootMovie: String? = null, + val bootMovieSound: Boolean = true, + val bootMovieCustomName: String? = null, + val bootMovieImporting: Boolean = false, + val bootMovieProgress: Int = -1, val wifiDiscovery: Boolean? = null, val wifiDiscoveryPermission: Boolean = false, val wifiDiscoveryLocation: Boolean = false, @@ -128,6 +134,10 @@ class ModeSettingsActions( val onSteamController: (String) -> Unit = {}, val onUnfoldedControls: (Boolean) -> Unit = {}, val onRunSteamAtStartup: (Boolean) -> Unit = {}, + val onBootMovie: (String) -> Unit = {}, + val onBootMovieSound: (Boolean) -> Unit = {}, + val onImportBootMovie: () -> Unit = {}, + val onRemoveBootMovie: () -> Unit = {}, val onWifiDiscovery: (Boolean) -> Unit = {}, val onWifiDiscoverySettings: () -> Unit = {}, val onDeckyInstall: (DeckyManager.Release) -> Unit = {}, @@ -417,6 +427,41 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras: SecondaryButton(stringResource(R.string.mode_steam_repair_button), enabled = !s.steamRepairQueued, onClick = a.onSteamRepair) } } + if (s.bootMovie != null) SettingsGroup(stringResource(R.string.boot_movie)) { + ChoiceRow( + host, "boot-movie", stringResource(R.string.boot_movie_video), stringResource(R.string.common_applies_next_session), + buildList { + add(BootMovie.DROIDDECK_30 to stringResource(R.string.boot_movie_droiddeck, 30)) + add(BootMovie.DROIDDECK_60 to stringResource(R.string.boot_movie_droiddeck, 60)) + s.bootMovieCustomName?.let { add(BootMovie.CUSTOM to it) } + }, s.bootMovie, + note = stringResource(R.string.boot_movie_note), onPick = a.onBootMovie, + ) + ToggleRow( + host, "boot-movie-sound", stringResource(R.string.boot_movie_sound), + stringResource(R.string.common_applies_next_session), s.bootMovieSound, onChange = a.onBootMovieSound, + ) + SettingsRow( + stringResource(R.string.boot_movie_custom), + stringResource(R.string.boot_movie_custom_hint, (BootMovie.MAX_BYTES shr 20).toInt(), BootMovie.MAX_CONVERT_SECONDS), + ) { + Row(horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(6.dp)) { + SecondaryButton( + when { + s.bootMovieProgress >= 0 -> stringResource(R.string.boot_movie_converting, s.bootMovieProgress) + s.bootMovieImporting -> stringResource(R.string.common_working) + else -> stringResource(R.string.boot_movie_import) + }, + enabled = !s.bootMovieImporting, + progress = s.bootMovieProgress.takeIf { it >= 0 }?.let { it / 100f }, + onClick = a.onImportBootMovie, + ) + if (s.bootMovieCustomName != null) SecondaryButton( + stringResource(R.string.boot_movie_remove), enabled = !s.bootMovieImporting, onClick = a.onRemoveBootMovie, + ) + } + } + } if (s.wifiDiscovery != null) SettingsGroup(stringResource(R.string.mode_network)) { val hint = when { s.wifiDiscovery && !s.wifiDiscoveryLocation -> stringResource(R.string.mode_wifi_location_off) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 85a486e546..4f00f84d70 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2336,4 +2336,21 @@ الإكمال التام %1$s س %1$d د + فيديو الإقلاع + الفيديو + DroidDeck · %1$d إطار/ث + معدل 60 إطارًا/ث أكثر سلاسة لكنه يستهلك المعالج أكثر أثناء بدء Steam. فيديو البدء المختار في إعدادات Steam نفسها له الأولوية. + الصوت + فيديو خاص بك + MP4 أو MOV أو MKV أو WebM. تُحوَّل الصيغ الأخرى والملفات الأكبر من %1$d ميغابايت إلى WebM بدقة 720p على الجهاز، حتى %2$d ثانية. + استيراد + إزالة + اختر فيديو الإقلاع + أصبح %1$s فيديو الإقلاع + أصبح %1$s فيديو الإقلاع، بلا صوت + يجب ألا تتجاوز مدة الفيديو المطلوب تحويله %1$d ثانية + جارٍ التحويل %1$d%% + جارٍ تحويل %1$s لـ Steam. أبقِ DroidDeck مفتوحًا. + لا يستطيع هذا الجهاز فك ترميز هذا الفيديو. + تعذّر استيراد الفيديو diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index 982623fd10..42d2b70242 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -90,4 +90,21 @@ %1$d juegos agregados %1$d juegos agregados + Video de arranque + Video + DroidDeck · %1$d fps + 60 fps se ve más fluido pero usa más CPU mientras Steam se inicia. Un video de inicio elegido en la configuración de Steam tiene prioridad. + Sonido + Tu propio video + MP4, MOV, MKV o WebM. Otros formatos y archivos de más de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos. + Importar + Quitar + Elige un video de arranque + %1$s es ahora el video de arranque + %1$s es ahora el video de arranque, sin sonido + Los videos que hay que convertir deben durar %1$d segundos o menos + Convirtiendo %1$d %% + Convirtiendo %1$s para Steam. Mantén DroidDeck abierto. + Este dispositivo no puede decodificar ese video. + No se pudo importar ese video diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index e4d11bb157..ffd32f0e74 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -2236,4 +2236,21 @@ Пълно %1$s ч %1$d мин + Начално видео + Видео + DroidDeck · %1$d кадъра/с + 60 кадъра/с изглежда по-гладко, но натоварва повече процесора, докато Steam се стартира. Начално видео, избрано в настройките на Steam, има предимство. + Звук + Собствено видео + MP4, MOV, MKV или WebM. Други формати и файлове над %1$d MB се конвертират на устройството до WebM 720p, до %2$d секунди. + Импортиране + Премахване + Изберете начално видео + %1$s вече е началното видео + %1$s вече е началното видео, без звук + Видеата за конвертиране трябва да са до %1$d секунди + Конвертиране %1$d%% + %1$s се конвертира за Steam. Не затваряйте DroidDeck. + Устройството не може да декодира това видео. + Видеото не можа да бъде импортирано diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 85d7db5cc8..c924487456 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -2286,4 +2286,21 @@ Kompletní %1$s h %1$d min + Úvodní video + Video + DroidDeck · %1$d fps + 60 fps vypadá plynuleji, ale při spouštění Steamu víc zatěžuje procesor. Úvodní video vybrané přímo v nastavení Steamu má přednost. + Zvuk + Vlastní video + MP4, MOV, MKV nebo WebM. Jiné formáty a soubory nad %1$d MB se v zařízení převedou na WebM 720p, nejvýše %2$d sekund. + Importovat + Odebrat + Vyberte úvodní video + %1$s je nyní úvodní video + %1$s je nyní úvodní video, bez zvuku + Videa k převodu mohou mít nejvýše %1$d sekund + Převádění %1$d %% + Převádí se %1$s pro Steam. Nechte DroidDeck otevřený. + Toto zařízení video nedokáže dekódovat. + Video se nepodařilo importovat diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index c8d1a92997..e73872f58c 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -2236,4 +2236,21 @@ Komplettering %1$s t %1$d min + Opstartsvideo + Video + DroidDeck · %1$d fps + 60 fps ser mere flydende ud, men bruger mere CPU, mens Steam starter. En opstartsvideo valgt i Steams egne indstillinger har forrang. + Lyd + Din egen video + MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM på enheden, op til %2$d sekunder. + Importér + Fjern + Vælg en opstartsvideo + %1$s er nu opstartsvideoen + %1$s er nu opstartsvideoen, uden lyd + Videoer, der skal konverteres, må højst vare %1$d sekunder + Konverterer %1$d %% + Konverterer %1$s til Steam. Hold DroidDeck åben. + Enheden kan ikke afkode videoen. + Kunne ikke importere videoen diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 378d769f34..1c907cf3f9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2250,4 +2250,21 @@ Nicht genug freier Speicher: %1$s benötigt, nur %2$s frei Zu wenig Speicher (%1$s frei, %2$s benötigt) Freier Speicher unbekannt + Bootvideo + Video + DroidDeck · %1$d fps + 60 fps wirkt flüssiger, braucht aber mehr CPU, während Steam startet. Ein in Steam selbst gewähltes Startvideo hat Vorrang. + Ton + Eigenes Video + MP4, MOV, MKV oder WebM. Andere Formate und Dateien über %1$d MB werden auf dem Gerät in 720p-WebM umgewandelt, bis %2$d Sekunden. + Importieren + Entfernen + Bootvideo auswählen + %1$s ist jetzt das Bootvideo + %1$s ist jetzt das Bootvideo, ohne Ton + Videos, die umgewandelt werden, dürfen höchstens %1$d Sekunden lang sein + Umwandeln %1$d %% + %1$s wird für Steam umgewandelt. DroidDeck geöffnet lassen. + Dieses Gerät kann das Video nicht dekodieren. + Das Video konnte nicht importiert werden diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 2e6dbb9c6e..2ac8f1bc9b 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -2236,4 +2236,21 @@ Ολοκλήρωση %1$s ώ. %1$d λεπ. + Βίντεο εκκίνησης + Βίντεο + DroidDeck · %1$d fps + Τα 60 fps φαίνονται πιο ομαλά, αλλά επιβαρύνουν περισσότερο τον επεξεργαστή όσο ξεκινά το Steam. Ένα βίντεο εκκίνησης που επιλέχθηκε στις ρυθμίσεις του Steam έχει προτεραιότητα. + Ήχος + Δικό σας βίντεο + MP4, MOV, MKV ή WebM. Άλλες μορφές και αρχεία πάνω από %1$d MB μετατρέπονται στη συσκευή σε WebM 720p, έως %2$d δευτερόλεπτα. + Εισαγωγή + Αφαίρεση + Επιλέξτε βίντεο εκκίνησης + Το %1$s είναι πλέον το βίντεο εκκίνησης + Το %1$s είναι πλέον το βίντεο εκκίνησης, χωρίς ήχο + Τα βίντεο προς μετατροπή πρέπει να διαρκούν έως %1$d δευτερόλεπτα + Μετατροπή %1$d%% + Μετατροπή του %1$s για το Steam. Αφήστε το DroidDeck ανοιχτό. + Η συσκευή δεν μπορεί να αποκωδικοποιήσει αυτό το βίντεο. + Δεν ήταν δυνατή η εισαγωγή του βίντεο diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 4237f04dba..4d10e3f1e9 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2275,4 +2275,21 @@ No hay suficiente espacio libre: se necesitan %1$s y solo hay %2$s libres Espacio insuficiente (%1$s libres, se necesitan %2$s) Espacio libre desconocido + Vídeo de arranque + Vídeo + DroidDeck · %1$d fps + 60 fps se ve más fluido pero usa más CPU mientras Steam se inicia. Un vídeo de inicio elegido en los ajustes de Steam tiene prioridad. + Sonido + Tu propio vídeo + MP4, MOV, MKV o WebM. Otros formatos y archivos de más de %1$d MB se convierten a WebM 720p en el dispositivo, hasta %2$d segundos. + Importar + Quitar + Elige un vídeo de arranque + %1$s es ahora el vídeo de arranque + %1$s es ahora el vídeo de arranque, sin sonido + Los vídeos que hay que convertir deben durar %1$d segundos o menos + Convirtiendo %1$d %% + Convirtiendo %1$s para Steam. Mantén DroidDeck abierto. + Este dispositivo no puede decodificar ese vídeo. + No se pudo importar ese vídeo diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 20229e7a42..f69fc2e2ae 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -2236,4 +2236,21 @@ Kaikki %1$s t %1$d min + Käynnistysvideo + Video + DroidDeck · %1$d fps + 60 fps näyttää sulavammalta, mutta kuormittaa suoritinta enemmän Steamin käynnistyessä. Steamin omista asetuksista valittu käynnistysvideo on etusijalla. + Ääni + Oma video + MP4, MOV, MKV tai WebM. Muut muodot ja yli %1$d Mt:n tiedostot muunnetaan laitteella 720p-WebM-muotoon, enintään %2$d sekuntia. + Tuo + Poista + Valitse käynnistysvideo + %1$s on nyt käynnistysvideo + %1$s on nyt käynnistysvideo, ilman ääntä + Muunnettavan videon pituus saa olla enintään %1$d sekuntia + Muunnetaan %1$d %% + Muunnetaan %1$s Steamille. Pidä DroidDeck auki. + Laite ei pysty purkamaan videota. + Videon tuonti epäonnistui diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5d1167ce38..622f0990e0 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -2275,4 +2275,21 @@ Espace libre insuffisant : %1$s nécessaires, seulement %2$s libres Espace insuffisant (%1$s libres, %2$s nécessaires) Espace libre inconnu + Vidéo de démarrage + Vidéo + DroidDeck · %1$d i/s + 60 i/s est plus fluide mais sollicite davantage le processeur pendant le démarrage de Steam. Une vidéo de démarrage choisie dans les paramètres de Steam est prioritaire. + Son + Votre propre vidéo + MP4, MOV, MKV ou WebM. Les autres formats et les fichiers de plus de %1$d Mo sont convertis en WebM 720p sur l\'appareil, jusqu\'à %2$d secondes. + Importer + Supprimer + Choisir une vidéo de démarrage + %1$s est maintenant la vidéo de démarrage + %1$s est maintenant la vidéo de démarrage, sans son + Les vidéos à convertir doivent durer %1$d secondes au maximum + Conversion %1$d %% + Conversion de %1$s pour Steam. Gardez DroidDeck ouvert. + Cet appareil ne peut pas décoder cette vidéo. + Impossible d\'importer cette vidéo diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index e3c3ddb1b7..775a652909 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -2236,4 +2236,21 @@ पूरा %1$s घं %1$d मि + बूट वीडियो + वीडियो + DroidDeck · %1$d fps + 60 fps ज़्यादा स्मूथ दिखता है, लेकिन Steam शुरू होते समय CPU ज़्यादा इस्तेमाल करता है। Steam की अपनी सेटिंग्स में चुना गया स्टार्टअप वीडियो प्राथमिकता लेता है। + आवाज़ + अपना वीडियो + MP4, MOV, MKV या WebM. दूसरे फ़ॉर्मैट और %1$d MB से बड़ी फ़ाइलें डिवाइस पर 720p WebM में बदली जाती हैं, %2$d सेकंड तक। + इंपोर्ट करें + हटाएं + बूट वीडियो चुनें + %1$s अब बूट वीडियो है + %1$s अब बूट वीडियो है, बिना आवाज़ के + बदले जाने वाले वीडियो %1$d सेकंड या उससे छोटे होने चाहिए + बदला जा रहा है %1$d%% + %1$s को Steam के लिए बदला जा रहा है। DroidDeck खुला रखें। + यह डिवाइस उस वीडियो को डिकोड नहीं कर सकता। + वीडियो इंपोर्ट नहीं हो सका diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 101e2b640d..7f6631fe1e 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2236,4 +2236,21 @@ Teljes %1$s óra %1$d perc + Indítóvideó + Videó + DroidDeck · %1$d fps + A 60 fps simább, de jobban terheli a processzort a Steam indulása közben. A Steam saját beállításaiban választott indítóvideó elsőbbséget élvez. + Hang + Saját videó + MP4, MOV, MKV vagy WebM. Más formátumokat és a %1$d MB-nál nagyobb fájlokat az eszköz 720p WebM-re alakítja, legfeljebb %2$d másodpercig. + Importálás + Eltávolítás + Válassz indítóvideót + Mostantól %1$s az indítóvideó + Mostantól %1$s az indítóvideó, hang nélkül + Az átalakítandó videó legfeljebb %1$d másodperces lehet + Átalakítás %1$d%% + %1$s átalakítása a Steamhez. Hagyd nyitva a DroidDecket. + Ez az eszköz nem tudja dekódolni a videót. + Nem sikerült importálni a videót diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index afa8bdff7b..d97c476ee2 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -2211,4 +2211,21 @@ Tuntas %1$s j %1$d mnt + Video boot + Video + DroidDeck · %1$d fps + 60 fps terlihat lebih mulus tetapi memakai lebih banyak CPU saat Steam dimulai. Video startup yang dipilih di pengaturan Steam sendiri lebih diutamakan. + Suara + Video sendiri + MP4, MOV, MKV, atau WebM. Format lain dan file di atas %1$d MB dikonversi ke WebM 720p di perangkat, hingga %2$d detik. + Impor + Hapus + Pilih video boot + %1$s sekarang menjadi video boot + %1$s sekarang menjadi video boot, tanpa suara + Video yang perlu dikonversi maksimal %1$d detik + Mengonversi %1$d%% + Mengonversi %1$s untuk Steam. Biarkan DroidDeck tetap terbuka. + Perangkat ini tidak dapat mendekode video itu. + Tidak dapat mengimpor video itu diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e111892988..6876a5a407 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -2275,4 +2275,21 @@ Spazio libero insufficiente: servono %1$s, ne sono liberi solo %2$s Spazio insufficiente (%1$s liberi, ne servono %2$s) Spazio libero sconosciuto + Video di avvio + Video + DroidDeck · %1$d fps + 60 fps è più fluido ma usa più CPU durante l\'avvio di Steam. Un video di avvio scelto nelle impostazioni di Steam ha la precedenza. + Audio + Il tuo video + MP4, MOV, MKV o WebM. Altri formati e file oltre %1$d MB vengono convertiti in WebM 720p sul dispositivo, fino a %2$d secondi. + Importa + Rimuovi + Scegli un video di avvio + %1$s è ora il video di avvio + %1$s è ora il video di avvio, senza audio + I video da convertire devono durare al massimo %1$d secondi + Conversione %1$d%% + Conversione di %1$s per Steam. Tieni aperto DroidDeck. + Questo dispositivo non può decodificare il video. + Impossibile importare il video diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 4631e254b6..68c310f57b 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -2219,4 +2219,21 @@ コンポーネントをダウンロード ダウンロードは「コンポーネント」ページと共有されます。上でダウンロード済みのバージョンを選ぶと、次回のゲーム起動時に使用されます。 ダウンロードするバージョンを選択 + 起動ムービー + ムービー + DroidDeck · %1$d fps + 60 fps はなめらかですが、Steam の起動中に CPU をより多く使います。Steam 本体の設定で選んだ起動ムービーが優先されます。 + サウンド + 自分のムービー + MP4、MOV、MKV、WebM。その他の形式や %1$d MB を超えるファイルは、端末上で 720p の WebM に変換されます(%2$d 秒まで)。 + インポート + 削除 + 起動ムービーを選択 + %1$s を起動ムービーに設定しました + %1$s を起動ムービーに設定しました(無音) + 変換が必要なムービーは %1$d 秒以内にしてください + 変換中 %1$d%% + %1$s を Steam 用に変換しています。DroidDeck を開いたままにしてください。 + この端末ではその動画をデコードできません。 + ムービーをインポートできませんでした diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 88cc1cdc8c..c8efee1347 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -2219,4 +2219,21 @@ 구성 요소 다운로드 다운로드는 구성 요소 페이지와 공유됩니다. 위에서 다운로드한 버전을 선택하면 다음 게임 실행 시 사용됩니다. 다운로드할 버전 선택 + 부팅 동영상 + 동영상 + DroidDeck · %1$d fps + 60 fps는 더 부드럽지만 Steam이 시작되는 동안 CPU를 더 사용합니다. Steam 자체 설정에서 고른 시작 동영상이 우선합니다. + 소리 + 내 동영상 + MP4, MOV, MKV 또는 WebM. 다른 형식과 %1$d MB를 넘는 파일은 기기에서 720p WebM으로 변환됩니다(최대 %2$d초). + 가져오기 + 삭제 + 부팅 동영상 선택 + %1$s이(가) 이제 부팅 동영상입니다 + %1$s이(가) 이제 부팅 동영상입니다(소리 없음) + 변환이 필요한 동영상은 %1$d초 이하여야 합니다 + 변환 중 %1$d%% + Steam용으로 %1$s 변환 중입니다. DroidDeck을 열어 두세요. + 이 기기에서 해당 동영상을 디코딩할 수 없습니다. + 동영상을 가져오지 못했습니다 diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml index 5e9bcbf533..0ecfa6d256 100644 --- a/app/src/main/res/values-ms/strings.xml +++ b/app/src/main/res/values-ms/strings.xml @@ -2211,4 +2211,21 @@ Lengkap %1$s j %1$d min + Video but + Video + DroidDeck · %1$d fps + 60 fps kelihatan lebih lancar tetapi menggunakan lebih banyak CPU semasa Steam bermula. Video permulaan yang dipilih dalam tetapan Steam sendiri diutamakan. + Bunyi + Video anda sendiri + MP4, MOV, MKV atau WebM. Format lain dan fail melebihi %1$d MB ditukar kepada WebM 720p pada peranti, sehingga %2$d saat. + Import + Alih keluar + Pilih video but + %1$s kini video but + %1$s kini video but, tanpa bunyi + Video yang perlu ditukar mestilah %1$d saat atau kurang + Menukar %1$d%% + Menukar %1$s untuk Steam. Biarkan DroidDeck terbuka. + Peranti ini tidak dapat menyahkod video itu. + Tidak dapat mengimport video itu diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 1452a13f94..71c0ce5d32 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -2236,4 +2236,21 @@ Komplettering %1$s t %1$d min + Oppstartsvideo + Video + DroidDeck · %1$d fps + 60 fps ser jevnere ut, men bruker mer CPU mens Steam starter. En oppstartsvideo valgt i Steams egne innstillinger har forrang. + Lyd + Din egen video + MP4, MOV, MKV eller WebM. Andre formater og filer over %1$d MB konverteres til 720p-WebM på enheten, opptil %2$d sekunder. + Importer + Fjern + Velg en oppstartsvideo + %1$s er nå oppstartsvideoen + %1$s er nå oppstartsvideoen, uten lyd + Videoer som må konverteres kan vare maks %1$d sekunder + Konverterer %1$d %% + Konverterer %1$s for Steam. Hold DroidDeck åpen. + Enheten kan ikke dekode videoen. + Kunne ikke importere videoen diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 1300ec86e7..743d107b3d 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2236,4 +2236,21 @@ Completionist %1$s u %1$d min + Opstartvideo + Video + DroidDeck · %1$d fps + 60 fps oogt vloeiender maar gebruikt meer CPU terwijl Steam opstart. Een opstartvideo die in Steam zelf is gekozen heeft voorrang. + Geluid + Eigen video + MP4, MOV, MKV of WebM. Andere formaten en bestanden boven %1$d MB worden op het apparaat omgezet naar 720p-WebM, tot %2$d seconden. + Importeren + Verwijderen + Kies een opstartvideo + %1$s is nu de opstartvideo + %1$s is nu de opstartvideo, zonder geluid + Video\'s die omgezet moeten worden mogen maximaal %1$d seconden duren + Omzetten %1$d%% + %1$s wordt omgezet voor Steam. Houd DroidDeck open. + Dit apparaat kan deze video niet decoderen. + Kan deze video niet importeren diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 632cc91728..cf0cd0f751 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -2286,4 +2286,21 @@ 100% %1$s godz. %1$d min + Film startowy + Film + DroidDeck · %1$d kl./s + 60 kl./s wygląda płynniej, ale bardziej obciąża procesor podczas uruchamiania Steam. Film startowy wybrany w ustawieniach Steam ma pierwszeństwo. + Dźwięk + Własny film + MP4, MOV, MKV lub WebM. Inne formaty i pliki powyżej %1$d MB są konwertowane na urządzeniu do WebM 720p, do %2$d sekund. + Importuj + Usuń + Wybierz film startowy + %1$s jest teraz filmem startowym + %1$s jest teraz filmem startowym, bez dźwięku + Filmy do konwersji mogą trwać najwyżej %1$d sekund + Konwertowanie %1$d%% + Konwertowanie %1$s dla Steam. Nie zamykaj DroidDeck. + To urządzenie nie może zdekodować tego filmu. + Nie udało się zaimportować filmu diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index f9ddbfca87..dfad334788 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -2275,4 +2275,21 @@ Espaço insuficiente (%1$s livres, são necessários %2$s) Espaço livre insuficiente: são necessários %1$s, só há %2$s livres Espaço livre desconhecido + Vídeo de arranque + Vídeo + DroidDeck · %1$d fps + 60 fps é mais fluido, mas usa mais CPU enquanto o Steam arranca. Um vídeo de arranque escolhido nas definições do Steam tem prioridade. + Som + O seu próprio vídeo + MP4, MOV, MKV ou WebM. Outros formatos e ficheiros acima de %1$d MB são convertidos para WebM 720p no dispositivo, até %2$d segundos. + Importar + Remover + Escolha um vídeo de arranque + %1$s é agora o vídeo de arranque + %1$s é agora o vídeo de arranque, sem som + Os vídeos a converter têm de ter %1$d segundos ou menos + A converter %1$d%% + A converter %1$s para o Steam. Mantenha o DroidDeck aberto. + Este dispositivo não consegue descodificar esse vídeo. + Não foi possível importar esse vídeo diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index efa7014777..2a05c6ea36 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -2275,4 +2275,21 @@ Espaço livre insuficiente: são necessários %1$s, só há %2$s livres Espaço insuficiente (%1$s livres, são necessários %2$s) Espaço livre desconhecido + Vídeo de inicialização + Vídeo + DroidDeck · %1$d fps + 60 fps fica mais fluido, mas usa mais CPU enquanto o Steam inicia. Um vídeo de inicialização escolhido nas configurações do Steam tem prioridade. + Som + Seu próprio vídeo + MP4, MOV, MKV ou WebM. Outros formatos e arquivos acima de %1$d MB são convertidos para WebM 720p no aparelho, até %2$d segundos. + Importar + Remover + Escolha um vídeo de inicialização + %1$s agora é o vídeo de inicialização + %1$s agora é o vídeo de inicialização, sem som + Vídeos que precisam de conversão devem ter até %1$d segundos + Convertendo %1$d%% + Convertendo %1$s para o Steam. Mantenha o DroidDeck aberto. + Este aparelho não consegue decodificar esse vídeo. + Não foi possível importar esse vídeo diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 98bc2572ea..4303875f8a 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -2261,4 +2261,21 @@ Completist %1$s h %1$d min + Videoclip de pornire + Videoclip + DroidDeck · %1$d fps + 60 fps arată mai fluid, dar folosește mai mult procesorul cât pornește Steam. Un videoclip de pornire ales în setările Steam are prioritate. + Sunet + Videoclipul tău + MP4, MOV, MKV sau WebM. Alte formate și fișierele de peste %1$d MB sunt convertite pe dispozitiv în WebM 720p, până la %2$d secunde. + Importă + Elimină + Alege un videoclip de pornire + %1$s este acum videoclipul de pornire + %1$s este acum videoclipul de pornire, fără sunet + Videoclipurile care trebuie convertite pot avea cel mult %1$d secunde + Se convertește %1$d%% + Se convertește %1$s pentru Steam. Lasă DroidDeck deschis. + Acest dispozitiv nu poate decoda videoclipul. + Videoclipul nu a putut fi importat diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 23de595a04..ed500e5669 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2300,4 +2300,21 @@ Недостаточно свободного места: нужно %1$s, свободно только %2$s Недостаточно места (свободно %1$s, нужно %2$s) Свободное место неизвестно + Загрузочное видео + Видео + DroidDeck · %1$d кадр/с + 60 кадр/с выглядит плавнее, но сильнее нагружает процессор при запуске Steam. Видео при запуске, выбранное в настройках самого Steam, имеет приоритет. + Звук + Своё видео + MP4, MOV, MKV или WebM. Другие форматы и файлы больше %1$d МБ преобразуются на устройстве в WebM 720p, до %2$d секунд. + Импорт + Удалить + Выберите загрузочное видео + %1$s теперь загрузочное видео + %1$s теперь загрузочное видео, без звука + Видео для преобразования должно быть не длиннее %1$d секунд + Преобразование %1$d%% + %1$s преобразуется для Steam. Не закрывайте DroidDeck. + Устройство не может декодировать это видео. + Не удалось импортировать видео diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index de2bba9132..a3411343e9 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -2236,4 +2236,21 @@ Komplettering %1$s h %1$d min + Startvideo + Video + DroidDeck · %1$d fps + 60 fps ser jämnare ut men använder mer CPU medan Steam startar. En startvideo vald i Steams egna inställningar har företräde. + Ljud + Egen video + MP4, MOV, MKV eller WebM. Andra format och filer över %1$d MB konverteras till 720p-WebM på enheten, upp till %2$d sekunder. + Importera + Ta bort + Välj en startvideo + %1$s är nu startvideon + %1$s är nu startvideon, utan ljud + Videor som ska konverteras får vara högst %1$d sekunder + Konverterar %1$d %% + Konverterar %1$s för Steam. Håll DroidDeck öppet. + Enheten kan inte avkoda videon. + Kunde inte importera videon diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 785f580a5a..52e50d6b69 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -2211,4 +2211,21 @@ เก็บครบ %1$s ชม. %1$d นาที + วิดีโอบูต + วิดีโอ + DroidDeck · %1$d fps + 60 fps ลื่นกว่าแต่ใช้ CPU มากขึ้นระหว่างที่ Steam กำลังเริ่ม วิดีโอเริ่มต้นที่เลือกในการตั้งค่าของ Steam เองจะมีลำดับความสำคัญกว่า + เสียง + วิดีโอของคุณเอง + MP4, MOV, MKV หรือ WebM รูปแบบอื่นและไฟล์ที่ใหญ่กว่า %1$d MB จะถูกแปลงเป็น WebM 720p บนอุปกรณ์ ความยาวไม่เกิน %2$d วินาที + นำเข้า + ลบ + เลือกวิดีโอบูต + %1$s เป็นวิดีโอบูตแล้ว + %1$s เป็นวิดีโอบูตแล้ว แบบไม่มีเสียง + วิดีโอที่ต้องแปลงต้องยาวไม่เกิน %1$d วินาที + กำลังแปลง %1$d%% + กำลังแปลง %1$s สำหรับ Steam โปรดเปิด DroidDeck ค้างไว้ + อุปกรณ์นี้ถอดรหัสวิดีโอนั้นไม่ได้ + นำเข้าวิดีโอนี้ไม่ได้ diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 98f9bf6d29..2c0889e2cb 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -2250,4 +2250,21 @@ Yeterli boş alan yok: %1$s gerekli, yalnızca %2$s boş Yetersiz alan (%1$s boş, %2$s gerekli) Boş alan bilinmiyor + Açılış videosu + Video + DroidDeck · %1$d fps + 60 fps daha akıcı görünür ama Steam açılırken işlemciyi daha çok kullanır. Steam\'in kendi ayarlarında seçilen açılış videosu önceliklidir. + Ses + Kendi videon + MP4, MOV, MKV veya WebM. Diğer biçimler ve %1$d MB üzeri dosyalar cihazda 720p WebM\'e dönüştürülür, en fazla %2$d saniye. + İçe aktar + Kaldır + Bir açılış videosu seç + %1$s artık açılış videosu + %1$s artık açılış videosu, sessiz + Dönüştürülecek videolar en fazla %1$d saniye olabilir + Dönüştürülüyor %%%1$d + %1$s Steam için dönüştürülüyor. DroidDeck\'i açık tut. + Bu cihaz o videonun kodunu çözemiyor. + Video içe aktarılamadı diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 8064128193..1d358f8720 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -2286,4 +2286,21 @@ 100% %1$s год %1$d хв + Завантажувальне відео + Відео + DroidDeck · %1$d кадр/с + 60 кадр/с виглядає плавніше, але більше навантажує процесор під час запуску Steam. Відео запуску, вибране в налаштуваннях самого Steam, має пріоритет. + Звук + Власне відео + MP4, MOV, MKV або WebM. Інші формати й файли понад %1$d МБ перетворюються на пристрої на WebM 720p, до %2$d секунд. + Імпорт + Видалити + Виберіть завантажувальне відео + %1$s тепер завантажувальне відео + %1$s тепер завантажувальне відео, без звуку + Відео для перетворення має бути не довше %1$d секунд + Перетворення %1$d%% + %1$s перетворюється для Steam. Не закривайте DroidDeck. + Пристрій не може декодувати це відео. + Не вдалося імпортувати відео diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index e93736479e..2c7f8d2bac 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -2211,4 +2211,21 @@ Hoàn thành 100% %1$s giờ %1$d phút + Video khởi động + Video + DroidDeck · %1$d fps + 60 fps mượt hơn nhưng tốn CPU hơn khi Steam đang khởi động. Video khởi động chọn trong cài đặt của chính Steam sẽ được ưu tiên. + Âm thanh + Video của bạn + MP4, MOV, MKV hoặc WebM. Định dạng khác và tệp trên %1$d MB được chuyển sang WebM 720p ngay trên thiết bị, tối đa %2$d giây. + Nhập + Xóa + Chọn video khởi động + %1$s giờ là video khởi động + %1$s giờ là video khởi động, không có tiếng + Video cần chuyển đổi phải dài tối đa %1$d giây + Đang chuyển đổi %1$d%% + Đang chuyển đổi %1$s cho Steam. Hãy để DroidDeck mở. + Thiết bị này không giải mã được video đó. + Không thể nhập video này diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 93f2c05ee6..077bb9a6f9 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -2233,4 +2233,21 @@ 置顶 置底 居中(默认) + 开机动画 + 视频 + DroidDeck · %1$d fps + 60 fps 更流畅,但 Steam 启动时会占用更多 CPU。在 Steam 自身设置中选择的启动动画优先。 + 声音 + 自定义视频 + MP4、MOV、MKV 或 WebM。其他格式及超过 %1$d MB 的文件会在设备上转换为 720p WebM,最长 %2$d 秒。 + 导入 + 移除 + 选择开机动画 + %1$s 现在是开机动画 + %1$s 现在是开机动画(无声) + 需要转换的视频不能超过 %1$d 秒 + 正在转换 %1$d%% + 正在为 Steam 转换 %1$s。请保持 DroidDeck 打开。 + 此设备无法解码该视频。 + 无法导入该视频 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 61582bc784..cd22eba41d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -2223,4 +2223,21 @@ 置頂 置底 置中(預設) + 開機動畫 + 影片 + DroidDeck · %1$d fps + 60 fps 較流暢,但 Steam 啟動時會使用較多 CPU。在 Steam 本身設定中選擇的啟動動畫優先。 + 聲音 + 自訂影片 + MP4、MOV、MKV 或 WebM。其他格式及超過 %1$d MB 的檔案會在裝置上轉換為 720p WebM,最長 %2$d 秒。 + 匯入 + 移除 + 選擇開機動畫 + %1$s 現在是開機動畫 + %1$s 現在是開機動畫(無聲) + 需要轉換的影片不能超過 %1$d 秒 + 正在轉換 %1$d%% + 正在為 Steam 轉換 %1$s。請保持 DroidDeck 開啟。 + 此裝置無法解碼該影片。 + 無法匯入此影片 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index f74f270f0b..4d73f33a78 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -2223,4 +2223,21 @@ 置頂 置底 置中(預設) + 開機動畫 + 影片 + DroidDeck · %1$d fps + 60 fps 較流暢,但 Steam 啟動時會使用較多 CPU。在 Steam 本身設定中選擇的啟動動畫優先。 + 聲音 + 自訂影片 + MP4、MOV、MKV 或 WebM。其他格式及超過 %1$d MB 的檔案會在裝置上轉換為 720p WebM,最長 %2$d 秒。 + 匯入 + 移除 + 選擇開機動畫 + %1$s 現在是開機動畫 + %1$s 現在是開機動畫(無聲) + 需要轉換的影片不能超過 %1$d 秒 + 正在轉換 %1$d%% + 正在為 Steam 轉換 %1$s。請保持 DroidDeck 開啟。 + 此裝置無法解碼該影片。 + 無法匯入此影片 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 64e26b9588..296a9b71c3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2509,4 +2509,21 @@ %d app %d apps + Boot movie + Movie + DroidDeck · %1$d fps + 60 fps looks smoother but uses more CPU while Steam starts. A startup movie picked in Steam\'s own settings takes priority. + Sound + Your own movie + MP4, MOV, MKV or WebM. Other formats and files over %1$d MB are converted to 720p WebM on the device, up to %2$d seconds. + Import + Remove + Choose a boot movie + %1$s is now the boot movie + %1$s is now the boot movie, without sound + Movies that need converting must be %1$d seconds or shorter + Converting %1$d%% + Converting %1$s for Steam. Keep DroidDeck open. + This device cannot decode that video. + Could not import that movie diff --git a/app/src/test/java/com/droiddeck/launcher/session/BootMovieTest.kt b/app/src/test/java/com/droiddeck/launcher/session/BootMovieTest.kt new file mode 100644 index 0000000000..5518870e30 --- /dev/null +++ b/app/src/test/java/com/droiddeck/launcher/session/BootMovieTest.kt @@ -0,0 +1,99 @@ +package com.droiddeck.launcher.session + +import android.content.Context +import org.junit.Assert.* +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment +import org.robolectric.annotation.Config +import java.io.File + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [33]) +class BootMovieTest { + private val app get() = RuntimeEnvironment.getApplication() + private val custom get() = File(app.filesDir, "boot-movie/custom.webm") + + @Before fun clear() { + app.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit() + File(app.filesDir, "boot-movie").deleteRecursively() + } + + @Test fun defaultsToThe30FpsMovieWithSound() { + assertEquals(BootMovie.DROIDDECK_30, BootMovie.choice(app)) + assertTrue(SessionPrefs.bootMovieSound(app)) + assertNull(BootMovie.customName(app)) + } + + @Test fun customFallsBackWhenItsFileIsMissing() { + SessionPrefs.setBootMovie(app, BootMovie.CUSTOM) + assertEquals(BootMovie.DROIDDECK_30, BootMovie.choice(app)) + + custom.parentFile!!.mkdirs() + custom.writeText("movie") + SessionPrefs.setBootMovieCustomName(app, "intro.webm") + assertEquals(BootMovie.CUSTOM, BootMovie.choice(app)) + assertEquals("intro.webm", BootMovie.customName(app)) + } + + @Test fun unknownChoiceFallsBack() { + SessionPrefs.setBootMovie(app, "dd120") + assertEquals(BootMovie.DROIDDECK_30, BootMovie.choice(app)) + SessionPrefs.setBootMovie(app, BootMovie.DROIDDECK_60) + assertEquals(BootMovie.DROIDDECK_60, BootMovie.choice(app)) + } + + @Test fun removingTheCustomMovieReturnsToTheDefault() { + custom.parentFile!!.mkdirs() + custom.writeText("movie") + File(custom.parentFile, "custom-muted.webm").writeText("muted") + SessionPrefs.setBootMovieCustomName(app, "intro.webm") + SessionPrefs.setBootMovie(app, BootMovie.CUSTOM) + + BootMovie.removeCustom(app) + + assertFalse(custom.exists()) + assertFalse(File(custom.parentFile, "custom-muted.webm").exists()) + assertNull(BootMovie.customName(app)) + assertEquals(BootMovie.DROIDDECK_30, SessionPrefs.bootMovie(app)) + } + + @Test fun unreadableImportsAreRefused() { + val junk = File(app.cacheDir, "junk.webm") + junk.writeBytes(ByteArray(1024)) + assertEquals(BootMovie.Import.Unsupported(null), BootMovie.import(app, junk)) + assertFalse(custom.exists()) + } + + @Test fun convertedMoviesFitA720pBoxAndKeepTheirShape() { + fun size(w: Int, h: Int, r: Int) = BootMovieTranscoder.layout(w, h, r).let { it.width to it.height } + assertEquals(1280 to 720, size(3840, 2160, 0)) + assertEquals(640 to 480, size(640, 480, 180)) + assertEquals(960 to 720, size(1440, 1080, 0)) + } + + @Test fun portraitMoviesArePillarboxedInto16x9() { + for (layout in listOf(BootMovieTranscoder.layout(1920, 1080, 90), BootMovieTranscoder.layout(1080, 1920, 0))) { + assertEquals(1280, layout.width) + assertEquals(720, layout.height) + assertEquals(404 to 720, layout.contentWidth to layout.contentHeight) + assertEquals(438, layout.x) + } + } + + @Test fun audioIsResampledTo48kHz() { + val stereo = ShortArray(44_100 * 2) { if (it % 2 == 0) 1000 else -1000 } + val out = BootMovieTranscoder.resample(stereo, 2, 44_100) + assertEquals(48_000 * 2, out.size) + assertTrue(out.withIndex().all { (i, v) -> v == (if (i % 2 == 0) 1000 else -1000).toShort() }) + assertSame(stereo, BootMovieTranscoder.resample(stereo, 2, 48_000)) + } + + @Test fun resetCoversTheChoiceButNotTheImportedName() { + assertTrue(SettingsReset.isSessionSetting("bootMovie")) + assertTrue(SettingsReset.isSessionSetting("bootMovieSound")) + assertFalse(SettingsReset.isSessionSetting("bootMovieCustomName")) + } +} diff --git a/artwork/boot-animation-source/README.md b/artwork/boot-animation-source/README.md index 4caa7aa726..8204910362 100644 --- a/artwork/boot-animation-source/README.md +++ b/artwork/boot-animation-source/README.md @@ -1,21 +1,29 @@ # DroidDeck boot animation -This source accompanies the single Steam startup movie bundled by the app: -`app/src/main/assets/steam-startup/droiddeck-startup.webm` (1280×720 at 30 fps, pitch black background, VP8 video -with Opus audio). `droiddeck-boot.html` is the editable animation; the scripts and WAV below -render the animation at the bundled playback profile. No alternate MP4 or WebM exports are kept in the repository. +This source accompanies the Steam startup movies bundled by the app: +`app/src/main/assets/steam-startup/droiddeck-startup.webm` (1280×720 at 30 fps) and +`droiddeck-startup-60.webm` (1280×720 at 60 fps), both with a pitch black background, VP8 video +and Opus audio. `droiddeck-boot.html` is the editable animation; the scripts and WAV below +render the animation at the bundled playback profiles. No alternate MP4 exports are kept in the repository. -From the repository root, render the movie with: +From the repository root, render the movies with: python3 artwork/boot-animation-source/render.py 1280 720 30 app/src/main/assets/steam-startup/droiddeck-startup.webm dark + python3 artwork/boot-animation-source/render.py 1280 720 60 app/src/main/assets/steam-startup/droiddeck-startup-60.webm dark -The bundled profile reduces decoded pixels per second by 78% compared with 1080p/60. -VP8 also lowers software decode cost while Steam is starting. Keep the bundled movie at -720p/30; higher-resolution exports are intended for sharing. +The 30 fps profile reduces decoded pixels per second by 78% compared with 1080p/60, and VP8 +lowers software decode cost while Steam is starting, so 30 fps stays the default. Keep the bundled +movies at 720p; higher-resolution exports are intended for sharing. -The app stages that file into Steam's `config/uioverrides/movies` folder before each session. If -Steam still has its built-in startup movie selected, DroidDeck sets this movie as the device's -startup default before Steam starts. A custom startup movie the user selected later is preserved. +Steam settings > Boot movie picks which movie DroidDeck stages into Steam's +`config/uioverrides/movies` folder before each session: DroidDeck at 30 or 60 fps, or a movie the +user imported. A WebM, MKV or MP4 of up to 50 MB with VP8 or VP9 video (or a WebM with AV1) is used +as is, remuxed to WebM if needed. Anything else Android can decode, up to 60 seconds, is converted on +the device to 720p VP8 with Opus audio, capped at 60 fps; portrait clips are pillarboxed into 16:9 +because Steam fills the screen with the movie. Turning Sound off strips the audio track on the device. +If Steam still has its built-in startup movie selected, DroidDeck sets the staged movie as the +device's startup default before Steam starts. A startup movie the user selected later in Steam is +preserved. To regenerate the soundtrack, run these commands from this directory: