Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
805632efc1 | ||
|
|
fe9d9d5e7d | ||
|
|
1995fc6b75 | ||
|
|
defb0f4983 | ||
|
|
371eab8637 | ||
|
|
f357be4077 | ||
|
|
0fdc22b4fa | ||
|
|
fb85bb279a | ||
|
|
cc4eff98c0 | ||
|
|
0fbf2e205c | ||
|
|
a9f2c1ff99 | ||
|
|
fe4e53f912 | ||
|
|
fed572d19e | ||
|
|
adef523894 | ||
|
|
84bc4b2618 | ||
|
|
ead637cc92 | ||
|
|
eed6071b94 | ||
|
|
6da1f83891 | ||
|
|
8b5ee4f3dd | ||
|
|
a6cca37174 | ||
|
|
fff1b3090d | ||
|
|
c3305d2919 | ||
|
|
b457290a6b | ||
|
|
a11da3fec8 | ||
|
|
99c21ce6ae | ||
|
|
5b6016d88b | ||
|
|
6aaea847a7 | ||
|
|
a615ec6b97 | ||
|
|
c4059d0ead | ||
|
|
f95465067e | ||
|
|
e6a0840fbe | ||
|
|
cb55134cef | ||
|
|
5d83d4833c | ||
|
|
f2bf43a8bc | ||
|
|
b4b36c7e18 | ||
|
|
be01631cab | ||
|
|
02a5f8ad2c | ||
|
|
0964ab8ba2 | ||
|
|
89b8af62ea | ||
|
|
5842d9c1ec | ||
|
|
07463eea04 | ||
|
|
627374d4b5 | ||
|
|
c4b043cba9 | ||
|
|
aa9118a799 | ||
|
|
fe954eef5f | ||
|
|
66d0ef054e | ||
|
|
8f13a56e1a | ||
|
|
8061c4f5f2 | ||
|
|
802d47e980 | ||
|
|
1a9d2686c9 | ||
|
|
95800d8a72 | ||
|
|
3f55cc461e | ||
|
|
c201bc2f03 | ||
|
|
75c095a5b2 | ||
|
|
974806fe80 | ||
|
|
6f64ca2952 | ||
|
|
a9a7498991 | ||
|
|
37446e2d8e | ||
|
|
72f68bdfa7 | ||
|
|
24d7681d92 | ||
|
|
595a846bb9 | ||
|
|
7652d060e2 | ||
|
|
7fc559e64b | ||
|
|
ed1d0f1b10 | ||
|
|
5591a0094d | ||
|
|
6ab46ced54 | ||
|
|
a029b1a7c8 | ||
|
|
ca7f90d1bd | ||
|
|
4fcb221643 | ||
|
|
0f5cd11c08 | ||
|
|
7d0e04bcc0 | ||
|
|
09e0b06e49 | ||
|
|
5c08862194 | ||
|
|
de91db47c7 | ||
|
|
d7422c81cb | ||
|
|
da21481ff3 | ||
|
|
e5dc9c3f89 | ||
|
|
d7500c25c1 | ||
|
|
d1ccd236fd | ||
|
|
5961bf8881 | ||
|
|
0a75e2345e | ||
|
|
70ffe8ff15 | ||
|
|
938ddc5942 | ||
|
|
ec530c6713 | ||
|
|
a53041a352 | ||
|
|
294419109b | ||
|
|
61268fab73 | ||
|
|
8b7917fcc4 | ||
|
|
2563d624ca | ||
|
|
54af977f39 | ||
|
|
21f48382bc | ||
|
|
424c14a344 | ||
|
|
fcb167e661 | ||
|
|
32b3fb64a2 | ||
|
|
71cbb83c06 | ||
|
|
33d80b6d0e | ||
|
|
a9cbb72c63 | ||
|
|
7c496413f8 | ||
|
|
04673a8c8a | ||
|
|
958c27350d | ||
|
|
591f33aa2c | ||
|
|
dcf2314d9d | ||
|
|
4c74d6a1d5 | ||
|
|
5842d30ae8 | ||
|
|
5e19d9dad4 | ||
|
|
b0b4d5d6db | ||
|
|
a55ec642b3 | ||
|
|
aedca9b416 | ||
|
|
d9a5fb034e | ||
|
|
92cc49a265 | ||
|
|
1e83e4e6c2 | ||
|
|
e71580def9 | ||
|
|
2f47ed23cd | ||
|
|
b66eec827d | ||
|
|
df0d71e6f8 | ||
|
|
088886bfb6 | ||
|
|
e0122feb2b | ||
|
|
08a3a61c2a |
@@ -77,11 +77,12 @@ body:
|
||||
id: media-server
|
||||
attributes:
|
||||
label: Media Server
|
||||
description: Are you using Jellyfin or Plex?
|
||||
description: Are you using Jellyfin, Plex or Emby?
|
||||
multiple: true
|
||||
options:
|
||||
- Jellyfin
|
||||
- Plex
|
||||
- Emby
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ body:
|
||||
options:
|
||||
- Jellyfin
|
||||
- Plex
|
||||
- Emby
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ description: >-
|
||||
subosito/flutter-action cannot resolve the release for arm64 (no arm64 entry
|
||||
in the stable manifest) and `channel: master` would clone master HEAD, whose
|
||||
engine is not the patched revision install-patched-engine.ps1 asserts
|
||||
(4c525dac). This file is the only place that pin lives: the tag is fetched so
|
||||
(5d531788). This file is the only place that pin lives: the tag is fetched so
|
||||
the SDK reports its own version, then verified against the immutable commit
|
||||
and against the version Flutter itself reports, so a moved tag fails the job
|
||||
instead of quietly changing SDKs.
|
||||
@@ -16,8 +16,8 @@ runs:
|
||||
- name: Clone Flutter from its immutable commit
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "3.44.0"
|
||||
$expectedCommit = "559ffa3f75e7402d65a8def9c28389a9b2e6fe42"
|
||||
$version = "3.47.1"
|
||||
$expectedCommit = "6655482ec06e547f90abf8ae7590466f4415978d"
|
||||
$root = "$env:RUNNER_TEMP\flutter"
|
||||
git init $root
|
||||
git -C $root remote add origin https://github.com/flutter/flutter.git
|
||||
|
||||
@@ -31,7 +31,7 @@ on:
|
||||
|
||||
env:
|
||||
# Only place this workflow names the SDK; .github/actions/setup-flutter-git pins the same release.
|
||||
FLUTTER_VERSION: "3.44.0"
|
||||
FLUTTER_VERSION: "3.47.1"
|
||||
# Shared by every release build command; SENTRY_DIST stays per-platform.
|
||||
RELEASE_DART_DEFINES: --dart-define=ENABLE_UPDATE_CHECK=true ${{ github.repository == 'edde746/plezy' && '--dart-define=ENABLE_SENTRY=true' || '' }} --dart-define=GIT_COMMIT=${{ github.sha }} --dart-define=SENTRY_ENVIRONMENT=github --dart-define=ENABLE_DONATIONS=true
|
||||
TRUSTED_BUILD_CACHE_VERSION: trusted-build-v1
|
||||
|
||||
@@ -20,7 +20,7 @@ on:
|
||||
|
||||
env:
|
||||
# Only place this workflow names the SDK; .github/actions/setup-flutter-git pins the same release.
|
||||
FLUTTER_VERSION: "3.44.0"
|
||||
FLUTTER_VERSION: "3.47.1"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
@@ -317,7 +317,8 @@ jobs:
|
||||
mpv_property_result_contract_test \
|
||||
hdr_metadata_test \
|
||||
plane_geometry_test \
|
||||
video_params_test
|
||||
video_params_test \
|
||||
plane_render_executor_test
|
||||
|
||||
- name: Run Linux native reliability tests
|
||||
run: |
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
- Run `scripts/run_tests.sh` to run the test suite (same as `flutter test`, but scaled to your core count)
|
||||
- Test your changes thoroughly
|
||||
|
||||
### AI-assisted contributions
|
||||
|
||||
AI-assisted pull requests must state in the PR description which model(s) were used (e.g. Claude Sonnet 4.5, GPT-5, Gemini 3 Pro).
|
||||
|
||||
### Code Quality Checks
|
||||
|
||||
The project includes automated CI checks that run on all pull requests:
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
cask "plezy" do
|
||||
version "2.15.0"
|
||||
sha256 "ad1ada9278d42d706f9e17f0a1fc7a3d8b02ef25536c71674848699955bce9d6"
|
||||
version "2.17.0"
|
||||
sha256 "318b9ac0ff0d239b3edbad57a44c008e7aaf0c5623bc2c595407fce2987ba5e4"
|
||||
|
||||
url "https://github.com/edde746/plezy/releases/download/#{version}/plezy-macos.dmg"
|
||||
name "Plezy"
|
||||
|
||||
@@ -148,7 +148,7 @@ Package managers:
|
||||
## Building from Source
|
||||
|
||||
### Prerequisites
|
||||
- Flutter SDK 3.44.0+
|
||||
- Flutter SDK 3.47.0+
|
||||
- A Plex account, or a Jellyfin or Emby server with user credentials
|
||||
|
||||
### Setup
|
||||
|
||||
@@ -4,6 +4,13 @@ analyzer:
|
||||
exclude:
|
||||
- "**/*.g.dart"
|
||||
- "**/*.freezed.dart"
|
||||
- build/**
|
||||
- android/**
|
||||
- ios/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- macos/**
|
||||
- linux/**
|
||||
|
||||
linter:
|
||||
rules:
|
||||
|
||||
@@ -132,7 +132,7 @@ val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment")
|
||||
val aar = File(mpvDir, mpvAar)
|
||||
val manifest = File(mpvFfmpegDevelopmentDir, ".manifest")
|
||||
val abis = listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||
val libraries = listOf("avcodec", "avutil", "swresample")
|
||||
val libraries = listOf("avcodec", "avformat", "avutil", "swresample")
|
||||
inputs.file(aar)
|
||||
inputs.property("ffmpegVersion", mpvFfmpegVersion)
|
||||
inputs.property("sourceUrl", mpvFfmpegSourceUrl)
|
||||
@@ -145,6 +145,7 @@ val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment")
|
||||
outputs.files(
|
||||
File(mpvFfmpegDevelopmentDir, "include/libavcodec/avcodec.h"),
|
||||
File(mpvFfmpegDevelopmentDir, "include/libavutil/avconfig.h"),
|
||||
File(mpvFfmpegDevelopmentDir, "include/libavformat/avformat.h"),
|
||||
File(mpvFfmpegDevelopmentDir, "include/libswresample/swresample.h"),
|
||||
manifest
|
||||
)
|
||||
@@ -182,7 +183,7 @@ val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment")
|
||||
} catch (error: Exception) {
|
||||
throw GradleException("Failed to extract FFmpeg $mpvFfmpegVersion headers", error)
|
||||
}
|
||||
listOf("libavcodec", "libavutil", "libswresample").forEach { library ->
|
||||
listOf("libavcodec", "libavformat", "libavutil", "libswresample").forEach { library ->
|
||||
project.copy {
|
||||
from(File(extractedSource, library)) {
|
||||
include("*.h")
|
||||
@@ -206,6 +207,7 @@ val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment")
|
||||
from(zipTree(aar)) {
|
||||
include(
|
||||
"jni/*/libavcodec.so",
|
||||
"jni/*/libavformat.so",
|
||||
"jni/*/libavutil.so",
|
||||
"jni/*/libswresample.so"
|
||||
)
|
||||
|
||||
Vendored
+11
@@ -18,3 +18,14 @@
|
||||
|
||||
# growOutputBuffer's JNI descriptor names this type, so it may not be renamed either.
|
||||
-keep class androidx.media3.decoder.SimpleDecoderOutputBuffer { *; }
|
||||
|
||||
# ffmpeg_demuxer_jni.cc resolves the AVIO input proxy's callbacks by name
|
||||
# (FindClass on the interface, GetMethodID for position/read/readAt/length).
|
||||
# Keeping the interface members pins the names on every implementation,
|
||||
# including the anonymous proxy inside FfmpegExtractor.
|
||||
-keep interface com.edde746.plezy.exoplayer.FfmpegDemuxerJni$Input {
|
||||
long position();
|
||||
int read(byte[], int);
|
||||
int readAt(long, byte[], int);
|
||||
long length();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application>
|
||||
<!-- Serves a test asset over content:// so instrumentation covers the
|
||||
SAF/ContentDataSource read path. Exported because the test body
|
||||
runs in the app's process while this provider lives in the
|
||||
androidTest APK's own uid; it serves nothing but this APK's own
|
||||
assets. Merged into the androidTest APK, never into the app. -->
|
||||
<provider
|
||||
android:name="com.edde746.plezy.exoplayer.FixtureContentProvider"
|
||||
android:authorities="com.edde746.plezy.test.fixtures"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+117
@@ -0,0 +1,117 @@
|
||||
package com.edde746.plezy.exoplayer;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* Serves a test asset over a {@code content://} URI so instrumentation can exercise media3's
|
||||
* {@code ContentDataSource} read path.
|
||||
*
|
||||
* <p>A download stored through SAF reaches the player as {@code content://} and is read with
|
||||
* {@code openAssetFileDescriptor} — a different reopen story than a plain file:
|
||||
* {@code FfmpegRandomAccessSource} has to open a <em>second</em> descriptor on the document while
|
||||
* the loader still holds one. Nothing else in the app produces that shape on demand, and MediaStore
|
||||
* would leave rows on the device.
|
||||
*
|
||||
* <p>The provider owns the whole fixture: a test body runs in the <em>app's</em> process and cannot
|
||||
* write into this APK's data directory, so handing it a path could never work. It copies the named
|
||||
* asset into its own cache and returns a read-only descriptor, which crosses the uid boundary fine.
|
||||
*
|
||||
* <p>Java rather than Kotlin on purpose: hosting this provider starts a process for the test APK
|
||||
* alone, and the Kotlin stdlib the instrumentation normally borrows from the app is not on that
|
||||
* process's classpath.
|
||||
*/
|
||||
public final class FixtureContentProvider extends ContentProvider {
|
||||
|
||||
public static final String AUTHORITY = "com.edde746.plezy.test.fixtures";
|
||||
|
||||
/** @param asset path inside this APK's assets, e.g. {@code ffmpeg/seek_cued.mkv}. */
|
||||
public static Uri uriFor(String asset) {
|
||||
return new Uri.Builder().scheme("content").authority(AUTHORITY).path(asset).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
|
||||
String path = uri.getPath();
|
||||
if (path == null || path.length() <= 1) {
|
||||
throw new FileNotFoundException("no asset in " + uri);
|
||||
}
|
||||
String asset = path.substring(1);
|
||||
Context context = getContext();
|
||||
if (context == null) {
|
||||
throw new FileNotFoundException("provider has no context");
|
||||
}
|
||||
File cached = new File(context.getCacheDir(), asset.replace('/', '-'));
|
||||
if (!cached.isFile()) {
|
||||
copyAsset(context, asset, cached);
|
||||
}
|
||||
return ParcelFileDescriptor.open(cached, ParcelFileDescriptor.MODE_READ_ONLY);
|
||||
}
|
||||
|
||||
private static void copyAsset(Context context, String asset, File target) throws FileNotFoundException {
|
||||
File staging = null;
|
||||
try {
|
||||
context.getCacheDir().mkdirs();
|
||||
staging = File.createTempFile("fixture-", null, context.getCacheDir());
|
||||
try (InputStream source = context.getAssets().open(asset);
|
||||
OutputStream sink = new FileOutputStream(staging)) {
|
||||
byte[] buffer = new byte[64 * 1024];
|
||||
for (int read = source.read(buffer); read != -1; read = source.read(buffer)) {
|
||||
sink.write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
// Publish atomically so a concurrent open never sees a short file.
|
||||
if (!staging.renameTo(target) && !target.isFile()) {
|
||||
throw new IOException("could not publish " + target);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
FileNotFoundException failure = new FileNotFoundException("could not stage asset " + asset);
|
||||
failure.initCause(e);
|
||||
throw failure;
|
||||
} finally {
|
||||
if (staging != null && staging.isFile()) {
|
||||
staging.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(Uri uri) {
|
||||
return "video/x-matroska";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri insert(Uri uri, ContentValues values) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import java.io.File
|
||||
import java.io.RandomAccessFile
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Asserts the demuxer's JNI byte source stays reachable under R8.
|
||||
*
|
||||
* `ffmpeg_demuxer_jni.cc` resolves [FfmpegDemuxerJni.Input] by name — `FindClass`
|
||||
* on the interface, then `GetMethodID` for `position`, `read`, `readAt` and
|
||||
* `length`. Nothing in Kotlin calls those methods, so R8 may rename or remove
|
||||
* them while every debug check still passes; the AVIO callbacks would then fail
|
||||
* on the first read and every container would fall back to media3's extractors.
|
||||
* That is the same failure shape as #1703, which shipped.
|
||||
*
|
||||
* Run against the `minified` build type (`-Pplezy.testBuildType=minified`); on an
|
||||
* unminified variant it can only ever pass. Deliberately touches no media3 API,
|
||||
* so the only keep rules it depends on are the ones under test.
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class FfmpegDemuxerReachabilityTest {
|
||||
|
||||
@Test
|
||||
fun avioCallbacksResolveAndServeBothSequentialAndIndexReads() {
|
||||
assertTrue("ffmpeg demuxer JNI library is unavailable", FfmpegDemuxerJni.available)
|
||||
|
||||
val fixture = copyFixture()
|
||||
val input = FileInput(fixture)
|
||||
try {
|
||||
// nativeOpen drives the whole handshake: FindClass on Input, GetMethodID
|
||||
// for all four methods, then avio reads served back through them. A
|
||||
// shrunk or renamed member makes this fail instead of returning streams.
|
||||
val code = FfmpegDemuxerJni.nativeOpen(input)
|
||||
|
||||
assertEquals("nativeOpen failed (${input.lastError ?: "no java error"})", 0, code)
|
||||
assertTrue("demuxer reported no streams", FfmpegDemuxerJni.nativeStreamCount() > 0)
|
||||
assertTrue("position was never called", input.positionCalls > 0)
|
||||
|
||||
// Header parsing is sequential, so it only proves read()/position()/length().
|
||||
// readAt() is the member nothing in the app calls except this interface's
|
||||
// own implementation, and it is what an index seek runs on.
|
||||
val durationUs = FfmpegDemuxerJni.nativeDurationUs()
|
||||
assertTrue("fixture duration unknown", durationUs > 0)
|
||||
val seek = FfmpegDemuxerJni.nativeSeek(durationUs / 2)
|
||||
|
||||
assertTrue("nativeSeek failed with $seek (${input.lastError ?: "no java error"})", seek >= 0)
|
||||
assertTrue("readAt was never called for the index read", input.readAtCalls > 0)
|
||||
} finally {
|
||||
FfmpegDemuxerJni.nativeClose()
|
||||
input.close()
|
||||
fixture.delete()
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyFixture(): File {
|
||||
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
val cacheDir = instrumentation.targetContext.cacheDir.also { it.mkdirs() }
|
||||
val output = File.createTempFile("ffmpeg-reachability-", ".mkv", cacheDir)
|
||||
instrumentation.context.assets.open(FIXTURE).use { source ->
|
||||
output.outputStream().use(source::copyTo)
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
/** Byte source with no media3 involvement, so R8 has nothing else to keep. */
|
||||
private class FileInput(file: File) : FfmpegDemuxerJni.Input {
|
||||
private val handle = RandomAccessFile(file, "r")
|
||||
private val total = file.length()
|
||||
|
||||
var readAtCalls = 0
|
||||
private set
|
||||
|
||||
var positionCalls = 0
|
||||
private set
|
||||
|
||||
override var lastError: String? = null
|
||||
|
||||
override fun position(): Long {
|
||||
positionCalls++
|
||||
return handle.filePointer
|
||||
}
|
||||
|
||||
override fun read(buf: ByteArray, length: Int): Int {
|
||||
val read = handle.read(buf, 0, length)
|
||||
return if (read < 0) 0 else read
|
||||
}
|
||||
|
||||
override fun readAt(position: Long, buf: ByteArray, length: Int): Int {
|
||||
readAtCalls++
|
||||
val restore = handle.filePointer
|
||||
return try {
|
||||
if (position >= total) return 0
|
||||
handle.seek(position)
|
||||
val read = handle.read(buf, 0, length)
|
||||
if (read < 0) 0 else read
|
||||
} finally {
|
||||
handle.seek(restore)
|
||||
}
|
||||
}
|
||||
|
||||
override fun length(): Long = total
|
||||
|
||||
fun close() = handle.close()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
/** The cued fixture from [FfmpegExtractorSeekTest]: a SeekHead plus Cues at the end. */
|
||||
const val FIXTURE = "ffmpeg/seek_cued.mkv"
|
||||
}
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import androidx.media3.common.MediaItem
|
||||
import androidx.media3.common.PlaybackException
|
||||
import androidx.media3.common.Player
|
||||
import androidx.media3.datasource.DataSpec
|
||||
import androidx.media3.datasource.DefaultDataSource
|
||||
import androidx.media3.exoplayer.ExoPlayer
|
||||
import androidx.media3.exoplayer.source.ProgressiveMediaSource
|
||||
import androidx.media3.extractor.ExtractorsFactory
|
||||
import androidx.media3.extractor.text.DefaultSubtitleParserFactory
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import java.io.File
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* End-to-end regression coverage for #2088: audio demuxed by FfmpegExtractor
|
||||
* must reach MediaCodec with the per-codec csd shapes media3's own extractors
|
||||
* emit. With raw ffmpeg extradata as the only csd buffer, Android's Opus
|
||||
* decoders consume the first two real packets as codec delay / seek pre-roll
|
||||
* and then silently discard every decoded sample — the player never leaves
|
||||
* STATE_BUFFERING, which this test observes as a playback timeout.
|
||||
*
|
||||
* The extractors factory contains only FfmpegExtractor, so a fixture that
|
||||
* falls back to media3's extractors fails instead of passing vacuously.
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class FfmpegExtractorAudioCsdPlaybackTest {
|
||||
|
||||
@Test
|
||||
fun opusPlaysToEnd() {
|
||||
playToEnd("ffmpeg/stereo_opus.mka")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun vorbisPlaysToEnd() {
|
||||
playToEnd("ffmpeg/stereo_vorbis.mka")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun flacPlaysToEnd() {
|
||||
playToEnd("ffmpeg/stereo.flac")
|
||||
}
|
||||
|
||||
private fun playToEnd(fixture: String) {
|
||||
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
val context = instrumentation.targetContext
|
||||
val fixtureFile = copyFixture(instrumentation.context, context, fixture)
|
||||
val playbackThread = HandlerThread("ffmpeg-csd-test").apply { start() }
|
||||
val handler = Handler(playbackThread.looper)
|
||||
val completed = CountDownLatch(1)
|
||||
val playerReference = AtomicReference<ExoPlayer>()
|
||||
val errorReference = AtomicReference<Throwable>()
|
||||
|
||||
handler.post {
|
||||
try {
|
||||
val fixtureUri = Uri.fromFile(fixtureFile)
|
||||
val ffmpegOnlyExtractors = ExtractorsFactory {
|
||||
val extractor = FfmpegExtractor.create(
|
||||
{ FfmpegDemuxerPolicy.Preference.FFMPEG },
|
||||
DvConversionMode.DISABLED,
|
||||
DefaultSubtitleParserFactory(),
|
||||
AssHandler(),
|
||||
FfmpegRandomAccessSource(DefaultDataSource.Factory(context)) { DataSpec(fixtureUri) }
|
||||
)
|
||||
assertNotNull("FFmpeg demuxer JNI library is unavailable", extractor)
|
||||
arrayOf(extractor!!)
|
||||
}
|
||||
val player = ExoPlayer.Builder(context, PlezyRenderersFactory(context))
|
||||
.setLooper(playbackThread.looper)
|
||||
.build()
|
||||
playerReference.set(player)
|
||||
player.addListener(object : Player.Listener {
|
||||
override fun onPlayerError(error: PlaybackException) {
|
||||
errorReference.set(error)
|
||||
completed.countDown()
|
||||
}
|
||||
|
||||
override fun onPlaybackStateChanged(playbackState: Int) {
|
||||
if (playbackState == Player.STATE_ENDED) {
|
||||
completed.countDown()
|
||||
}
|
||||
}
|
||||
})
|
||||
val source = ProgressiveMediaSource.Factory(
|
||||
DefaultDataSource.Factory(context),
|
||||
ffmpegOnlyExtractors
|
||||
).createMediaSource(MediaItem.fromUri(fixtureUri))
|
||||
player.setMediaSource(source)
|
||||
player.prepare()
|
||||
player.play()
|
||||
} catch (error: Throwable) {
|
||||
errorReference.set(error)
|
||||
completed.countDown()
|
||||
}
|
||||
}
|
||||
|
||||
val finished = completed.await(20, TimeUnit.SECONDS)
|
||||
val released = CountDownLatch(1)
|
||||
handler.post {
|
||||
playerReference.get()?.release()
|
||||
playbackThread.quitSafely()
|
||||
released.countDown()
|
||||
}
|
||||
val teardownFinished = released.await(5, TimeUnit.SECONDS)
|
||||
playbackThread.join(5_000)
|
||||
val fixtureDeleted = fixtureFile.delete()
|
||||
|
||||
assertTrue("Player teardown timed out for $fixture", teardownFinished)
|
||||
assertTrue("Playback timed out for $fixture", finished)
|
||||
assertNull("Playback failed for $fixture", errorReference.get())
|
||||
assertTrue("Fixture cleanup failed for $fixture", fixtureDeleted)
|
||||
}
|
||||
|
||||
private fun copyFixture(instrumentationContext: Context, targetContext: Context, fixture: String): File {
|
||||
val output = File.createTempFile("ffmpeg-csd-fixture-", null, targetContext.cacheDir)
|
||||
instrumentationContext.assets.open(fixture).use { input ->
|
||||
output.outputStream().use(input::copyTo)
|
||||
}
|
||||
return output
|
||||
}
|
||||
}
|
||||
+357
@@ -0,0 +1,357 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.datasource.DataSource
|
||||
import androidx.media3.datasource.DataSpec
|
||||
import androidx.media3.datasource.DefaultDataSource
|
||||
import androidx.media3.datasource.TransferListener
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.text.DefaultSubtitleParserFactory
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import java.io.File
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Regression coverage for #2096 and for the seam that caused it.
|
||||
*
|
||||
* libavformat resolves seeks through its own index, reading it via
|
||||
* [FfmpegRandomAccessSource]. When that read cannot be served, matroskadec
|
||||
* burns its one-shot Cues parse and every later seek degrades to libavformat's
|
||||
* linear generic scan — which is what buffered a resume for minutes. The cued
|
||||
* fixture here has the same geometry as the file from the report (front
|
||||
* SeekHead, Cues at 99.5% of the file), so a scan is trivially distinguishable
|
||||
* from an index seek: it has to read most of the file.
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class FfmpegExtractorSeekTest {
|
||||
|
||||
private companion object {
|
||||
// Regenerate with:
|
||||
// ffmpeg -f lavfi -i "testsrc=size=160x120:rate=10:duration=30" \
|
||||
// -c:v libx264 -g 10 -pix_fmt yuv420p -preset veryfast seek_cued.mkv
|
||||
// mkvmerge --no-cues -o seek_cueless.mkv seek_cued.mkv
|
||||
// The cued fixture keeps ffmpeg's default layout: a SeekHead at byte 52
|
||||
// pointing at Cues written after the clusters, at 99.5% of the file.
|
||||
const val CUED = "ffmpeg/seek_cued.mkv"
|
||||
const val CUELESS = "ffmpeg/seek_cueless.mkv"
|
||||
|
||||
/** The fixtures are 30 s at 10 fps with a keyframe every second. */
|
||||
const val TARGET_US = 25_000_000L
|
||||
const val KEYFRAME_TOLERANCE_US = 1_500_000L
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cuedSeekLandsOnTheTargetWithoutWalkingTheFile() {
|
||||
withHarness(CUED) { harness ->
|
||||
harness.pumpUntilSampleDelivered()
|
||||
assertTrue(
|
||||
"playback should start at the beginning, got ${harness.lastSampleUs}us",
|
||||
harness.lastSampleUs < 500_000L
|
||||
)
|
||||
|
||||
harness.resetByteCounter()
|
||||
harness.seekTo(TARGET_US)
|
||||
val landed = harness.pumpUntilSampleAtLeast(TARGET_US - KEYFRAME_TOLERANCE_US)
|
||||
|
||||
assertTrue("no sample delivered after seeking to ${TARGET_US}us", landed)
|
||||
assertTrue(
|
||||
"seek landed at ${harness.lastSampleUs}us, expected within " +
|
||||
"${KEYFRAME_TOLERANCE_US}us of ${TARGET_US}us",
|
||||
harness.lastSampleUs <= TARGET_US + KEYFRAME_TOLERANCE_US
|
||||
)
|
||||
// An index seek reads the Cues plus the target cluster. A generic scan
|
||||
// has to read everything up to 83% of the file to get here.
|
||||
val budget = harness.fixtureSize / 3
|
||||
assertTrue(
|
||||
"seek read ${harness.bytesRead} bytes of a ${harness.fixtureSize}-byte file; " +
|
||||
"expected under $budget (index seek, not a scan)",
|
||||
harness.bytesRead < budget
|
||||
)
|
||||
// Reopening per read would mean one request per 64 KB in steady state.
|
||||
assertTrue("random-access opens after seek: ${harness.randomAccessOpens}", harness.randomAccessOpens <= 4)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Without Cues libavformat falls back to its generic scan, exactly as media3's
|
||||
* own MatroskaExtractor scans clusters. That is slow but it must still land on
|
||||
* the target rather than stalling or silently delivering from the wrong place.
|
||||
*/
|
||||
@Test
|
||||
fun cuelessSeekStillReachesTheTarget() {
|
||||
withHarness(CUELESS) { harness ->
|
||||
harness.pumpUntilSampleDelivered()
|
||||
harness.seekTo(TARGET_US)
|
||||
val landed = harness.pumpUntilSampleAtLeast(TARGET_US - KEYFRAME_TOLERANCE_US)
|
||||
|
||||
assertTrue("cueless seek to ${TARGET_US}us delivered nothing", landed)
|
||||
assertTrue(
|
||||
"cueless seek landed at ${harness.lastSampleUs}us",
|
||||
harness.lastSampleUs <= TARGET_US + KEYFRAME_TOLERANCE_US
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A download stored through SAF arrives as `content://`, which media3 reads
|
||||
* with `openAssetFileDescriptor`. The demuxer's index reads therefore have to
|
||||
* open a second descriptor on the same document while the loader still holds
|
||||
* one — the case a `file://` fixture cannot prove.
|
||||
*/
|
||||
@Test
|
||||
fun cuedSeekLandsOnTheTargetThroughAContentUri() {
|
||||
withHarness(CUED, contentUri = true) { harness ->
|
||||
harness.pumpUntilSampleDelivered()
|
||||
|
||||
harness.resetByteCounter()
|
||||
harness.seekTo(TARGET_US)
|
||||
val landed = harness.pumpUntilSampleAtLeast(TARGET_US - KEYFRAME_TOLERANCE_US)
|
||||
|
||||
assertTrue("no sample delivered after a content:// seek to ${TARGET_US}us", landed)
|
||||
assertTrue(
|
||||
"content:// seek landed at ${harness.lastSampleUs}us",
|
||||
harness.lastSampleUs <= TARGET_US + KEYFRAME_TOLERANCE_US
|
||||
)
|
||||
assertTrue(
|
||||
"content:// index read opened no descriptor of its own",
|
||||
harness.randomAccessOpens > 0
|
||||
)
|
||||
val budget = harness.fixtureSize / 3
|
||||
assertTrue(
|
||||
"content:// seek read ${harness.bytesRead} bytes of a ${harness.fixtureSize}-byte file; " +
|
||||
"expected under $budget (index seek, not a scan)",
|
||||
harness.bytesRead < budget
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun playbackFromTheStartDeliversEverySampleFromTheBeginning() {
|
||||
withHarness(CUED) { harness ->
|
||||
val timestamps = harness.pumpSamples(count = 40)
|
||||
|
||||
assertTrue("expected samples from the start, got ${timestamps.size}", timestamps.size >= 40)
|
||||
assertTrue("first sample at ${timestamps.first()}us", timestamps.first() < 500_000L)
|
||||
// Delivery is in decode order, which is not presentation order once the
|
||||
// encoder emits B-frames; what must hold is that the set of samples is
|
||||
// gapless from zero (this fixture is a steady 10 fps).
|
||||
val sorted = timestamps.sorted()
|
||||
assertEquals(sorted.indices.map { it * 100_000L }, sorted)
|
||||
}
|
||||
}
|
||||
|
||||
private fun withHarness(fixture: String, contentUri: Boolean = false, block: (Harness) -> Unit) {
|
||||
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
val context = instrumentation.targetContext
|
||||
val file = copyFixture(instrumentation.context, context, fixture)
|
||||
// The content:// case reads the same asset back through the provider, which
|
||||
// keeps its own copy: this process cannot write into the test APK's dirs.
|
||||
val uri = if (contentUri) FixtureContentProvider.uriFor(fixture) else Uri.fromFile(file)
|
||||
val harness = Harness(context, file, uri)
|
||||
try {
|
||||
harness.prepare()
|
||||
block(harness)
|
||||
} finally {
|
||||
harness.close()
|
||||
file.delete()
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyFixture(instrumentationContext: Context, targetContext: Context, fixture: String): File {
|
||||
val cacheDir = targetContext.cacheDir.also { it.mkdirs() }
|
||||
val output = File.createTempFile("ffmpeg-seek-fixture-", ".mkv", cacheDir)
|
||||
instrumentationContext.assets.open(fixture).use { input ->
|
||||
output.outputStream().use(input::copyTo)
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimal stand-in for ProgressiveMediaPeriod's loader: it opens the data
|
||||
* source, feeds an ExtractorInput, and honours RESULT_SEEK by re-opening —
|
||||
* the same contract media3 implements in ExtractingLoadable.load().
|
||||
*/
|
||||
private class Harness(context: Context, fixture: File, private val uri: Uri) {
|
||||
val fixtureSize = fixture.length()
|
||||
private val counting = CountingDataSourceFactory(DefaultDataSource.Factory(context))
|
||||
private val io = FfmpegRandomAccessSource(counting) { DataSpec(uri) }
|
||||
private val output = CapturingOutput()
|
||||
private val positionHolder = PositionHolder()
|
||||
private val extractor = requireNotNull(
|
||||
FfmpegExtractor.create(
|
||||
{ FfmpegDemuxerPolicy.Preference.FFMPEG },
|
||||
DvConversionMode.DISABLED,
|
||||
DefaultSubtitleParserFactory(),
|
||||
AssHandler(),
|
||||
io
|
||||
)
|
||||
) { "native ffmpeg demuxer unavailable" }
|
||||
|
||||
private var dataSource: DataSource? = null
|
||||
private var input: ExtractorInput? = null
|
||||
private var opensBaseline = 0
|
||||
|
||||
val lastSampleUs: Long
|
||||
get() = output.lastSampleUs
|
||||
|
||||
val bytesRead: Long
|
||||
get() = counting.bytesRead
|
||||
|
||||
val randomAccessOpens: Int
|
||||
get() = io.openCount - opensBaseline
|
||||
|
||||
fun prepare() {
|
||||
openAt(0)
|
||||
assertTrue("fixture should be sniffed by the ffmpeg demuxer", extractor.sniff(input!!))
|
||||
input!!.resetPeekPosition()
|
||||
extractor.init(output)
|
||||
}
|
||||
|
||||
fun resetByteCounter() {
|
||||
counting.reset()
|
||||
opensBaseline = io.openCount
|
||||
}
|
||||
|
||||
fun seekTo(timeUs: Long) {
|
||||
// media3 restarts the load at the SeekMap's byte hint, then calls seek()
|
||||
// on the loader thread before the next read.
|
||||
val hint = output.seekMap?.getSeekPoints(timeUs)?.first?.position ?: 0L
|
||||
openAt(hint)
|
||||
extractor.seek(hint, timeUs)
|
||||
}
|
||||
|
||||
fun pumpUntilSampleDelivered(): Boolean {
|
||||
val before = output.sampleCount
|
||||
return pump { output.sampleCount > before }
|
||||
}
|
||||
|
||||
fun pumpUntilSampleAtLeast(timeUs: Long): Boolean = pump { output.lastSampleUs >= timeUs }
|
||||
|
||||
fun pumpSamples(count: Int): List<Long> {
|
||||
pump { output.sampleTimestamps.size >= count }
|
||||
return output.sampleTimestamps.toList()
|
||||
}
|
||||
|
||||
private fun pump(until: () -> Boolean): Boolean {
|
||||
repeat(200_000) {
|
||||
if (until()) return true
|
||||
when (extractor.read(input!!, positionHolder)) {
|
||||
Extractor.RESULT_SEEK -> openAt(positionHolder.position)
|
||||
Extractor.RESULT_END_OF_INPUT -> return until()
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
return until()
|
||||
}
|
||||
|
||||
private fun openAt(position: Long) {
|
||||
dataSource?.close()
|
||||
val source = counting.createDataSource()
|
||||
val remaining = source.open(DataSpec.Builder().setUri(uri).setPosition(position).build())
|
||||
dataSource = source
|
||||
input = DefaultExtractorInput(
|
||||
source,
|
||||
position,
|
||||
if (remaining == C.LENGTH_UNSET.toLong()) C.LENGTH_UNSET.toLong() else position + remaining
|
||||
)
|
||||
}
|
||||
|
||||
fun close() {
|
||||
extractor.release()
|
||||
dataSource?.close()
|
||||
}
|
||||
}
|
||||
|
||||
private class CapturingOutput : ExtractorOutput {
|
||||
val sampleTimestamps = mutableListOf<Long>()
|
||||
var seekMap: SeekMap? = null
|
||||
private set
|
||||
|
||||
val sampleCount: Int
|
||||
get() = sampleTimestamps.size
|
||||
|
||||
val lastSampleUs: Long
|
||||
get() = sampleTimestamps.lastOrNull() ?: C.TIME_UNSET
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput = CapturingTrack(type, sampleTimestamps)
|
||||
|
||||
override fun endTracks() = Unit
|
||||
|
||||
override fun seekMap(seekMap: SeekMap) {
|
||||
this.seekMap = seekMap
|
||||
}
|
||||
}
|
||||
|
||||
private class CapturingTrack(private val type: Int, private val timestamps: MutableList<Long>) : TrackOutput {
|
||||
private val scratch = ByteArray(64 * 1024)
|
||||
|
||||
override fun format(format: Format) = Unit
|
||||
|
||||
override fun sampleData(input: DataReader, length: Int, allowEndOfInput: Boolean): Int = sampleData(input, length, allowEndOfInput, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
|
||||
override fun sampleData(input: DataReader, length: Int, allowEndOfInput: Boolean, sampleDataPart: Int): Int {
|
||||
val read = input.read(scratch, 0, minOf(length, scratch.size))
|
||||
return if (read == C.RESULT_END_OF_INPUT) 0 else read
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int) {
|
||||
sampleData(data, length, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
data.skipBytes(length)
|
||||
}
|
||||
|
||||
override fun sampleMetadata(timeUs: Long, flags: Int, size: Int, offset: Int, cryptoData: TrackOutput.CryptoData?) {
|
||||
if (type == C.TRACK_TYPE_VIDEO) timestamps.add(timeUs)
|
||||
}
|
||||
}
|
||||
|
||||
/** Counts every byte the demuxer pulls, through either read path. */
|
||||
private class CountingDataSourceFactory(private val delegate: DataSource.Factory) : DataSource.Factory {
|
||||
@Volatile private var counter = 0L
|
||||
|
||||
val bytesRead: Long
|
||||
get() = counter
|
||||
|
||||
fun reset() {
|
||||
counter = 0L
|
||||
}
|
||||
|
||||
override fun createDataSource(): DataSource = Counting(delegate.createDataSource())
|
||||
|
||||
private inner class Counting(private val inner: DataSource) : DataSource {
|
||||
override fun open(dataSpec: DataSpec): Long = inner.open(dataSpec)
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
val read = inner.read(buffer, offset, length)
|
||||
if (read > 0) counter += read
|
||||
return read
|
||||
}
|
||||
|
||||
override fun addTransferListener(transferListener: TransferListener) = inner.addTransferListener(transferListener)
|
||||
|
||||
override fun getUri(): Uri? = inner.uri
|
||||
|
||||
override fun getResponseHeaders(): Map<String, List<String>> = inner.responseHeaders
|
||||
|
||||
override fun close() = inner.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
-171
@@ -1,171 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import android.util.Log
|
||||
import androidx.media3.common.MediaItem
|
||||
import androidx.media3.common.Player
|
||||
import androidx.media3.datasource.DefaultDataSource
|
||||
import androidx.media3.exoplayer.ExoPlayer
|
||||
import androidx.media3.exoplayer.source.ProgressiveMediaSource
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorsFactory
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
import androidx.media3.extractor.text.DefaultSubtitleParserFactory
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.parser.AssSubtitleParserFactory
|
||||
import java.io.File
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* On-device coverage for MKV files whose SeekHead references Tracks after the Clusters (#1969).
|
||||
*
|
||||
* media3 1.11.0 builds the Matroska seek map at the end of the Cues element, which for these files
|
||||
* is before the Tracks element parsed, so the map permanently reports unseekable and ExoPlayer
|
||||
* coerces every seek to t=0 (ProgressiveMediaPeriod; tracking issue androidx/media #3377). The
|
||||
* first test is a canary asserting the upstream defect against a stock MatroskaExtractor — when it
|
||||
* fails after a media3 upgrade, the TrackAwareSeekMap repair in [CuelessSeekExtractorWrapper] can
|
||||
* be retired. The second test drives the production wrapper stack and requires the seek to
|
||||
* actually land.
|
||||
*/
|
||||
class MatroskaLateTracksSeekDeviceTest {
|
||||
private companion object {
|
||||
const val TAG = "MkvLateTracksSeek"
|
||||
const val SEEK_TARGET_MS = 500L
|
||||
const val SETTLE_MS = 2_000L
|
||||
}
|
||||
|
||||
private class Session(
|
||||
val handler: Handler,
|
||||
val thread: HandlerThread,
|
||||
val player: AtomicReference<ExoPlayer?>,
|
||||
val fixture: File
|
||||
)
|
||||
|
||||
@Test
|
||||
fun stockMatroskaExtractorSnapsSeeksToStart() {
|
||||
val result = runSeekScenario("stock") { MatroskaExtractor(DefaultSubtitleParserFactory()) }
|
||||
assertFalse(
|
||||
"upstream media3 now reports tracks-after-clusters MKVs seekable — " +
|
||||
"the TrackAwareSeekMap repair in CuelessSeekExtractorWrapper can be retired",
|
||||
result.seekable
|
||||
)
|
||||
assertTrue(
|
||||
"unseekable media must snap the seek to the start, position=${result.positionAfterSeekMs}ms",
|
||||
result.positionAfterSeekMs < SEEK_TARGET_MS / 2
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wrappedExtractorKeepsSeekPosition() {
|
||||
val result = runSeekScenario("wrapped") {
|
||||
val assHandler = AssHandler()
|
||||
CuelessSeekExtractorWrapper(ZlibMatroskaExtractor(AssSubtitleParserFactory(assHandler), assHandler))
|
||||
}
|
||||
assertTrue("wrapped extractor must report the item seekable", result.seekable)
|
||||
assertTrue(
|
||||
"seek to ${SEEK_TARGET_MS}ms must hold, position=${result.positionAfterSeekMs}ms",
|
||||
result.positionAfterSeekMs >= SEEK_TARGET_MS / 2
|
||||
)
|
||||
}
|
||||
|
||||
private class ScenarioResult(val seekable: Boolean, val positionAfterSeekMs: Long)
|
||||
|
||||
private fun runSeekScenario(label: String, extractorFactory: () -> Extractor): ScenarioResult {
|
||||
val session = openPaused(label, extractorFactory)
|
||||
try {
|
||||
val seekable = onPlayerThread(session) { it.isCurrentMediaItemSeekable }
|
||||
session.handler.post { session.player.get()?.seekTo(SEEK_TARGET_MS) }
|
||||
// The masked position is the seek target; the snap surfaces once the period resolves the
|
||||
// seek, so give the load a moment before sampling the settled position.
|
||||
Thread.sleep(SETTLE_MS)
|
||||
val positionAfterSeekMs = onPlayerThread(session) { it.currentPosition }
|
||||
Log.i(TAG, "==== $label: seekable=$seekable position=${positionAfterSeekMs}ms ====")
|
||||
return ScenarioResult(seekable, positionAfterSeekMs)
|
||||
} finally {
|
||||
teardown(session)
|
||||
}
|
||||
}
|
||||
|
||||
private fun openPaused(label: String, extractorFactory: () -> Extractor): Session {
|
||||
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
val context = instrumentation.targetContext
|
||||
val fixture = copyFixture(context)
|
||||
val thread = HandlerThread("mkv-late-tracks-$label").apply { start() }
|
||||
val handler = Handler(thread.looper)
|
||||
val player = AtomicReference<ExoPlayer?>(null)
|
||||
val ready = CountDownLatch(1)
|
||||
val failed = AtomicBoolean(false)
|
||||
|
||||
handler.post {
|
||||
val exo = ExoPlayer.Builder(context).build()
|
||||
player.set(exo)
|
||||
exo.addListener(
|
||||
object : Player.Listener {
|
||||
override fun onPlaybackStateChanged(playbackState: Int) {
|
||||
if (playbackState == Player.STATE_READY) ready.countDown()
|
||||
}
|
||||
|
||||
override fun onPlayerError(error: androidx.media3.common.PlaybackException) {
|
||||
Log.e(TAG, "$label player error", error)
|
||||
failed.set(true)
|
||||
ready.countDown()
|
||||
}
|
||||
}
|
||||
)
|
||||
val source = ProgressiveMediaSource.Factory(
|
||||
DefaultDataSource.Factory(context),
|
||||
ExtractorsFactory { arrayOf(extractorFactory()) }
|
||||
).createMediaSource(MediaItem.fromUri(Uri.fromFile(fixture)))
|
||||
exo.setMediaSource(source)
|
||||
exo.playWhenReady = false
|
||||
exo.prepare()
|
||||
}
|
||||
|
||||
val session = Session(handler, thread, player, fixture)
|
||||
if (!ready.await(30, TimeUnit.SECONDS) || failed.get()) {
|
||||
teardown(session)
|
||||
error("$label playback never became ready")
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
private fun <T> onPlayerThread(session: Session, read: (ExoPlayer) -> T): T {
|
||||
val value = AtomicReference<T>()
|
||||
val done = CountDownLatch(1)
|
||||
session.handler.post {
|
||||
session.player.get()?.let { value.set(read(it)) }
|
||||
done.countDown()
|
||||
}
|
||||
assertTrue("player thread stalled", done.await(5, TimeUnit.SECONDS))
|
||||
return checkNotNull(value.get())
|
||||
}
|
||||
|
||||
private fun teardown(session: Session) {
|
||||
val done = CountDownLatch(1)
|
||||
session.handler.post {
|
||||
session.player.get()?.release()
|
||||
done.countDown()
|
||||
}
|
||||
done.await(10, TimeUnit.SECONDS)
|
||||
session.thread.quitSafely()
|
||||
session.thread.join(5_000)
|
||||
session.fixture.delete()
|
||||
}
|
||||
|
||||
private fun copyFixture(context: android.content.Context): File {
|
||||
val output = File.createTempFile("mkv-late-tracks-", ".mkv", context.cacheDir)
|
||||
InstrumentationRegistry.getInstrumentation().context.assets
|
||||
.open("ffmpeg/matroska_tracks_at_end.mkv")
|
||||
.use { input -> output.outputStream().use { input.copyTo(it) } }
|
||||
return output
|
||||
}
|
||||
}
|
||||
@@ -19,20 +19,22 @@ else()
|
||||
target_link_libraries(dovi_bridge log)
|
||||
endif()
|
||||
|
||||
foreach(ffmpeg_library avcodec avutil swresample)
|
||||
foreach(ffmpeg_library avcodec avformat avutil swresample)
|
||||
add_library(${ffmpeg_library} SHARED IMPORTED)
|
||||
set_target_properties(${ffmpeg_library} PROPERTIES
|
||||
IMPORTED_LOCATION "${MPV_FFMPEG_ROOT}/native/${ANDROID_ABI}/lib${ffmpeg_library}.so")
|
||||
endforeach()
|
||||
|
||||
add_library(ffmpegJNI SHARED
|
||||
media3_ffmpeg_decoder/ffmpeg_jni.cc)
|
||||
media3_ffmpeg_decoder/ffmpeg_jni.cc
|
||||
media3_ffmpeg_demuxer/ffmpeg_demuxer_jni.cc)
|
||||
target_compile_features(ffmpegJNI PRIVATE cxx_std_17)
|
||||
target_include_directories(ffmpegJNI PRIVATE
|
||||
"${MPV_FFMPEG_ROOT}/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/media3_ffmpeg_decoder")
|
||||
target_link_libraries(ffmpegJNI
|
||||
avcodec
|
||||
avformat
|
||||
avutil
|
||||
swresample
|
||||
android
|
||||
|
||||
@@ -0,0 +1,952 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Plezy
|
||||
*
|
||||
* libavformat demuxing for media3. Wraps an AVFormatContext whose AVIOContext
|
||||
* is served by a media3 ExtractorInput, so FFmpeg parses the container while
|
||||
* media3 keeps owning decoders, renderers, and the whole playback surface.
|
||||
*
|
||||
* The seam used to be seeking. media3's Extractor is a pull API: an extractor
|
||||
* cannot move the input; it returns RESULT_SEEK and the loader re-opens the
|
||||
* data source. libavformat expects random access and seeks whenever it pleases
|
||||
* (MP4 moov at end of file, AVI idx1, MKV Cues, MPEG-PS binary search), so
|
||||
* serving it from the loader alone meant unwinding the in-flight libavformat
|
||||
* call on every backward jump and replaying the whole open — which a
|
||||
* one-shot lazy parse like matroska's Cues cannot survive (#2096).
|
||||
*
|
||||
* libavformat now gets what it actually requires: the Kotlin side hands this
|
||||
* shim a random-access byte source (FfmpegRandomAccessSource), so every AVIO
|
||||
* read succeeds at the position libavformat asked for and nothing is ever
|
||||
* unwound. Two paths serve reads, chosen per read:
|
||||
*
|
||||
* - The loader's ExtractorInput when it already stands at that position. This
|
||||
* is the steady state for sample delivery, and it keeps media3's byte
|
||||
* accounting, back-pressure and load-error policy in charge of streaming.
|
||||
* - The random-access source otherwise (header, index, post-seek jumps).
|
||||
*
|
||||
* Kotlin nudges the loader back into step after a jump by returning
|
||||
* RESULT_SEEK to nativeLogicalPosition(); that is an optimization, never a
|
||||
* correctness requirement, so no budgets or retries guard it.
|
||||
*/
|
||||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
|
||||
extern "C" {
|
||||
#ifdef __cplusplus
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
#ifdef _STDINT_H
|
||||
#undef _STDINT_H
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavcodec/bsf.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavutil/dict.h>
|
||||
#include <libavutil/display.h>
|
||||
#include <libavutil/dovi_meta.h>
|
||||
#include <libavutil/error.h>
|
||||
#include <libavutil/rational.h>
|
||||
}
|
||||
|
||||
#define LOG_TAG "ffmpeg_demuxer"
|
||||
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
|
||||
#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
|
||||
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
|
||||
|
||||
namespace {
|
||||
|
||||
// readPacket() result codes written to out[0]. Negative values are raw
|
||||
// AVERROR codes; ERR_JAVA signals the byte source threw and Kotlin must
|
||||
// rethrow the stored IOException.
|
||||
const jint CODE_PACKET = 0;
|
||||
const jint CODE_EOF = 1;
|
||||
const jint CODE_GROW = 2;
|
||||
const jint ERR_NOT_OPEN = -101;
|
||||
const jint ERR_JAVA = -102;
|
||||
|
||||
// streamInfo() long[] layout. Keep in sync with FfmpegDemuxerJni.kt.
|
||||
const int INFO_TRACK_TYPE = 0; // 0 video, 1 audio, 2 text, -1 unsupported
|
||||
const int INFO_WIDTH = 1;
|
||||
const int INFO_HEIGHT = 2;
|
||||
const int INFO_PAR_NUM = 3;
|
||||
const int INFO_PAR_DEN = 4;
|
||||
const int INFO_FPS_NUM = 5;
|
||||
const int INFO_FPS_DEN = 6;
|
||||
const int INFO_SAMPLE_RATE = 7;
|
||||
const int INFO_CHANNELS = 8;
|
||||
const int INFO_PCM_ENCODING = 9; // media3 C.ENCODING_* value, -1 when n/a
|
||||
const int INFO_ROTATION = 10;
|
||||
const int INFO_SELECTION_FLAGS = 11;
|
||||
const int INFO_ROLE_FLAGS = 12;
|
||||
const int INFO_BITRATE = 13;
|
||||
const int INFO_DOVI_PROFILE = 14; // DV profile from dvcC/dvvC side data, -1 when none
|
||||
const int INFO_DOVI_LEVEL = 15;
|
||||
const int INFO_LATM = 16; // 1 when the audio stream is LOAS/LATM-framed AAC
|
||||
const int INFO_LENGTH = 17;
|
||||
|
||||
// Android AudioFormat encoding constants (media3 C.ENCODING_* mirror them).
|
||||
const jint PCM_ENCODING_NONE = -1;
|
||||
const jint PCM_ENCODING_8BIT = 3;
|
||||
const jint PCM_ENCODING_16BIT = 2;
|
||||
const jint PCM_ENCODING_FLOAT = 4;
|
||||
const jint PCM_ENCODING_24BIT_PACKED = 21;
|
||||
const jint PCM_ENCODING_32BIT = 22;
|
||||
const jint PCM_ENCODING_ALAW = 11;
|
||||
const jint PCM_ENCODING_ULAW = 12;
|
||||
|
||||
// media3 C.SELECTION_FLAG_* and C.ROLE_FLAG_* values.
|
||||
const jint SELECTION_FLAG_DEFAULT = 1;
|
||||
const jint SELECTION_FLAG_FORCED = 2;
|
||||
const jint ROLE_FLAG_MAIN = 1;
|
||||
const jint ROLE_FLAG_DESCRIPTION = 64; // C.ROLE_FLAG_DESCRIPTION
|
||||
const jint ROLE_FLAG_HARD_OF_HEARING = 512; // C.ROLE_FLAG_HARD_OF_HEARING
|
||||
|
||||
constexpr jint kReadChunkBytes = 64 * 1024;
|
||||
|
||||
struct DemuxState {
|
||||
JavaVM* vm = nullptr;
|
||||
jobject input = nullptr;
|
||||
jmethodID midPosition = nullptr;
|
||||
jmethodID midRead = nullptr;
|
||||
jmethodID midReadAt = nullptr;
|
||||
jmethodID midLength = nullptr;
|
||||
jbyteArray readBuffer = nullptr;
|
||||
|
||||
AVFormatContext* format = nullptr;
|
||||
AVIOContext* avio = nullptr;
|
||||
bool opened = false;
|
||||
|
||||
// Byte position libavformat will read next. Authoritative: the AVIO seek
|
||||
// callback moves it, and both read paths serve exactly this offset.
|
||||
int64_t logicalPos = 0;
|
||||
// format->start_time in microseconds; subtracted from delivered pts so
|
||||
// media3's zero-based timeline matches the duration we report (MPEG-PS/TS
|
||||
// containers commonly start at a nonzero PCR).
|
||||
int64_t startTimeUs = 0;
|
||||
|
||||
AVPacket* packet = nullptr;
|
||||
AVPacket* filteredPacket = nullptr;
|
||||
// A packet that outgrew the Java-side buffer: already read and filtered,
|
||||
// waiting for redelivery after CODE_GROW. Without this flag the retry's
|
||||
// av_read_frame would silently drop it.
|
||||
bool packetPending = false;
|
||||
|
||||
// Annex-B conversion for H264/HEVC streams stored length-prefixed
|
||||
// (matroska/mp4 family); one context per stream, null when none needed.
|
||||
AVBSFContext** bsf = nullptr;
|
||||
unsigned nbStreams = 0;
|
||||
|
||||
bool javaError = false;
|
||||
};
|
||||
|
||||
// One demuxer at a time: a player session owns exactly one progressive source
|
||||
// and the extractor releases its state before another can open.
|
||||
DemuxState* gState = nullptr;
|
||||
JavaVM* gVm = nullptr;
|
||||
|
||||
// Serializes JNI entry points against closeState: the fallback path can
|
||||
// release the player while the loader thread is inside a native call, and
|
||||
// deleting DemuxState under it is a use-after-free (observed as a scudo
|
||||
// invalid-chunk abort during MPV fallback teardown).
|
||||
pthread_mutex_t gStateMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
struct StateLock {
|
||||
StateLock() { pthread_mutex_lock(&gStateMutex); }
|
||||
~StateLock() { pthread_mutex_unlock(&gStateMutex); }
|
||||
};
|
||||
|
||||
JNIEnv* envFor() {
|
||||
JNIEnv* env = nullptr;
|
||||
if (gVm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) return nullptr;
|
||||
return env;
|
||||
}
|
||||
|
||||
bool javaPending(JNIEnv* env) { return env->ExceptionCheck() == JNI_TRUE; }
|
||||
|
||||
void javaClear(JNIEnv* env) {
|
||||
if (env->ExceptionCheck() == JNI_TRUE) env->ExceptionClear();
|
||||
}
|
||||
|
||||
jlong callPosition(JNIEnv* env, DemuxState* s) { return env->CallLongMethod(s->input, s->midPosition); }
|
||||
|
||||
jlong callLength(JNIEnv* env, DemuxState* s) { return env->CallLongMethod(s->input, s->midLength); }
|
||||
|
||||
// Returns bytes read, 0 at end of input, or -1 when the input failed (the
|
||||
// Kotlin proxy stored the IOException message).
|
||||
jint callRead(JNIEnv* env, DemuxState* s, jint length) {
|
||||
jint n = env->CallIntMethod(s->input, s->midRead, s->readBuffer, length);
|
||||
if (javaPending(env)) {
|
||||
javaClear(env);
|
||||
s->javaError = true;
|
||||
return -1;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
// Same contract as callRead, but at an absolute position: the Kotlin source
|
||||
// reopens its handle when the position is not where it stands.
|
||||
jint callReadAt(JNIEnv* env, DemuxState* s, int64_t position, jint length) {
|
||||
jint n = env->CallIntMethod(s->input, s->midReadAt, static_cast<jlong>(position), s->readBuffer, length);
|
||||
if (javaPending(env)) {
|
||||
javaClear(env);
|
||||
s->javaError = true;
|
||||
return -1;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
int avioReadPacket(void* opaque, uint8_t* buf, int bufSize) {
|
||||
DemuxState* s = static_cast<DemuxState*>(opaque);
|
||||
JNIEnv* env = envFor();
|
||||
if (env == nullptr) return AVERROR(EIO);
|
||||
if (bufSize <= 0) return 0;
|
||||
|
||||
const jint want = bufSize < kReadChunkBytes ? bufSize : kReadChunkBytes;
|
||||
// Prefer the loader's input when it already stands here: those bytes then
|
||||
// count as media3's own load progress, which is what drives its buffering
|
||||
// and back-pressure. Anywhere else, read at the absolute position.
|
||||
const int64_t inputPos = callPosition(env, s);
|
||||
if (javaPending(env)) {
|
||||
javaClear(env);
|
||||
s->javaError = true;
|
||||
return AVERROR(EIO);
|
||||
}
|
||||
const jint n = inputPos == s->logicalPos ? callRead(env, s, want) : callReadAt(env, s, s->logicalPos, want);
|
||||
if (s->javaError) return AVERROR(EIO);
|
||||
if (n < 0) return AVERROR(EIO);
|
||||
if (n == 0) return AVERROR_EOF;
|
||||
|
||||
env->GetByteArrayRegion(s->readBuffer, 0, n, reinterpret_cast<jbyte*>(buf));
|
||||
s->logicalPos += n;
|
||||
return n;
|
||||
}
|
||||
|
||||
int64_t avioSeek(void* opaque, int64_t offset, int whence) {
|
||||
DemuxState* s = static_cast<DemuxState*>(opaque);
|
||||
JNIEnv* env = envFor();
|
||||
if (env == nullptr) return AVERROR(EIO);
|
||||
|
||||
whence &= ~AVSEEK_FORCE;
|
||||
if (whence == AVSEEK_SIZE) {
|
||||
int64_t length = callLength(env, s);
|
||||
if (javaPending(env)) {
|
||||
javaClear(env);
|
||||
s->javaError = true;
|
||||
return -1;
|
||||
}
|
||||
return length < 0 ? -1 : length;
|
||||
}
|
||||
|
||||
int64_t target;
|
||||
if (whence == SEEK_CUR) {
|
||||
target = s->logicalPos + offset;
|
||||
} else if (whence == SEEK_END) {
|
||||
int64_t length = callLength(env, s);
|
||||
if (javaPending(env)) {
|
||||
javaClear(env);
|
||||
s->javaError = true;
|
||||
return AVERROR(EIO);
|
||||
}
|
||||
if (length < 0) return AVERROR(EIO);
|
||||
target = length + offset;
|
||||
} else {
|
||||
target = offset;
|
||||
}
|
||||
|
||||
// Pure bookkeeping: the next read serves this position from whichever path
|
||||
// can, so a seek can no longer fail or need reconciling. avio invalidates
|
||||
// its own buffers after this successful callback.
|
||||
s->logicalPos = target;
|
||||
return target;
|
||||
}
|
||||
|
||||
// Probing (ffio_ensure_seekback) can swap the AVIO buffer for a larger
|
||||
// allocation and free the original, so the pointer handed to
|
||||
// avio_alloc_context may be stale. Free whichever buffer the context
|
||||
// currently holds, exactly once.
|
||||
void freeAvio(DemuxState* s) {
|
||||
if (s->avio == nullptr) return;
|
||||
av_freep(&s->avio->buffer);
|
||||
avio_context_free(&s->avio);
|
||||
}
|
||||
|
||||
void closeState() {
|
||||
DemuxState* s = gState;
|
||||
if (s == nullptr) return; // Close without (or after) an open is a no-op.
|
||||
JNIEnv* env = envFor();
|
||||
if (s->filteredPacket != nullptr) {
|
||||
av_packet_free(&s->filteredPacket);
|
||||
}
|
||||
if (s->bsf != nullptr) {
|
||||
for (unsigned i = 0; i < s->nbStreams; i++) {
|
||||
if (s->bsf[i] != nullptr) av_bsf_free(&s->bsf[i]);
|
||||
}
|
||||
av_freep(&s->bsf);
|
||||
}
|
||||
if (s->packet != nullptr) {
|
||||
av_packet_free(&s->packet);
|
||||
}
|
||||
if (s->format != nullptr) {
|
||||
avformat_close_input(&s->format);
|
||||
}
|
||||
freeAvio(s);
|
||||
if (env != nullptr && s->input != nullptr) {
|
||||
if (s->readBuffer != nullptr) env->DeleteGlobalRef(s->readBuffer);
|
||||
env->DeleteGlobalRef(s->input);
|
||||
}
|
||||
delete s;
|
||||
gState = nullptr;
|
||||
}
|
||||
|
||||
const char* videoMime(AVCodecID id) {
|
||||
switch (id) {
|
||||
case AV_CODEC_ID_H264:
|
||||
return "video/avc";
|
||||
case AV_CODEC_ID_HEVC:
|
||||
return "video/hevc";
|
||||
case AV_CODEC_ID_MPEG4:
|
||||
return "video/mp4v-es";
|
||||
case AV_CODEC_ID_MPEG2VIDEO:
|
||||
return "video/mpeg2";
|
||||
case AV_CODEC_ID_MJPEG:
|
||||
return "video/mjpeg";
|
||||
case AV_CODEC_ID_VP8:
|
||||
return "video/x-vnd.on2.vp8";
|
||||
case AV_CODEC_ID_VP9:
|
||||
return "video/x-vnd.on2.vp9";
|
||||
case AV_CODEC_ID_AV1:
|
||||
return "video/av01";
|
||||
case AV_CODEC_ID_H263:
|
||||
return "video/3gpp";
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const char* audioMime(AVCodecID id, jint* pcmEncoding) {
|
||||
*pcmEncoding = PCM_ENCODING_NONE;
|
||||
switch (id) {
|
||||
case AV_CODEC_ID_AAC:
|
||||
return "audio/mp4a-latm";
|
||||
case AV_CODEC_ID_AAC_LATM:
|
||||
// LOAS/LATM framing. Kotlin wraps the track with LatmTrackOutput, which
|
||||
// unwraps to raw AAC access units and emits the real decoder Format;
|
||||
// this mime only marks the stream as supported.
|
||||
return "audio/mp4a-latm";
|
||||
case AV_CODEC_ID_MP3:
|
||||
return "audio/mpeg";
|
||||
case AV_CODEC_ID_MP2:
|
||||
return "audio/mpeg-L2";
|
||||
case AV_CODEC_ID_AC3:
|
||||
return "audio/ac3";
|
||||
case AV_CODEC_ID_EAC3:
|
||||
return "audio/eac3";
|
||||
case AV_CODEC_ID_DTS:
|
||||
return "audio/vnd.dts";
|
||||
case AV_CODEC_ID_TRUEHD:
|
||||
return "audio/true-hd";
|
||||
case AV_CODEC_ID_FLAC:
|
||||
return "audio/flac";
|
||||
case AV_CODEC_ID_OPUS:
|
||||
return "audio/opus";
|
||||
case AV_CODEC_ID_VORBIS:
|
||||
return "audio/vorbis";
|
||||
case AV_CODEC_ID_ALAC:
|
||||
return "audio/alac";
|
||||
case AV_CODEC_ID_AMR_NB:
|
||||
return "audio/amr";
|
||||
case AV_CODEC_ID_AMR_WB:
|
||||
return "audio/amr-wb";
|
||||
case AV_CODEC_ID_PCM_S16LE:
|
||||
*pcmEncoding = PCM_ENCODING_16BIT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_S16BE:
|
||||
*pcmEncoding = PCM_ENCODING_16BIT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_S8:
|
||||
*pcmEncoding = PCM_ENCODING_8BIT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_U8:
|
||||
*pcmEncoding = PCM_ENCODING_8BIT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_S24LE:
|
||||
*pcmEncoding = PCM_ENCODING_24BIT_PACKED;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_S32LE:
|
||||
*pcmEncoding = PCM_ENCODING_32BIT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_F32LE:
|
||||
*pcmEncoding = PCM_ENCODING_FLOAT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_F32BE:
|
||||
*pcmEncoding = PCM_ENCODING_FLOAT;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_ALAW:
|
||||
*pcmEncoding = PCM_ENCODING_ALAW;
|
||||
return "audio/raw";
|
||||
case AV_CODEC_ID_PCM_MULAW:
|
||||
*pcmEncoding = PCM_ENCODING_ULAW;
|
||||
return "audio/raw";
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const char* subtitleMime(AVCodecID id) {
|
||||
switch (id) {
|
||||
case AV_CODEC_ID_SUBRIP:
|
||||
return "application/x-subrip";
|
||||
case AV_CODEC_ID_ASS:
|
||||
case AV_CODEC_ID_SSA:
|
||||
return "text/x-ssa";
|
||||
case AV_CODEC_ID_WEBVTT:
|
||||
return "text/vtt";
|
||||
case AV_CODEC_ID_HDMV_PGS_SUBTITLE:
|
||||
return "application/pgs";
|
||||
case AV_CODEC_ID_DVD_SUBTITLE:
|
||||
// media3's VobsubParser takes the .idx text (Matroska CodecPrivate,
|
||||
// surfaced verbatim as extradata) as initialization data and the raw
|
||||
// SPU payloads as samples — exactly what this path delivers.
|
||||
return "application/vobsub";
|
||||
default:
|
||||
// DVB subtitles are deliberately dropped: media3's DvbParser expects
|
||||
// the TS/PMT 5-byte config, not Matroska CodecPrivate, and DVB rides
|
||||
// TS in practice — which stays on media3's extractor.
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Maps an attachment ordinal to its stream index. Attachment payloads
|
||||
// (embedded fonts) ride extradata and are fully parsed during
|
||||
// avformat_open_input; these streams never produce packets.
|
||||
int attachmentStreamIndex(AVFormatContext* format, jint ordinal) {
|
||||
jint seen = 0;
|
||||
for (unsigned i = 0; i < format->nb_streams; i++) {
|
||||
AVCodecParameters* params = format->streams[i]->codecpar;
|
||||
if (params->codec_type != AVMEDIA_TYPE_ATTACHMENT) continue;
|
||||
if (params->extradata == nullptr || params->extradata_size <= 0) continue;
|
||||
if (seen++ == ordinal) return static_cast<int>(i);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C" {
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeProbeFormat(JNIEnv* env, jobject thiz, jbyteArray header) {
|
||||
StateLock lock;
|
||||
jsize size = env->GetArrayLength(header);
|
||||
std::vector<uint8_t> padded(static_cast<size_t>(size) + AVPROBE_PADDING_SIZE, 0);
|
||||
env->GetByteArrayRegion(header, 0, size, reinterpret_cast<jbyte*>(padded.data()));
|
||||
|
||||
AVProbeData probe{};
|
||||
probe.buf = padded.data();
|
||||
probe.buf_size = size;
|
||||
probe.filename = "";
|
||||
int score = 0;
|
||||
const AVInputFormat* format = av_probe_input_format2(&probe, 1, &score);
|
||||
if (format == nullptr || score <= 0) return nullptr;
|
||||
return env->NewStringUTF(format->name);
|
||||
}
|
||||
|
||||
// Returns 0 on success or a negative AVERROR (ERR_JAVA when the byte source
|
||||
// itself threw). The stream count is NOT the return value: positive counts
|
||||
// would share the result-code namespace, so callers use nativeStreamCount().
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeOpen(JNIEnv* env, jobject thiz, jobject input) {
|
||||
StateLock lock;
|
||||
if (gVm == nullptr) {
|
||||
env->GetJavaVM(&gVm);
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
}
|
||||
if (gState == nullptr) {
|
||||
gState = new DemuxState();
|
||||
gState->vm = gVm;
|
||||
}
|
||||
DemuxState* s = gState;
|
||||
|
||||
// FindClass on the declared interface (not GetObjectClass on the concrete
|
||||
// proxy): JNI dispatches interface method IDs virtually, and the named
|
||||
// class is what the shrinker keep in proguard-rules.pro pins.
|
||||
jclass inputClass = env->FindClass("com/edde746/plezy/exoplayer/FfmpegDemuxerJni$Input");
|
||||
if (inputClass == nullptr) {
|
||||
javaClear(env);
|
||||
return ERR_NOT_OPEN;
|
||||
}
|
||||
jmethodID midPosition = env->GetMethodID(inputClass, "position", "()J");
|
||||
jmethodID midRead = env->GetMethodID(inputClass, "read", "([BI)I");
|
||||
jmethodID midReadAt = env->GetMethodID(inputClass, "readAt", "(J[BI)I");
|
||||
jmethodID midLength = env->GetMethodID(inputClass, "length", "()J");
|
||||
env->DeleteLocalRef(inputClass);
|
||||
if (midPosition == nullptr || midRead == nullptr || midReadAt == nullptr || midLength == nullptr) {
|
||||
javaClear(env);
|
||||
return ERR_NOT_OPEN;
|
||||
}
|
||||
|
||||
// A fresh open replaces any previous proxy binding.
|
||||
if (s->input != nullptr) {
|
||||
if (s->readBuffer != nullptr) env->DeleteGlobalRef(s->readBuffer);
|
||||
env->DeleteGlobalRef(s->input);
|
||||
s->input = nullptr;
|
||||
s->readBuffer = nullptr;
|
||||
}
|
||||
s->input = env->NewGlobalRef(input);
|
||||
s->midPosition = midPosition;
|
||||
s->midRead = midRead;
|
||||
s->midReadAt = midReadAt;
|
||||
s->midLength = midLength;
|
||||
jbyteArray readBuffer = env->NewByteArray(kReadChunkBytes);
|
||||
s->readBuffer = static_cast<jbyteArray>(env->NewGlobalRef(readBuffer));
|
||||
env->DeleteLocalRef(readBuffer);
|
||||
|
||||
if (s->packet == nullptr) {
|
||||
s->packet = av_packet_alloc();
|
||||
s->filteredPacket = av_packet_alloc();
|
||||
if (s->packet == nullptr || s->filteredPacket == nullptr) return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
// One AVIOContext per item: a stale buffer or a sticky error from the
|
||||
// previous item must not leak into this open, and reallocating is cheaper
|
||||
// than reasoning about which of libavformat's internal fields to reset.
|
||||
freeAvio(s);
|
||||
constexpr int kAvioBufferSize = 64 * 1024;
|
||||
unsigned char* avioBuffer = static_cast<unsigned char*>(av_malloc(kAvioBufferSize));
|
||||
if (avioBuffer == nullptr) return AVERROR(ENOMEM);
|
||||
s->avio = avio_alloc_context(
|
||||
avioBuffer, kAvioBufferSize, /*write_flag=*/0, s, avioReadPacket,
|
||||
/*write_packet=*/nullptr, avioSeek);
|
||||
if (s->avio == nullptr) {
|
||||
av_freep(&avioBuffer);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
s->javaError = false;
|
||||
s->packetPending = false;
|
||||
s->logicalPos = 0;
|
||||
// Nothing is ever resumed across calls now: every read succeeds at the
|
||||
// position libavformat asked for, so open_input and find_stream_info each
|
||||
// run once, to completion.
|
||||
avformat_close_input(&s->format);
|
||||
s->opened = false;
|
||||
|
||||
s->format = avformat_alloc_context();
|
||||
if (s->format == nullptr) return AVERROR(ENOMEM);
|
||||
s->format->pb = s->avio;
|
||||
// Generate missing PTS: some raw streams (MPEG-TS after a seek) present
|
||||
// packets without timestamps that media3 cannot schedule.
|
||||
s->format->flags |= AVFMT_FLAG_GENPTS;
|
||||
|
||||
int err = avformat_open_input(&s->format, "", nullptr, nullptr);
|
||||
if (s->javaError) return ERR_JAVA;
|
||||
if (err < 0) {
|
||||
LOGW("avformat_open_input failed: %d", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = avformat_find_stream_info(s->format, nullptr);
|
||||
if (s->javaError) return ERR_JAVA;
|
||||
if (err < 0) {
|
||||
LOGW("avformat_find_stream_info failed: %d", err);
|
||||
return err;
|
||||
}
|
||||
// Zero-base the timeline: delivered pts subtract this so media3 sees
|
||||
// [0, duration] even when the container starts at a nonzero PCR/PTS.
|
||||
s->startTimeUs = s->format->start_time != AV_NOPTS_VALUE ? s->format->start_time : 0;
|
||||
s->opened = true;
|
||||
|
||||
bool anySupported = false;
|
||||
for (unsigned i = 0; i < s->format->nb_streams; i++) {
|
||||
AVStream* stream = s->format->streams[i];
|
||||
AVCodecID codecId = stream->codecpar->codec_id;
|
||||
jint pcmEncoding;
|
||||
bool supported = videoMime(codecId) != nullptr || audioMime(codecId, &pcmEncoding) != nullptr ||
|
||||
subtitleMime(codecId) != nullptr;
|
||||
// ID3/MKV attached pictures surface as video streams; media3 cannot
|
||||
// render them as tracks.
|
||||
if (stream->attached_pic.size > 0) supported = false;
|
||||
if (!supported) {
|
||||
LOGW("Dropping stream %u: unsupported codec %s", i, avcodec_get_name(codecId));
|
||||
stream->discard = AVDISCARD_ALL;
|
||||
} else {
|
||||
anySupported = true;
|
||||
}
|
||||
}
|
||||
if (!anySupported) {
|
||||
// Fail fast so the session falls back (mpv decodes WMV and friends)
|
||||
// instead of buffering an empty track list forever.
|
||||
LOGW("No supported streams; refusing container");
|
||||
avformat_close_input(&s->format);
|
||||
s->opened = false;
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
// MediaCodec requires Annex-B start-code framing for H264/HEVC, while the
|
||||
// matroska/mp4 family stores length-prefixed NAL units and libavformat
|
||||
// hands those through verbatim (ffmpeg muxers insert the same
|
||||
// *_mp4toannexb bitstream filters in this situation). Filter those streams
|
||||
// here so every packet leaving the shim is decoder-ready, and adopt the
|
||||
// filter's rewritten parameters so extradata surfaces as Annex-B csd too.
|
||||
if (s->bsf != nullptr) {
|
||||
for (unsigned i = 0; i < s->nbStreams; i++) {
|
||||
if (s->bsf[i] != nullptr) av_bsf_free(&s->bsf[i]);
|
||||
}
|
||||
av_freep(&s->bsf);
|
||||
}
|
||||
s->nbStreams = s->format->nb_streams;
|
||||
s->bsf = static_cast<AVBSFContext**>(av_calloc(s->nbStreams, sizeof(*s->bsf)));
|
||||
if (s->bsf == nullptr) return AVERROR(ENOMEM);
|
||||
for (unsigned i = 0; i < s->nbStreams; i++) {
|
||||
AVCodecID codecId = s->format->streams[i]->codecpar->codec_id;
|
||||
const char* filterName = codecId == AV_CODEC_ID_H264 ? "h264_mp4toannexb"
|
||||
: codecId == AV_CODEC_ID_HEVC ? "hevc_mp4toannexb"
|
||||
// AVI-family MPEG-4 ASP commonly packs several VOPs into one chunk;
|
||||
// hardware decoders silently drop those stacks (observed as a decoder
|
||||
// hang with zero output), so unpack them like every ffmpeg pipeline.
|
||||
: codecId == AV_CODEC_ID_MPEG4 ? "mpeg4_unpack_bframes"
|
||||
: nullptr;
|
||||
const AVBitStreamFilter* filter = av_bsf_get_by_name(filterName);
|
||||
AVBSFContext* ctx = nullptr;
|
||||
if (filter == nullptr || av_bsf_alloc(filter, &ctx) < 0 ||
|
||||
avcodec_parameters_copy(ctx->par_in, s->format->streams[i]->codecpar) < 0) {
|
||||
if (ctx != nullptr) av_bsf_free(&ctx);
|
||||
continue;
|
||||
}
|
||||
ctx->time_base_in = s->format->streams[i]->time_base;
|
||||
if (av_bsf_init(ctx) < 0) {
|
||||
av_bsf_free(&ctx);
|
||||
continue;
|
||||
}
|
||||
avcodec_parameters_copy(s->format->streams[i]->codecpar, ctx->par_out);
|
||||
s->format->streams[i]->time_base = ctx->time_base_out;
|
||||
s->bsf[i] = ctx;
|
||||
}
|
||||
|
||||
return 0; // Success; prepareTracks() reads the count via nativeStreamCount().
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeClose(JNIEnv* env, jobject thiz) {
|
||||
StateLock lock;
|
||||
closeState();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeStreamCount(JNIEnv* env, jobject thiz) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr) return ERR_NOT_OPEN;
|
||||
return static_cast<jint>(gState->format->nb_streams);
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeDurationUs(JNIEnv* env, jobject thiz) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr) return -1;
|
||||
int64_t duration = gState->format->duration;
|
||||
return duration == AV_NOPTS_VALUE ? -1 : duration;
|
||||
}
|
||||
|
||||
// Returns true when the stream is usable and filled the out arrays.
|
||||
JNIEXPORT jboolean JNICALL Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeStreamInfo(
|
||||
JNIEnv* env, jobject thiz, jint index, jlongArray numbers, jobjectArray strings) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr || index < 0 ||
|
||||
index >= static_cast<jint>(gState->format->nb_streams)) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
AVStream* stream = gState->format->streams[index];
|
||||
AVCodecParameters* params = stream->codecpar;
|
||||
|
||||
jint trackType;
|
||||
const char* mime = nullptr;
|
||||
jint pcmEncoding = PCM_ENCODING_NONE;
|
||||
switch (params->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
trackType = 0;
|
||||
mime = videoMime(params->codec_id);
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
trackType = 1;
|
||||
mime = audioMime(params->codec_id, &pcmEncoding);
|
||||
break;
|
||||
case AVMEDIA_TYPE_SUBTITLE:
|
||||
trackType = 2;
|
||||
mime = subtitleMime(params->codec_id);
|
||||
break;
|
||||
default:
|
||||
return JNI_FALSE;
|
||||
}
|
||||
if (mime == nullptr) return JNI_FALSE;
|
||||
|
||||
jlong info[INFO_LENGTH] = {};
|
||||
info[INFO_TRACK_TYPE] = trackType;
|
||||
info[INFO_WIDTH] = params->width;
|
||||
info[INFO_HEIGHT] = params->height;
|
||||
AVRational par = params->sample_aspect_ratio;
|
||||
if (par.num <= 0 || par.den <= 0) par = stream->sample_aspect_ratio;
|
||||
info[INFO_PAR_NUM] = par.num > 0 ? par.num : 1;
|
||||
info[INFO_PAR_DEN] = par.num > 0 ? par.den : 1;
|
||||
AVRational fps = stream->avg_frame_rate;
|
||||
info[INFO_FPS_NUM] = fps.num > 0 ? fps.num : 0;
|
||||
info[INFO_FPS_DEN] = fps.num > 0 ? fps.den : 0;
|
||||
info[INFO_SAMPLE_RATE] = params->sample_rate > 0 ? params->sample_rate : -1;
|
||||
info[INFO_CHANNELS] = params->ch_layout.nb_channels > 0 ? params->ch_layout.nb_channels : -1;
|
||||
info[INFO_PCM_ENCODING] = pcmEncoding;
|
||||
info[INFO_LATM] = params->codec_id == AV_CODEC_ID_AAC_LATM ? 1 : 0;
|
||||
|
||||
jint rotation = 0;
|
||||
AVPacketSideData* sideData = nullptr;
|
||||
for (int i = 0; i < params->nb_coded_side_data; i++) {
|
||||
if (params->coded_side_data[i].type == AV_PKT_DATA_DISPLAYMATRIX) {
|
||||
sideData = ¶ms->coded_side_data[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sideData != nullptr) {
|
||||
double angle = av_display_rotation_get(reinterpret_cast<const int32_t*>(sideData->data));
|
||||
if (!std::isnan(angle)) rotation = static_cast<jint>(-lround(angle));
|
||||
}
|
||||
info[INFO_ROTATION] = rotation;
|
||||
|
||||
jint selectionFlags = 0;
|
||||
jint roleFlags = 0;
|
||||
if (stream->disposition & AV_DISPOSITION_DEFAULT) selectionFlags |= SELECTION_FLAG_DEFAULT;
|
||||
if (stream->disposition & AV_DISPOSITION_FORCED) selectionFlags |= SELECTION_FLAG_FORCED;
|
||||
if (stream->disposition & AV_DISPOSITION_HEARING_IMPAIRED) roleFlags |= ROLE_FLAG_HARD_OF_HEARING;
|
||||
if (stream->disposition & AV_DISPOSITION_VISUAL_IMPAIRED) roleFlags |= ROLE_FLAG_DESCRIPTION;
|
||||
if (selectionFlags == 0 && trackType != 2) roleFlags |= ROLE_FLAG_MAIN;
|
||||
info[INFO_SELECTION_FLAGS] = selectionFlags;
|
||||
info[INFO_ROLE_FLAGS] = roleFlags;
|
||||
info[INFO_BITRATE] = params->bit_rate > 0 ? params->bit_rate : -1;
|
||||
|
||||
// Dolby Vision configuration (dvcC/dvvC), surfaced by libavformat as an
|
||||
// unpacked AVDOVIDecoderConfigurationRecord — one byte per field, not the
|
||||
// bit-packed ISOBMFF box layout. Kotlin mirrors media3's DolbyVisionConfig
|
||||
// to publish video/dolby-vision plus the RFC 6381 codecs string.
|
||||
info[INFO_DOVI_PROFILE] = -1;
|
||||
info[INFO_DOVI_LEVEL] = -1;
|
||||
for (int i = 0; i < params->nb_coded_side_data; i++) {
|
||||
AVPacketSideData* sd = ¶ms->coded_side_data[i];
|
||||
if (sd->type == AV_PKT_DATA_DOVI_CONF && sd->size >= sizeof(AVDOVIDecoderConfigurationRecord)) {
|
||||
const AVDOVIDecoderConfigurationRecord* dovi =
|
||||
reinterpret_cast<const AVDOVIDecoderConfigurationRecord*>(sd->data);
|
||||
info[INFO_DOVI_PROFILE] = dovi->dv_profile;
|
||||
info[INFO_DOVI_LEVEL] = dovi->dv_level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
env->SetLongArrayRegion(numbers, 0, INFO_LENGTH, info);
|
||||
|
||||
const char* language = nullptr;
|
||||
const char* label = nullptr;
|
||||
if (stream->metadata != nullptr) {
|
||||
AVDictionaryEntry* entry = av_dict_get(stream->metadata, "language", nullptr, 0);
|
||||
if (entry != nullptr) language = entry->value;
|
||||
entry = av_dict_get(stream->metadata, "title", nullptr, 0);
|
||||
if (entry != nullptr) label = entry->value;
|
||||
}
|
||||
env->SetObjectArrayElement(strings, 0, env->NewStringUTF(mime));
|
||||
env->SetObjectArrayElement(strings, 1, language != nullptr ? env->NewStringUTF(language) : nullptr);
|
||||
env->SetObjectArrayElement(strings, 2, label != nullptr ? env->NewStringUTF(label) : nullptr);
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeStreamExtradata(JNIEnv* env, jobject thiz, jint index) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr || index < 0 ||
|
||||
index >= static_cast<jint>(gState->format->nb_streams)) {
|
||||
return nullptr;
|
||||
}
|
||||
AVCodecParameters* params = gState->format->streams[index]->codecpar;
|
||||
// libavformat carries the AVI stream's WAVEFORMATEX header as MP3
|
||||
// extradata. MediaCodec mp3 decoders expect either no csd or the two-byte
|
||||
// ISO header, and report a WAVEFORMATEX blob as corrupt input
|
||||
// (C2_CORRUPTED on the first work item), so drop it.
|
||||
if (params->codec_id == AV_CODEC_ID_MP3) return nullptr;
|
||||
if (params->extradata == nullptr || params->extradata_size <= 0) return nullptr;
|
||||
jbyteArray result = env->NewByteArray(params->extradata_size);
|
||||
env->SetByteArrayRegion(result, 0, params->extradata_size, reinterpret_cast<const jbyte*>(params->extradata));
|
||||
return result;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeAttachmentCount(JNIEnv* env, jobject thiz) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr) return 0;
|
||||
jint count = 0;
|
||||
while (attachmentStreamIndex(gState->format, count) >= 0) count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
// Fills strings with [filename, mimetype] and returns the payload size in
|
||||
// bytes, or -1 when the ordinal is out of range.
|
||||
JNIEXPORT jlong JNICALL Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeAttachmentInfo(
|
||||
JNIEnv* env, jobject thiz, jint ordinal, jobjectArray strings) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr) return -1;
|
||||
int index = attachmentStreamIndex(gState->format, ordinal);
|
||||
if (index < 0) return -1;
|
||||
AVStream* stream = gState->format->streams[index];
|
||||
const char* filename = nullptr;
|
||||
const char* mimetype = nullptr;
|
||||
if (stream->metadata != nullptr) {
|
||||
AVDictionaryEntry* entry = av_dict_get(stream->metadata, "filename", nullptr, 0);
|
||||
if (entry != nullptr) filename = entry->value;
|
||||
entry = av_dict_get(stream->metadata, "mimetype", nullptr, 0);
|
||||
if (entry != nullptr) mimetype = entry->value;
|
||||
}
|
||||
env->SetObjectArrayElement(strings, 0, filename != nullptr ? env->NewStringUTF(filename) : nullptr);
|
||||
env->SetObjectArrayElement(strings, 1, mimetype != nullptr ? env->NewStringUTF(mimetype) : nullptr);
|
||||
return stream->codecpar->extradata_size;
|
||||
}
|
||||
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeAttachmentData(JNIEnv* env, jobject thiz, jint ordinal) {
|
||||
StateLock lock;
|
||||
if (gState == nullptr || gState->format == nullptr) return nullptr;
|
||||
int index = attachmentStreamIndex(gState->format, ordinal);
|
||||
if (index < 0) return nullptr;
|
||||
AVCodecParameters* params = gState->format->streams[index]->codecpar;
|
||||
jbyteArray result = env->NewByteArray(params->extradata_size);
|
||||
if (result == nullptr) return nullptr;
|
||||
env->SetByteArrayRegion(result, 0, params->extradata_size, reinterpret_cast<const jbyte*>(params->extradata));
|
||||
return result;
|
||||
}
|
||||
|
||||
// Reads one packet. out[0] carries the result code; on CODE_PACKET the packet
|
||||
// bytes were written into the byte array and out carries
|
||||
// [1]=streamIndex [2]=ptsUs (start-time normalized; packets without any
|
||||
// timestamp are dropped, media3 cannot schedule them) [3]=flags [4]=size
|
||||
// [5]=packet position in input coordinates [6]=durationUs (-1 unknown).
|
||||
JNIEXPORT jint JNICALL Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeReadPacket(
|
||||
JNIEnv* env, jobject thiz, jbyteArray buffer, jlongArray out) {
|
||||
StateLock lock;
|
||||
DemuxState* s = gState;
|
||||
if (s == nullptr || !s->opened || s->format == nullptr) return ERR_NOT_OPEN;
|
||||
|
||||
jint capacity = env->GetArrayLength(buffer);
|
||||
jlong result[7] = {};
|
||||
s->javaError = false;
|
||||
while (true) {
|
||||
if (s->packetPending) {
|
||||
// Oversized packet held across a CODE_GROW round trip: deliver it now
|
||||
// instead of reading (and losing) a new frame.
|
||||
s->packetPending = false;
|
||||
} else {
|
||||
av_packet_unref(s->packet);
|
||||
int err = av_read_frame(s->format, s->packet);
|
||||
if (err == AVERROR_EOF) {
|
||||
result[0] = CODE_EOF;
|
||||
env->SetLongArrayRegion(out, 0, 7, result);
|
||||
return CODE_EOF;
|
||||
}
|
||||
if (err < 0 || s->javaError) {
|
||||
result[0] = s->javaError ? ERR_JAVA : err;
|
||||
env->SetLongArrayRegion(out, 0, 7, result);
|
||||
return s->javaError ? ERR_JAVA : err;
|
||||
}
|
||||
if (s->packet->size <= 0) continue;
|
||||
|
||||
if (s->format->streams[s->packet->stream_index]->discard >= AVDISCARD_ALL) continue;
|
||||
|
||||
AVBSFContext* bsf = s->bsf != nullptr && s->packet->stream_index < static_cast<int>(s->nbStreams)
|
||||
? s->bsf[s->packet->stream_index]
|
||||
: nullptr;
|
||||
if (bsf != nullptr) {
|
||||
// send consumes the packet reference; move the filtered result back so
|
||||
// the delivery code below keeps a single code path.
|
||||
int filterErr = av_bsf_send_packet(bsf, s->packet);
|
||||
if (filterErr >= 0) {
|
||||
av_packet_unref(s->packet);
|
||||
filterErr = av_bsf_receive_packet(bsf, s->filteredPacket);
|
||||
if (filterErr == AVERROR(EAGAIN)) continue;
|
||||
if (filterErr < 0) {
|
||||
result[0] = filterErr;
|
||||
env->SetLongArrayRegion(out, 0, 7, result);
|
||||
return filterErr;
|
||||
}
|
||||
av_packet_move_ref(s->packet, s->filteredPacket);
|
||||
} else {
|
||||
result[0] = filterErr;
|
||||
env->SetLongArrayRegion(out, 0, 7, result);
|
||||
return filterErr;
|
||||
}
|
||||
}
|
||||
}
|
||||
int size = s->packet->size;
|
||||
if (size > capacity) {
|
||||
s->packetPending = true;
|
||||
result[0] = CODE_GROW;
|
||||
result[4] = size;
|
||||
env->SetLongArrayRegion(out, 0, 7, result);
|
||||
return CODE_GROW;
|
||||
}
|
||||
env->SetByteArrayRegion(buffer, 0, size, reinterpret_cast<const jbyte*>(s->packet->data));
|
||||
|
||||
AVStream* stream = s->format->streams[s->packet->stream_index];
|
||||
int64_t ptsUs;
|
||||
if (s->packet->pts != AV_NOPTS_VALUE) {
|
||||
ptsUs = av_rescale_q(s->packet->pts, stream->time_base, AVRational{1, 1000000});
|
||||
} else if (s->packet->dts != AV_NOPTS_VALUE) {
|
||||
ptsUs = av_rescale_q(s->packet->dts, stream->time_base, AVRational{1, 1000000});
|
||||
} else {
|
||||
// No timestamp even after GENPTS: media3 cannot schedule the sample,
|
||||
// and delivering data without metadata would corrupt the sample queue.
|
||||
continue;
|
||||
}
|
||||
ptsUs -= s->startTimeUs;
|
||||
|
||||
result[0] = CODE_PACKET;
|
||||
result[1] = s->packet->stream_index;
|
||||
result[2] = ptsUs;
|
||||
result[3] = (s->packet->flags & AV_PKT_FLAG_KEY) != 0 ? 1 : 0;
|
||||
result[4] = size;
|
||||
result[5] = s->packet->pos >= 0 ? s->packet->pos : 0;
|
||||
result[6] =
|
||||
s->packet->duration > 0 ? av_rescale_q(s->packet->duration, stream->time_base, AVRational{1, 1000000}) : -1;
|
||||
env->SetLongArrayRegion(out, 0, 7, result);
|
||||
return CODE_PACKET;
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeLogicalPosition(JNIEnv* env, jobject thiz) {
|
||||
StateLock lock;
|
||||
DemuxState* s = gState;
|
||||
if (s == nullptr || !s->opened) return -1;
|
||||
return static_cast<jlong>(s->logicalPos);
|
||||
}
|
||||
|
||||
// Seeks to a presentation time (media3 timeline microseconds, start-time
|
||||
// normalized). Called on the loader thread, where blocking IO belongs:
|
||||
// libavformat reads its own index through the random-access source, so this
|
||||
// either lands on the target keyframe or reports that the container has no
|
||||
// usable index.
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_edde746_plezy_exoplayer_FfmpegDemuxerJni_nativeSeek(JNIEnv* env, jobject thiz, jlong timeUs) {
|
||||
StateLock lock;
|
||||
DemuxState* s = gState;
|
||||
if (s == nullptr || !s->opened || s->format == nullptr) return ERR_NOT_OPEN;
|
||||
s->javaError = false;
|
||||
// Any packet parked for a CODE_GROW retry belongs to the pre-seek stream.
|
||||
s->packetPending = false;
|
||||
if (s->bsf != nullptr) {
|
||||
for (unsigned i = 0; i < s->nbStreams; i++) {
|
||||
if (s->bsf[i] != nullptr) av_bsf_flush(s->bsf[i]);
|
||||
}
|
||||
}
|
||||
const int64_t ts = timeUs + s->startTimeUs;
|
||||
const int err = avformat_seek_file(s->format, -1, INT64_MIN, ts, ts, 0);
|
||||
if (s->javaError) return ERR_JAVA;
|
||||
if (err < 0) {
|
||||
LOGW("seek to %lld failed: %d", (long long)ts, err);
|
||||
return err;
|
||||
}
|
||||
LOGD("seek to %lld: logical=%lld", (long long)ts, (long long)s->logicalPos);
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
@@ -882,7 +882,8 @@ class MainActivity : FlutterActivity() {
|
||||
} catch (e: IllegalStateException) {
|
||||
result.success(mapOf("success" to false, "errorCode" to "not_supported"))
|
||||
} catch (e: Exception) {
|
||||
result.success(mapOf("success" to false, "errorCode" to "unknown", "errorMessage" to (e.message ?: "Unknown error")))
|
||||
Log.w(TAG, "Failed to enter PiP", e)
|
||||
result.success(mapOf("success" to false, "errorCode" to "unknown", "errorMessage" to e.message))
|
||||
}
|
||||
}
|
||||
"setAutoPipReady" -> {
|
||||
|
||||
-226
@@ -1,226 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.SeekPoint
|
||||
import androidx.media3.extractor.TrackAwareSeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
/**
|
||||
* Extractor wrapper that repairs seeking for MKV files media3 reports as unseekable.
|
||||
*
|
||||
* Two repairs, in priority order:
|
||||
* - [SeekMap.Unseekable] with a known duration (no Cues element at all): replaced with a
|
||||
* proportional byte-position estimate, resynced to the nearest Cluster boundary after seeking.
|
||||
* - A [TrackAwareSeekMap] whose [SeekMap.isSeekable] is false (media3 1.11.0 builds the Matroska
|
||||
* seek map while parsing Cues, which for files whose Tracks element follows the Clusters is
|
||||
* before any track is known — the primary seek track stays unset even though the Cues parsed):
|
||||
* wrapped so seeks resolve through the per-track cue lookups using the track IDs observed on
|
||||
* this output.
|
||||
*/
|
||||
@androidx.media3.common.util.UnstableApi
|
||||
class CuelessSeekExtractorWrapper(
|
||||
private val delegate: Extractor
|
||||
) : Extractor {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CuelessSeek"
|
||||
|
||||
// MKV Cluster element ID: 0x1F43B675 (4-byte EBML Class-D ID)
|
||||
private val CLUSTER_ID = byteArrayOf(0x1F, 0x43, 0xB6.toByte(), 0x75)
|
||||
private const val SCAN_BUFFER_SIZE = 8192
|
||||
|
||||
// Max bytes to scan for a Cluster boundary before giving up
|
||||
private const val MAX_SCAN_BYTES = 1024 * 1024 // 1 MB
|
||||
}
|
||||
|
||||
private var inputLength: Long = C.LENGTH_UNSET.toLong()
|
||||
private var needsClusterResync = false
|
||||
private var isApproximateSeeking = false
|
||||
private var pendingSeekTimeUs: Long = C.TIME_UNSET
|
||||
|
||||
/** Track IDs and types observed on the output, consulted by [TrackCueSeekMap]. */
|
||||
private val registeredTracks = CopyOnWriteArrayList<Pair<Int, Int>>()
|
||||
|
||||
override fun sniff(input: ExtractorInput): Boolean = delegate.sniff(input)
|
||||
|
||||
override fun init(output: ExtractorOutput) {
|
||||
delegate.init(SeekInterceptingOutput(output))
|
||||
}
|
||||
|
||||
override fun read(input: ExtractorInput, seekPosition: PositionHolder): Int {
|
||||
if (inputLength == C.LENGTH_UNSET.toLong()) {
|
||||
inputLength = input.length
|
||||
}
|
||||
if (needsClusterResync) {
|
||||
needsClusterResync = false
|
||||
return scanForCluster(input, seekPosition)
|
||||
}
|
||||
return delegate.read(input, seekPosition)
|
||||
}
|
||||
|
||||
override fun seek(position: Long, timeUs: Long) {
|
||||
if (isApproximateSeeking && position > 0) {
|
||||
needsClusterResync = true
|
||||
pendingSeekTimeUs = timeUs
|
||||
}
|
||||
delegate.seek(position, timeUs)
|
||||
}
|
||||
|
||||
override fun release() = delegate.release()
|
||||
|
||||
/**
|
||||
* Scan forward from the current input position to find the next MKV Cluster
|
||||
* element ID (0x1F43B675). Returns [Extractor.RESULT_SEEK] with the Cluster's
|
||||
* byte position so ExoPlayer repositions the DataSource there.
|
||||
*/
|
||||
private fun scanForCluster(input: ExtractorInput, seekPosition: PositionHolder): Int {
|
||||
val buffer = ByteArray(SCAN_BUFFER_SIZE)
|
||||
var totalScanned = 0L
|
||||
// Carry over last 3 bytes across buffer boundaries to detect split IDs
|
||||
var carry = ByteArray(0)
|
||||
|
||||
while (totalScanned < MAX_SCAN_BYTES) {
|
||||
val toRead = minOf(SCAN_BUFFER_SIZE, (MAX_SCAN_BYTES - totalScanned).toInt())
|
||||
val bytesRead: Int
|
||||
try {
|
||||
bytesRead = input.read(buffer, 0, toRead)
|
||||
} catch (_: Exception) {
|
||||
break
|
||||
}
|
||||
if (bytesRead == C.RESULT_END_OF_INPUT) break
|
||||
|
||||
// Combine carry + new data for scanning
|
||||
val scanData = if (carry.isNotEmpty()) carry + buffer.copyOf(bytesRead) else buffer.copyOf(bytesRead)
|
||||
|
||||
for (i in 0..scanData.size - 4) {
|
||||
if (scanData[i] == CLUSTER_ID[0] &&
|
||||
scanData[i + 1] == CLUSTER_ID[1] &&
|
||||
scanData[i + 2] == CLUSTER_ID[2] &&
|
||||
scanData[i + 3] == CLUSTER_ID[3]
|
||||
) {
|
||||
// Compute the absolute byte position of this Cluster
|
||||
val clusterPosition = input.position - bytesRead - carry.size + i
|
||||
Log.d(TAG, "Found Cluster at byte $clusterPosition (scanned ${totalScanned + i} bytes)")
|
||||
seekPosition.position = clusterPosition
|
||||
delegate.seek(clusterPosition, pendingSeekTimeUs)
|
||||
pendingSeekTimeUs = C.TIME_UNSET
|
||||
return Extractor.RESULT_SEEK
|
||||
}
|
||||
}
|
||||
|
||||
// Keep last 3 bytes as carry for next iteration
|
||||
carry = if (scanData.size >= 3) scanData.copyOfRange(scanData.size - 3, scanData.size) else scanData.copyOf()
|
||||
totalScanned += bytesRead
|
||||
}
|
||||
|
||||
// Failed to find a Cluster — fall back to position 0
|
||||
Log.w(TAG, "No Cluster found after scanning $totalScanned bytes, resetting to start")
|
||||
seekPosition.position = 0
|
||||
delegate.seek(0, 0)
|
||||
return Extractor.RESULT_SEEK
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtractorOutput wrapper that intercepts [seekMap] calls to replace
|
||||
* [SeekMap.Unseekable] with an approximate proportional SeekMap.
|
||||
*/
|
||||
private inner class SeekInterceptingOutput(
|
||||
private val delegate: ExtractorOutput
|
||||
) : ExtractorOutput {
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput {
|
||||
if (registeredTracks.none { it.first == id }) {
|
||||
registeredTracks.add(id to type)
|
||||
}
|
||||
return delegate.track(id, type)
|
||||
}
|
||||
|
||||
override fun endTracks() = delegate.endTracks()
|
||||
|
||||
override fun seekMap(seekMap: SeekMap) {
|
||||
if (seekMap is SeekMap.Unseekable) {
|
||||
val durationUs = seekMap.durationUs
|
||||
if (durationUs != C.TIME_UNSET && durationUs > 0) {
|
||||
Log.i(TAG, "Replacing Unseekable with approximate SeekMap (duration=${durationUs / 1_000_000}s)")
|
||||
isApproximateSeeking = true
|
||||
delegate.seekMap(ApproximateSeekMap(durationUs))
|
||||
return
|
||||
}
|
||||
} else if (!seekMap.isSeekable && seekMap is TrackAwareSeekMap) {
|
||||
Log.i(TAG, "Wrapping unseekable TrackAwareSeekMap with per-track cue seeking")
|
||||
isApproximateSeeking = false
|
||||
delegate.seekMap(TrackCueSeekMap(seekMap))
|
||||
return
|
||||
}
|
||||
// File has real Cues or unknown duration — pass through
|
||||
isApproximateSeeking = false
|
||||
delegate.seekMap(seekMap)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Approximate SeekMap that estimates byte positions proportionally.
|
||||
* Used when the MKV has no Cues but has a known duration.
|
||||
*/
|
||||
private inner class ApproximateSeekMap(
|
||||
private val durationUs: Long
|
||||
) : SeekMap {
|
||||
|
||||
override fun isSeekable(): Boolean = true
|
||||
|
||||
override fun getDurationUs(): Long = durationUs
|
||||
|
||||
override fun getSeekPoints(timeUs: Long): SeekMap.SeekPoints {
|
||||
val length = inputLength
|
||||
if (length == C.LENGTH_UNSET.toLong() || durationUs <= 0) {
|
||||
return SeekMap.SeekPoints(SeekPoint(0, 0))
|
||||
}
|
||||
val clampedTimeUs = timeUs.coerceIn(0, durationUs)
|
||||
val position = (clampedTimeUs.toDouble() / durationUs * length).toLong().coerceIn(0, length)
|
||||
return SeekMap.SeekPoints(SeekPoint(clampedTimeUs, position))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Routes seeks through [TrackAwareSeekMap]'s per-track cue lookups when the delegate reports
|
||||
* unseekable overall. The per-track queries read the live cue data (populated once the Cues
|
||||
* element parsed), so they resolve correctly even when the map was constructed before the
|
||||
* Tracks element — the media3 1.11.0 tracks-after-clusters case (androidx/media #3377).
|
||||
*/
|
||||
private inner class TrackCueSeekMap(
|
||||
private val delegate: TrackAwareSeekMap
|
||||
) : SeekMap {
|
||||
|
||||
override fun isSeekable(): Boolean = delegate.isSeekable || seekableTrackId() != null
|
||||
|
||||
override fun getDurationUs(): Long = delegate.durationUs
|
||||
|
||||
override fun getSeekPoints(timeUs: Long): SeekMap.SeekPoints {
|
||||
if (delegate.isSeekable) return delegate.getSeekPoints(timeUs)
|
||||
val trackId = seekableTrackId() ?: return delegate.getSeekPoints(timeUs)
|
||||
return delegate.getSeekPoints(timeUs, trackId)
|
||||
}
|
||||
|
||||
/** Mirrors media3's primary-track priority: video first, then audio, then anything with cues. */
|
||||
private fun seekableTrackId(): Int? {
|
||||
var audio: Int? = null
|
||||
var fallback: Int? = null
|
||||
for ((id, type) in registeredTracks) {
|
||||
if (!delegate.isSeekable(id)) continue
|
||||
when (type) {
|
||||
C.TRACK_TYPE_VIDEO -> return id
|
||||
C.TRACK_TYPE_AUDIO -> if (audio == null) audio = id
|
||||
else -> if (fallback == null) fallback = id
|
||||
}
|
||||
}
|
||||
return audio ?: fallback
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
/**
|
||||
* RFC 6381 codecs strings for Dolby Vision tracks, mirroring media3's
|
||||
* `DolbyVisionConfig.parse` profile table so the FFmpeg demux path publishes
|
||||
* the same format media3's own MP4/Matroska extractors would: recognized
|
||||
* profiles get `video/dolby-vision` plus this string, unrecognized profiles
|
||||
* keep the base codec's format untouched.
|
||||
*/
|
||||
internal object DoviCodecs {
|
||||
|
||||
/**
|
||||
* Codecs string for a DOVIDecoderConfigurationRecord's [profile]/[level],
|
||||
* or null when media3 does not recognize the profile (the track then plays
|
||||
* as its base codec).
|
||||
*/
|
||||
fun rfc6381(profile: Int, level: Int): String? {
|
||||
val prefix = when (profile) {
|
||||
4, 5, 7, 8 -> "dvhe"
|
||||
9 -> "dvav"
|
||||
10 -> "dav1"
|
||||
else -> return null
|
||||
}
|
||||
return "%s.%02d.%02d".format(prefix, profile, level)
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,7 @@ import androidx.media3.extractor.DefaultExtractorsFactory
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
import androidx.media3.extractor.mp4.FragmentedMp4Extractor
|
||||
import androidx.media3.extractor.mp4.Mp4Extractor
|
||||
import androidx.media3.extractor.text.SubtitleTranscodingExtractorOutput
|
||||
import androidx.media3.extractor.ts.TsExtractor
|
||||
import androidx.media3.ui.AspectRatioFrameLayout
|
||||
import androidx.media3.ui.CaptionStyleCompat
|
||||
@@ -71,6 +72,7 @@ import androidx.media3.ui.SubtitleView
|
||||
import com.edde746.plezy.AndroidRuntimeDiagnostics
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.parser.AssSubtitleParserFactory
|
||||
import com.edde746.plezy.libass.media.text.AssSubtitleExtractorOutput
|
||||
import com.edde746.plezy.libass.media.widget.AssSubtitleSurfaceView
|
||||
import com.edde746.plezy.shared.AudioFocusManager
|
||||
import com.edde746.plezy.shared.DeviceQuirks
|
||||
@@ -229,6 +231,12 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
private var trackSelector: DefaultTrackSelector? = null
|
||||
private var tunnelingUserEnabled: Boolean = true
|
||||
private var tunnelingDisabledForAudioCodec: Boolean = false
|
||||
|
||||
// Tunnelled playback is driven by the audio codec's clock, so without a
|
||||
// hardware audio decoder media3 never tunnels regardless of the flag —
|
||||
// used to skip selector churn for no-op flips (see
|
||||
// updateCurrentTunnelingState). True until an evaluation says otherwise.
|
||||
private var selectedAudioHasHwDecoder: Boolean = true
|
||||
private var tunnelingDisabledForVideoCodec: Boolean = false
|
||||
private var tunnelingDisabledForDecodedPcm: Boolean = false
|
||||
private var tunnelingDisabledForAudioRecovery: Boolean = false
|
||||
@@ -555,6 +563,18 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
|
||||
@Volatile private var activeDoviMp4Wrapper: DoviExtractorWrapper? = null
|
||||
|
||||
// The FFmpeg extractor from the current session; getStats reads its
|
||||
// measured audio bitrate for the playing item.
|
||||
@Volatile private var activeFfmpegExtractor: FfmpegExtractor? = null
|
||||
|
||||
// Container-demuxer placement; read per media item when extractors are built.
|
||||
@Volatile private var demuxerPreference: FfmpegDemuxerPolicy.Preference = FfmpegDemuxerPolicy.Preference.FFMPEG
|
||||
|
||||
fun setDemuxerMode(mode: String) {
|
||||
demuxerPreference = FfmpegDemuxerPolicy.fromWire(mode)
|
||||
emitLog("info", "init", "demuxer mode: ${demuxerPreference.wireName}")
|
||||
}
|
||||
|
||||
private fun getConfiguredDvMode(): DvConversionMode {
|
||||
val override = debugDvModeOverride
|
||||
if (override != null) return override
|
||||
@@ -572,7 +592,10 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
// Read-ahead depth, as the wire name Dart sends. Kept a String because `LoadControlPolicy`
|
||||
// is internal and this function is not; unrecognised names resolve to Auto, which is also
|
||||
// the default (#1816).
|
||||
bufferTier: String = "auto"
|
||||
bufferTier: String = "auto",
|
||||
// Whether FFmpeg demuxes ahead of media3's extractors. Wire values from
|
||||
// [FfmpegDemuxerPolicy.Preference]; unrecognised resolves to FFmpeg.
|
||||
demuxerMode: String = "ffmpeg"
|
||||
): Boolean {
|
||||
if (isInitialized) {
|
||||
Log.d(TAG, "Already initialized")
|
||||
@@ -581,6 +604,7 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
|
||||
tunnelingUserEnabled = tunnelingEnabled
|
||||
this.audioPassthroughEnabled = audioPassthroughEnabled
|
||||
demuxerPreference = FfmpegDemuxerPolicy.fromWire(demuxerMode)
|
||||
this.dvMode = getConfiguredDvMode()
|
||||
DoviBridge.logSupportSummary(activity)
|
||||
Log.i(
|
||||
@@ -722,10 +746,20 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
}
|
||||
httpDataSourceFactory = httpFactory
|
||||
dataSourceFactory = DefaultDataSource.Factory(activity, httpFactory)
|
||||
// libavformat owns its own seeking, so the demuxer reads through a
|
||||
// random-access source (FfmpegRandomAccessSource). Recording the DataSpec
|
||||
// media3 opens lets it clone that spec — same URI, cache key, flags and
|
||||
// request headers — instead of re-deriving one.
|
||||
val recordingFactory = RecordingDataSourceFactory(dataSourceFactory!!)
|
||||
val extractorsFactory = DefaultExtractorsFactory()
|
||||
// High-bitrate Plex DVR MPEG-TS recordings can have sparse PCR packets; the default
|
||||
// 600-packet window may leave duration unknown and seeking disabled.
|
||||
.setTsExtractorTimestampSearchBytes(TS_TIMESTAMP_SEARCH_PACKETS * TsExtractor.TS_PACKET_SIZE)
|
||||
// Raw subtitle samples from MatroskaExtractor: the external text
|
||||
// pipeline below feeds libass dialogue first and then re-adds cue
|
||||
// transcoding — with the internal wrapper enabled the dialogue bytes
|
||||
// would already be consumed before our wrapper could see them.
|
||||
.setMatroskaExtractorFlags(MatroskaExtractor.FLAG_EMIT_RAW_SUBTITLE_DATA)
|
||||
|
||||
// Inline buildWithAssSupport to retain AssHandler reference for font scale control.
|
||||
val handler = AssHandler()
|
||||
@@ -735,42 +769,82 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
// composition object and blanks palette-only fade updates (#1953).
|
||||
val subtitleParserFactory = PgsSubtitleParserFactory(AssSubtitleParserFactory(handler))
|
||||
|
||||
// Wrap extractors: replace MatroskaExtractor with ASS+DV variant,
|
||||
// wrap MP4 extractors with DV converter when enabled.
|
||||
// Reads this.dvMode each time (not captured) so DV7→8.1 retry can
|
||||
// change mode and reload without reinitializing the player.
|
||||
val wrappedExtractorsFactory = androidx.media3.extractor.ExtractorsFactory {
|
||||
val currentDvMode = this.dvMode
|
||||
val doviEnabled = currentDvMode != DvConversionMode.DISABLED
|
||||
extractorsFactory.createExtractors().map { extractor ->
|
||||
when {
|
||||
extractor is MatroskaExtractor -> {
|
||||
val assExtractor = ZlibMatroskaExtractor(subtitleParserFactory, handler)
|
||||
val inner = if (doviEnabled) {
|
||||
DoviExtractorWrapper(assExtractor, currentDvMode) { level, prefix, message ->
|
||||
emitLog(level, prefix, message)
|
||||
}.also {
|
||||
activeDoviMkvWrapper = it
|
||||
// Wrap extractors: FFmpeg demuxes the containers media3 is weak at
|
||||
// (primary, before the list) and anything media3 cannot sniff (catch-all,
|
||||
// behind it); give MatroskaExtractor the same libass/transcoding text
|
||||
// pipeline so the media3 fallback (ffmpeg unavailable, media3-only
|
||||
// preference) keeps ASS rendering; wrap MKV/MP4 extractors with the DV
|
||||
// converter when enabled.
|
||||
// Reads this.dvMode and this.demuxerPreference each time (not captured) so
|
||||
// DV7→8.1 retry and demuxer-mode changes can reload without
|
||||
// reinitializing the player.
|
||||
val wrappedExtractorsFactory = object : androidx.media3.extractor.ExtractorsFactory {
|
||||
// media3's progressive path always supplies the item URI. Without one
|
||||
// the demuxer cannot be handed random access, so FFmpeg stays out
|
||||
// rather than failing later on its first index jump.
|
||||
override fun createExtractors(): Array<androidx.media3.extractor.Extractor> {
|
||||
Log.w(TAG, "[init] extractors: no item uri, ffmpeg demuxer unavailable")
|
||||
return buildExtractors(null)
|
||||
}
|
||||
|
||||
override fun createExtractors(
|
||||
uri: Uri,
|
||||
responseHeaders: Map<String, List<String>>
|
||||
): Array<androidx.media3.extractor.Extractor> = buildExtractors(uri)
|
||||
|
||||
private fun buildExtractors(uri: Uri?): Array<androidx.media3.extractor.Extractor> {
|
||||
val currentDvMode = this@ExoPlayerCore.dvMode
|
||||
val doviEnabled = currentDvMode != DvConversionMode.DISABLED
|
||||
val currentDemuxerPreference = this@ExoPlayerCore.demuxerPreference
|
||||
Log.i(TAG, "[init] extractors: demuxer=${currentDemuxerPreference.wireName}")
|
||||
// media3 invokes the factory once per item and reuses the extractor
|
||||
// instances, so the sniff reads the live preference instead of a
|
||||
// captured one.
|
||||
val liveDemuxerPreference = { this@ExoPlayerCore.demuxerPreference }
|
||||
val ffmpegFirst = listOfNotNull(
|
||||
uri?.let { itemUri ->
|
||||
val io = FfmpegRandomAccessSource(dataSourceFactory!!) { recordingFactory.specFor(itemUri) }
|
||||
FfmpegExtractor.create(
|
||||
liveDemuxerPreference,
|
||||
currentDvMode,
|
||||
subtitleParserFactory,
|
||||
handler,
|
||||
io
|
||||
)?.also { activeFfmpegExtractor = it }
|
||||
}
|
||||
)
|
||||
return (
|
||||
ffmpegFirst + extractorsFactory.createExtractors().map { extractor ->
|
||||
when {
|
||||
extractor is MatroskaExtractor -> {
|
||||
val withTextPipeline = OutputWrappingExtractor(extractor) { out ->
|
||||
AssSubtitleExtractorOutput(SubtitleTranscodingExtractorOutput(out, subtitleParserFactory), handler)
|
||||
}
|
||||
if (doviEnabled) {
|
||||
DoviExtractorWrapper(withTextPipeline, currentDvMode) { level, prefix, message ->
|
||||
emitLog(level, prefix, message)
|
||||
}.also {
|
||||
activeDoviMkvWrapper = it
|
||||
}
|
||||
} else {
|
||||
withTextPipeline
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assExtractor
|
||||
}
|
||||
// Wrap with approximate seeking for MKV files without Cues
|
||||
CuelessSeekExtractorWrapper(inner)
|
||||
}
|
||||
doviEnabled && (extractor is Mp4Extractor || extractor is FragmentedMp4Extractor) -> {
|
||||
DoviExtractorWrapper(extractor, currentDvMode) { level, prefix, message ->
|
||||
emitLog(level, prefix, message)
|
||||
}.also {
|
||||
activeDoviMp4Wrapper = it
|
||||
doviEnabled && (extractor is Mp4Extractor || extractor is FragmentedMp4Extractor) -> {
|
||||
DoviExtractorWrapper(extractor, currentDvMode) { level, prefix, message ->
|
||||
emitLog(level, prefix, message)
|
||||
}.also {
|
||||
activeDoviMp4Wrapper = it
|
||||
}
|
||||
}
|
||||
else -> extractor
|
||||
}
|
||||
}
|
||||
else -> extractor
|
||||
}
|
||||
}.toTypedArray()
|
||||
).toTypedArray()
|
||||
}
|
||||
}
|
||||
|
||||
val mediaSourceFactory = DefaultMediaSourceFactory(dataSourceFactory!!, wrappedExtractorsFactory)
|
||||
val mediaSourceFactory = DefaultMediaSourceFactory(recordingFactory, wrappedExtractorsFactory)
|
||||
.setSubtitleParserFactory(subtitleParserFactory)
|
||||
playbackMediaSourceFactory = mediaSourceFactory
|
||||
|
||||
@@ -2699,6 +2773,18 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
|
||||
private fun updateCurrentTunnelingState(reason: String, shouldTunnel: Boolean): Boolean {
|
||||
if (shouldTunnel == currentTunneledPlayback) return false
|
||||
// A switch to "off" that the selected audio decoder could never have
|
||||
// honored anyway is transparent to media3: tunnelled playback needs a
|
||||
// tunneling-capable audio codec (it owns the AV-sync clock), so a
|
||||
// software decoder already ignored the flag. Writing the selector
|
||||
// parameter regardless forces a renderer rebuild that can tear down a
|
||||
// live codec mid-queueInputBuffer — observed as
|
||||
// "queueInputBuffer ... Released state" right after tracks arrive from
|
||||
// the ffmpeg demuxer. Record the state without the churn.
|
||||
if (!shouldTunnel && !selectedAudioHasHwDecoder) {
|
||||
currentTunneledPlayback = false
|
||||
return false
|
||||
}
|
||||
currentTunneledPlayback = shouldTunnel
|
||||
val speed = exoPlayer?.playbackParameters?.speed ?: 1f
|
||||
val audioDelayActive = (renderersFactory?.audioDelayUs?.get() ?: 0L) != 0L
|
||||
@@ -2726,6 +2812,7 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
}
|
||||
|
||||
val newDisabled = !hasHardwareAudioDecoder(mimeType)
|
||||
selectedAudioHasHwDecoder = !newDisabled
|
||||
if (newDisabled != tunnelingDisabledForAudioCodec) {
|
||||
tunnelingDisabledForAudioCodec = newDisabled
|
||||
emitLog("info", "tunneling", "Audio codec ${format.codecs} ($mimeType): tunneling ${if (newDisabled) "DISABLED (no hw decoder)" else "enabled"}")
|
||||
@@ -3712,6 +3799,7 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
dv7RetryAttempted = override != null
|
||||
activeDoviMkvWrapper = null
|
||||
activeDoviMp4Wrapper = null
|
||||
activeFfmpegExtractor = null
|
||||
val debugMode = override?.name ?: "AUTO"
|
||||
emitLog("info", "dv-debug", "P7 DV conversion mode set to $debugMode (active=$dvMode)")
|
||||
reloadCurrentMediaForDvMode()
|
||||
@@ -3748,6 +3836,7 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
lastDvPlaybackInfo = null
|
||||
activeDoviMkvWrapper = null
|
||||
activeDoviMp4Wrapper = null
|
||||
activeFfmpegExtractor = null
|
||||
stopFrameWatchdog()
|
||||
cancelDecoderHangCheck()
|
||||
cancelResumeStallWatchdog()
|
||||
@@ -4111,6 +4200,7 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
extraDelayMs: Long,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int,
|
||||
matchResolution: Boolean,
|
||||
onComplete: (switched: Boolean) -> Unit
|
||||
) {
|
||||
val mgr = frameRateManager
|
||||
@@ -4118,7 +4208,7 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
mgr.setVideoFrameRate(fps, videoDurationMs, extraDelayMs, videoWidth, videoHeight, onComplete)
|
||||
mgr.setVideoFrameRate(fps, videoDurationMs, extraDelayMs, videoWidth, videoHeight, matchResolution, onComplete)
|
||||
}
|
||||
|
||||
override fun clearVideoFrameRate() {
|
||||
@@ -4213,7 +4303,12 @@ class ExoPlayerCore(private val activity: Activity) :
|
||||
"audioMimeType" to audioFormat?.sampleMimeType,
|
||||
"audioSampleRate" to audioFormat?.sampleRate,
|
||||
"audioChannels" to audioFormat?.channelCount,
|
||||
"audioBitrate" to audioFormat?.bitrate,
|
||||
// Container-declared bitrate when present; otherwise the FFmpeg
|
||||
// demuxer's measured value (Matroska rarely carries BPS tags — #2063).
|
||||
"audioBitrate" to (
|
||||
audioFormat?.bitrate?.takeIf { it > 0 }
|
||||
?: audioFormat?.id?.let { activeFfmpegExtractor?.measuredAudioBitrateBps(it) }
|
||||
),
|
||||
"audioDecoderName" to audioDecoderInitName,
|
||||
"audioOutputEncoding" to audioTrackConfig?.encoding,
|
||||
"audioOutputChannels" to audioTrackConfig?.channelConfig?.let { Integer.bitCount(it) },
|
||||
|
||||
@@ -258,6 +258,7 @@ class ExoPlayerPlugin :
|
||||
"setBoxFitMode" -> handleSetBoxFitMode(call, result)
|
||||
"setVideoZoom" -> handleSetVideoZoom(call, result)
|
||||
"setDvConversionMode" -> handleSetDvConversionMode(call, result)
|
||||
"setDemuxerMode" -> handleSetDemuxerMode(call, result)
|
||||
"setAudioNormalization" -> handleSetAudioNormalization(call, result)
|
||||
"setAudioPassthrough" -> handleSetAudioPassthrough(call, result)
|
||||
"setAudioDownmix" -> handleSetAudioDownmix(call, result)
|
||||
@@ -296,7 +297,7 @@ class ExoPlayerPlugin :
|
||||
// on Auto because Dart derives one for mpv's demuxer, which shares the property, and
|
||||
// the fallback replay below needs it.
|
||||
val bufferSizeAuto = call.argument<Boolean>("bufferSizeAuto") ?: false
|
||||
val tunnelingEnabled = call.argument<Boolean>("tunnelingEnabled") ?: true
|
||||
val tunnelingEnabled = call.argument<Boolean>("tunnelingEnabled") ?: false
|
||||
val dvConversionMode = call.argument<String>("dvConversionMode") ?: "auto"
|
||||
val audioPassthroughEnabled = call.argument<Boolean>("audioPassthroughEnabled") ?: false
|
||||
val assVideoLatencyFrames = call.argument<Int>("assVideoLatencyFrames") ?: 0
|
||||
@@ -304,6 +305,7 @@ class ExoPlayerPlugin :
|
||||
// ExoPlayer-only: mpv's read-ahead is owned by the mpv.conf editor, so there is no
|
||||
// fallback replay for this one. Resolved in the core; unrecognised means Auto (#1816).
|
||||
val bufferTier = call.argument<String>("bufferTier") ?: "auto"
|
||||
val demuxerMode = call.argument<String>("demuxerMode") ?: "ffmpeg"
|
||||
configuredBufferSizeBytes = bufferSizeBytes
|
||||
// Seed the request here rather than waiting for Dart's separate setAudioPassthrough
|
||||
// call, so a fallback raised before that arrives still derives audio-spdif correctly.
|
||||
@@ -348,7 +350,8 @@ class ExoPlayerPlugin :
|
||||
bufferSizeAuto = bufferSizeAuto,
|
||||
tunnelingEnabled = tunnelingEnabled,
|
||||
audioPassthroughEnabled = audioPassthroughEnabled,
|
||||
bufferTier = bufferTier
|
||||
bufferTier = bufferTier,
|
||||
demuxerMode = demuxerMode
|
||||
)
|
||||
if (!success) {
|
||||
if (playerCore === core) playerCore = null
|
||||
@@ -1015,14 +1018,19 @@ class ExoPlayerPlugin :
|
||||
val extraDelayMs = call.argument<Number>("extraDelayMs")?.toLong() ?: 0L
|
||||
val videoWidth = call.argument<Number>("videoWidth")?.toInt() ?: 0
|
||||
val videoHeight = call.argument<Number>("videoHeight")?.toInt() ?: 0
|
||||
val matchResolution = call.argument<Boolean>("matchResolution") ?: false
|
||||
|
||||
Log.d(TAG, "setVideoFrameRate: fps=$fps, duration=$duration, extraDelayMs=$extraDelayMs, video=${videoWidth}x$videoHeight")
|
||||
Log.d(
|
||||
TAG,
|
||||
"setVideoFrameRate: fps=$fps, duration=$duration, extraDelayMs=$extraDelayMs, " +
|
||||
"video=${videoWidth}x$videoHeight, matchResolution=$matchResolution"
|
||||
)
|
||||
val core = activeSurfaceCore
|
||||
if (core == null) {
|
||||
result.success(false)
|
||||
return
|
||||
}
|
||||
core.setVideoFrameRate(fps, duration, extraDelayMs, videoWidth, videoHeight) { switched ->
|
||||
core.setVideoFrameRate(fps, duration, extraDelayMs, videoWidth, videoHeight, matchResolution) { switched ->
|
||||
result.success(switched)
|
||||
}
|
||||
}
|
||||
@@ -1136,6 +1144,18 @@ class ExoPlayerPlugin :
|
||||
} ?: result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
}
|
||||
|
||||
private fun handleSetDemuxerMode(call: MethodCall, result: MethodChannel.Result) {
|
||||
val mode = call.argument<String>("mode")
|
||||
if (mode == null) {
|
||||
result.error("INVALID_ARGS", "Missing 'mode'", null)
|
||||
return
|
||||
}
|
||||
activity?.runOnUiThread {
|
||||
playerCore?.setDemuxerMode(mode)
|
||||
result.success(null)
|
||||
} ?: result.error("NO_ACTIVITY", "Activity not available", null)
|
||||
}
|
||||
|
||||
private fun handleSetAudioNormalization(call: MethodCall, result: MethodChannel.Result) {
|
||||
val enabled = call.argument<Boolean>("enabled")
|
||||
if (enabled == null) {
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.ParserException
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.container.OpusUtil
|
||||
|
||||
/**
|
||||
* Shapes ffmpeg codec extradata into the per-codec initializationData layout
|
||||
* media3's audio decode paths consume. MediaCodecAudioRenderer maps the list
|
||||
* entries verbatim to MediaCodec csd-0/1/2 and the bundled FfmpegAudioDecoder
|
||||
* rebuilds avcodec extradata from the same entries, so both expect the shapes
|
||||
* media3's own extractors emit — not raw ffmpeg extradata:
|
||||
*
|
||||
* - Opus: [OpusHead, codec delay ns, seek pre-roll ns]. Android's Opus
|
||||
* decoders consume their first three input buffers as exactly this
|
||||
* configuration; given only OpusHead they read the first two real packets
|
||||
* as delay/pre-roll and then silently discard every decoded sample, which
|
||||
* stalled the audio clock at 0 until the MPV fallback fired (#2088).
|
||||
* - Vorbis: [identification header, setup header], split out of the
|
||||
* Xiph-laced blob the way MatroskaExtractor's parseVorbisCodecPrivate does.
|
||||
* - FLAC: the "fLaC"-marked STREAMINFO stream MediaCodec documents; ffmpeg
|
||||
* surfaces a bare or block-headed STREAMINFO depending on the container.
|
||||
*
|
||||
* Everything else (AAC ASC, ALAC cookie, passthrough codecs) already matches
|
||||
* media3's single-entry shape and passes through. MP3's WAVEFORMATEX blob is
|
||||
* dropped on the JNI side before it reaches this shaping.
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
internal object FfmpegAudioCsd {
|
||||
|
||||
// RFC 7845 section 5.1: the identification header is at least 19 bytes;
|
||||
// OpusUtil reads the pre-skip field at offsets 10-11.
|
||||
private const val OPUS_HEADER_MIN_BYTES = 19
|
||||
|
||||
private val FLAC_STREAM_MARKER = byteArrayOf(0x66, 0x4C, 0x61, 0x43) // "fLaC"
|
||||
private const val FLAC_STREAM_INFO_SIZE = 34
|
||||
private const val FLAC_BLOCK_HEADER_SIZE = 4
|
||||
private const val FLAC_LAST_BLOCK_FLAG = 0x80
|
||||
|
||||
fun initializationData(mime: String, extradata: ByteArray): List<ByteArray> = when (mime) {
|
||||
MimeTypes.AUDIO_OPUS -> opus(extradata)
|
||||
MimeTypes.AUDIO_VORBIS -> vorbis(extradata)
|
||||
MimeTypes.AUDIO_FLAC -> flac(extradata)
|
||||
else -> listOf(extradata)
|
||||
}
|
||||
|
||||
private fun opus(extradata: ByteArray): List<ByteArray> {
|
||||
if (extradata.size < OPUS_HEADER_MIN_BYTES) {
|
||||
throw malformed("Opus extradata is not an identification header: ${extradata.size} bytes")
|
||||
}
|
||||
// [OpusHead, pre-skip ns, 80 ms default seek pre-roll ns] — the same
|
||||
// shape media3's Matroska/Ogg/MP4 extractors publish.
|
||||
return OpusUtil.buildInitializationData(extradata)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the Xiph-laced header blob (identification, comment, setup) into
|
||||
* media3's [identification header, setup header] pair, mirroring media3
|
||||
* 1.11.0 MatroskaExtractor.parseVorbisCodecPrivate.
|
||||
*/
|
||||
private fun vorbis(extradata: ByteArray): List<ByteArray> {
|
||||
try {
|
||||
if (extradata[0].toInt() != 0x02) throw malformed("Vorbis extradata is not Xiph-laced headers")
|
||||
var offset = 1
|
||||
var idHeaderLength = 0
|
||||
while (extradata[offset].toInt() and 0xFF == 0xFF) {
|
||||
idHeaderLength += 0xFF
|
||||
offset++
|
||||
}
|
||||
idHeaderLength += extradata[offset++].toInt() and 0xFF
|
||||
var commentHeaderLength = 0
|
||||
while (extradata[offset].toInt() and 0xFF == 0xFF) {
|
||||
commentHeaderLength += 0xFF
|
||||
offset++
|
||||
}
|
||||
commentHeaderLength += extradata[offset++].toInt() and 0xFF
|
||||
|
||||
if (extradata[offset].toInt() != 0x01) throw malformed("Vorbis identification header not found")
|
||||
val idHeader = extradata.copyOfRange(offset, offset + idHeaderLength)
|
||||
offset += idHeaderLength
|
||||
if (extradata[offset].toInt() != 0x03) throw malformed("Vorbis comment header not found")
|
||||
offset += commentHeaderLength
|
||||
if (extradata[offset].toInt() != 0x05) throw malformed("Vorbis setup header not found")
|
||||
return listOf(idHeader, extradata.copyOfRange(offset, extradata.size))
|
||||
} catch (e: IndexOutOfBoundsException) {
|
||||
throw malformed("Vorbis extradata truncated")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes to the "fLaC"-marked metadata stream. MediaCodec's decoder
|
||||
* feeds csd-0 straight into libFLAC, which requires the stream marker;
|
||||
* ffmpeg's canonical FLAC extradata is the bare 34-byte STREAMINFO, and
|
||||
* some demuxers keep the 4-byte metadata block header in front of it.
|
||||
*/
|
||||
private fun flac(extradata: ByteArray): List<ByteArray> {
|
||||
if (startsWithFlacMarker(extradata)) return listOf(extradata)
|
||||
if (extradata.size == FLAC_STREAM_INFO_SIZE) {
|
||||
val blockHeader = byteArrayOf(
|
||||
(FLAC_LAST_BLOCK_FLAG or 0).toByte(), // last-metadata-block, type 0 = STREAMINFO
|
||||
0x00,
|
||||
0x00,
|
||||
FLAC_STREAM_INFO_SIZE.toByte()
|
||||
)
|
||||
return listOf(FLAC_STREAM_MARKER + blockHeader + extradata)
|
||||
}
|
||||
val declaredLength = if (extradata.size >= FLAC_BLOCK_HEADER_SIZE) {
|
||||
((extradata[1].toInt() and 0xFF) shl 16) or
|
||||
((extradata[2].toInt() and 0xFF) shl 8) or
|
||||
(extradata[3].toInt() and 0xFF)
|
||||
} else {
|
||||
-1
|
||||
}
|
||||
if (extradata[0].toInt() and 0x7F == 0 &&
|
||||
declaredLength == FLAC_STREAM_INFO_SIZE &&
|
||||
extradata.size >= FLAC_BLOCK_HEADER_SIZE + FLAC_STREAM_INFO_SIZE
|
||||
) {
|
||||
return listOf(FLAC_STREAM_MARKER + extradata)
|
||||
}
|
||||
throw malformed("FLAC extradata is not a STREAMINFO block: ${extradata.size} bytes")
|
||||
}
|
||||
|
||||
private fun startsWithFlacMarker(extradata: ByteArray): Boolean {
|
||||
if (extradata.size < FLAC_STREAM_MARKER.size) return false
|
||||
for (i in FLAC_STREAM_MARKER.indices) {
|
||||
if (extradata[i] != FLAC_STREAM_MARKER[i]) return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun malformed(message: String): ParserException = ParserException.createForMalformedContainer(message, null)
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
|
||||
/**
|
||||
* JNI surface for the libavformat demuxer shim (`cpp/media3_ffmpeg_demuxer`).
|
||||
*
|
||||
* One demuxer exists per process, owned by whichever [FfmpegExtractor] is
|
||||
* currently open — Plezy plays at most one progressive source at a time, and
|
||||
* every other playback mode (HLS/DASH, music) stays on media3's own sources.
|
||||
*
|
||||
* The long[] layouts mirror the constants documented in
|
||||
* `ffmpeg_demuxer_jni.cc`; keep both sides in sync.
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
internal object FfmpegDemuxerJni {
|
||||
/** Byte source the AVIO callbacks read through while a native call is in flight. */
|
||||
interface Input {
|
||||
/** Current byte position of the loader's [androidx.media3.extractor.ExtractorInput]. */
|
||||
fun position(): Long
|
||||
|
||||
/**
|
||||
* Reads up to [length] bytes from the loader's input at its current
|
||||
* position. Returns the number of bytes read, `0` at end of input, or `-1`
|
||||
* after storing the failure in [lastError].
|
||||
*/
|
||||
fun read(buf: ByteArray, length: Int): Int
|
||||
|
||||
/**
|
||||
* Reads up to [length] bytes at absolute [position], wherever the loader
|
||||
* stands. Same return contract as [read]. This is what lets libavformat
|
||||
* seek its own index without the shim unwinding the in-flight call.
|
||||
*/
|
||||
fun readAt(position: Long, buf: ByteArray, length: Int): Int
|
||||
|
||||
/** Total input length in bytes, or `-1` when unknown. */
|
||||
fun length(): Long
|
||||
|
||||
var lastError: String?
|
||||
}
|
||||
|
||||
// readPacket out[] indices.
|
||||
const val OUT_CODE = 0
|
||||
const val OUT_STREAM_INDEX = 1
|
||||
const val OUT_PTS_US = 2
|
||||
const val OUT_FLAGS = 3
|
||||
const val OUT_SIZE = 4
|
||||
const val OUT_POSITION = 5
|
||||
const val OUT_DURATION_US = 6
|
||||
const val OUT_LENGTH = 7
|
||||
|
||||
// Result codes written to out[OUT_CODE]; negative values are raw AVERRORs.
|
||||
const val CODE_PACKET = 0
|
||||
const val CODE_EOF = 1
|
||||
const val CODE_GROW = 2
|
||||
const val ERR_JAVA = -102
|
||||
|
||||
// streamInfo long[] layout.
|
||||
const val INFO_TRACK_TYPE = 0
|
||||
const val INFO_WIDTH = 1
|
||||
const val INFO_HEIGHT = 2
|
||||
const val INFO_PAR_NUM = 3
|
||||
const val INFO_PAR_DEN = 4
|
||||
const val INFO_FPS_NUM = 5
|
||||
const val INFO_FPS_DEN = 6
|
||||
const val INFO_SAMPLE_RATE = 7
|
||||
const val INFO_CHANNELS = 8
|
||||
const val INFO_PCM_ENCODING = 9
|
||||
const val INFO_ROTATION = 10
|
||||
const val INFO_SELECTION_FLAGS = 11
|
||||
const val INFO_ROLE_FLAGS = 12
|
||||
const val INFO_BITRATE = 13
|
||||
const val INFO_DOVI_PROFILE = 14
|
||||
const val INFO_DOVI_LEVEL = 15
|
||||
const val INFO_LATM = 16
|
||||
const val INFO_LENGTH = 17
|
||||
|
||||
val available: Boolean = try {
|
||||
System.loadLibrary("ffmpegJNI")
|
||||
true
|
||||
} catch (_: UnsatisfiedLinkError) {
|
||||
false
|
||||
}
|
||||
|
||||
/** Probes container bytes; returns the ffmpeg short name ("avi", "asf", …) or null. */
|
||||
external fun nativeProbeFormat(header: ByteArray): String?
|
||||
|
||||
/**
|
||||
* Opens the demuxer against [input]. Returns 0 on success or a negative
|
||||
* AVERROR ([ERR_JAVA] when the input itself failed). The stream count is read
|
||||
* separately via [nativeStreamCount]; it must not ride the same namespace as
|
||||
* result codes.
|
||||
*/
|
||||
external fun nativeOpen(input: Input): Int
|
||||
|
||||
external fun nativeClose()
|
||||
|
||||
external fun nativeStreamCount(): Int
|
||||
|
||||
/** Total duration in microseconds, or -1 when unknown. */
|
||||
external fun nativeDurationUs(): Long
|
||||
|
||||
/** Fills [numbers]/[strings] for [index]; false when the stream is unusable. */
|
||||
external fun nativeStreamInfo(index: Int, numbers: LongArray, strings: Array<String?>): Boolean
|
||||
|
||||
/** Codec initialization data (extradata), or null. */
|
||||
external fun nativeStreamExtradata(index: Int): ByteArray?
|
||||
|
||||
/** Number of attachment streams (embedded fonts and friends) with payloads. */
|
||||
external fun nativeAttachmentCount(): Int
|
||||
|
||||
/**
|
||||
* Fills [strings] with [filename, mimetype] for attachment [ordinal] and
|
||||
* returns the payload size in bytes, or -1 when out of range. Lets Kotlin
|
||||
* enforce font budgets before copying any bytes across the boundary.
|
||||
*/
|
||||
external fun nativeAttachmentInfo(ordinal: Int, strings: Array<String?>): Long
|
||||
|
||||
/** Attachment payload bytes, or null. */
|
||||
external fun nativeAttachmentData(ordinal: Int): ByteArray?
|
||||
|
||||
/**
|
||||
* Reads one packet into [buffer], filling [out]. See the shim header
|
||||
* comment for the result contract.
|
||||
*/
|
||||
external fun nativeReadPacket(buffer: ByteArray, out: LongArray): Int
|
||||
|
||||
/** Byte position libavformat will read next, or -1 when not open. */
|
||||
external fun nativeLogicalPosition(): Long
|
||||
|
||||
/**
|
||||
* Seeks to [timeUs] (media3 timeline microseconds, i.e. start-time
|
||||
* normalized). The demuxer resolves the byte position itself through its own
|
||||
* index. Returns 0 on success, or a negative AVERROR when the container has
|
||||
* no usable index and libavformat refused the seek.
|
||||
*/
|
||||
external fun nativeSeek(timeUs: Long): Int
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
/**
|
||||
* Decides whether the FFmpeg demuxer sits ahead of media3's own extractors.
|
||||
*
|
||||
* FFmpeg demuxes every progressive container by default. media3's bundled
|
||||
* extractors were weak exactly where this app kept accumulating container
|
||||
* patches — AVI (XviD packed-bitstream timestamps, missing VOL csd — issue
|
||||
* #2052), ASF/WMV (no extractor at all), MPEG-PS/VOB (no extractor), and
|
||||
* Matroska (zlib-compressed subtitles, LOAS/LATM audio as A_MS/ACM, cueless
|
||||
* seeking, font attachments) — and libavformat handles all of it natively.
|
||||
* media3's extractors stay behind FFmpeg in the list, so a container FFmpeg
|
||||
* fails to sniff still reaches media3's parsers. [Preference.MEDIA3_ONLY] is
|
||||
* the user-facing escape hatch in case a file misbehaves on the FFmpeg path.
|
||||
*/
|
||||
internal object FfmpegDemuxerPolicy {
|
||||
enum class Preference(val wireName: String) {
|
||||
FFMPEG("ffmpeg"),
|
||||
MEDIA3_ONLY("media3")
|
||||
}
|
||||
|
||||
/** Unknown wire values (including the retired "auto") resolve to FFmpeg. */
|
||||
fun fromWire(value: String?): Preference = Preference.entries.firstOrNull { it.wireName == value } ?: Preference.FFMPEG
|
||||
|
||||
/** Whether the FFmpeg extractor placed before media3's list demuxes at all. */
|
||||
fun enabled(preference: Preference): Boolean = preference == Preference.FFMPEG
|
||||
}
|
||||
@@ -0,0 +1,574 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.ParserException
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.SeekPoint
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.text.SubtitleParser
|
||||
import androidx.media3.extractor.text.SubtitleTranscodingExtractorOutput
|
||||
import com.edde746.plezy.libass.media.AssFonts
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.text.AssSubtitleExtractorOutput
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
* Demuxes progressive containers with libavformat and feeds the packets to
|
||||
* media3's renderers, so FFmpeg's container coverage replaces media3's on the
|
||||
* paths where it is weak (AVI/XviD timestamps and VOL csd — #2052 — ASF/WMV,
|
||||
* MPEG-PS) and where the app accumulated Matroska patches (zlib-compressed
|
||||
* subtitles, LOAS/LATM audio, cueless seeking) without giving up any of the
|
||||
* renderer-side work (passthrough carriers, DV sanitizing, libass rendering
|
||||
* with embedded fonts, subtitle latency calibration).
|
||||
*
|
||||
* Text tracks are emitted in the exact sample shape media3's
|
||||
* MatroskaExtractor writes (see [FfmpegSubtitleSamples]); the output chain
|
||||
* composed in [init] then feeds libass dialogue and transcodes cues the same
|
||||
* way the media3 Matroska path does.
|
||||
*
|
||||
* Seeking: libavformat resolves seeks itself, reading its own index through
|
||||
* [FfmpegRandomAccessSource]. media3's byte hints are ignored, nothing is ever
|
||||
* unwound, and the loader is merely nudged to follow along so that sample
|
||||
* delivery keeps streaming on its connection (see [alignLoader]).
|
||||
*
|
||||
* The instance sits before media3's extractors and sniffs everything FFmpeg
|
||||
* can probe while [FfmpegDemuxerPolicy] enables it; media3's list behind it
|
||||
* is the fallback for anything FFmpeg cannot open.
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
internal class FfmpegExtractor private constructor(
|
||||
private val preferenceSupplier: () -> FfmpegDemuxerPolicy.Preference,
|
||||
private val dvMode: DvConversionMode,
|
||||
private val subtitleParserFactory: SubtitleParser.Factory,
|
||||
private val assHandler: AssHandler,
|
||||
private val io: FfmpegRandomAccessSource
|
||||
) : Extractor {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "FfmpegExtractor"
|
||||
private const val SNIFF_BYTES = 64 * 1024
|
||||
private const val INITIAL_PACKET_BUFFER_BYTES = 2 * 1024 * 1024
|
||||
|
||||
/** Null when the native library is unavailable. */
|
||||
fun create(
|
||||
preferenceSupplier: () -> FfmpegDemuxerPolicy.Preference,
|
||||
dvMode: DvConversionMode,
|
||||
subtitleParserFactory: SubtitleParser.Factory,
|
||||
assHandler: AssHandler,
|
||||
io: FfmpegRandomAccessSource
|
||||
): FfmpegExtractor? = if (FfmpegDemuxerJni.available) {
|
||||
FfmpegExtractor(preferenceSupplier, dvMode, subtitleParserFactory, assHandler, io)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private lateinit var output: ExtractorOutput
|
||||
private var currentInput: ExtractorInput? = null
|
||||
private val inputProxy = object : FfmpegDemuxerJni.Input {
|
||||
override fun position(): Long = currentInput?.position ?: 0L
|
||||
|
||||
override fun read(buf: ByteArray, length: Int): Int {
|
||||
val input = currentInput ?: return 0
|
||||
lastError = null
|
||||
return try {
|
||||
val read = input.read(buf, 0, length)
|
||||
if (read == C.RESULT_END_OF_INPUT) 0 else read
|
||||
} catch (e: IOException) {
|
||||
lastError = e.message ?: "demuxer input failed"
|
||||
-1
|
||||
}
|
||||
}
|
||||
|
||||
override fun readAt(position: Long, buf: ByteArray, length: Int): Int {
|
||||
lastError = null
|
||||
return try {
|
||||
io.readAt(position, buf, length)
|
||||
} catch (e: IOException) {
|
||||
lastError = e.message ?: "demuxer random access read failed"
|
||||
-1
|
||||
}
|
||||
}
|
||||
|
||||
override fun length(): Long {
|
||||
val fromLoader = currentInput?.length ?: C.LENGTH_UNSET.toLong()
|
||||
if (fromLoader != C.LENGTH_UNSET.toLong()) return fromLoader
|
||||
// Length-less loader open (progressive live stream): fall back to
|
||||
// whatever a random-access open already resolved.
|
||||
val resolved = io.length()
|
||||
return if (resolved == C.LENGTH_UNSET.toLong()) -1L else resolved
|
||||
}
|
||||
|
||||
override var lastError: String? = null
|
||||
}
|
||||
|
||||
private var opened = false
|
||||
private var doviOutputWrapper: DoviExtractorOutputWrapper? = null
|
||||
private var durationUs = C.TIME_UNSET
|
||||
private var trackOutputs: Array<TrackOutput?> = emptyArray()
|
||||
private var packetBytes = ByteArray(INITIAL_PACKET_BUFFER_BYTES)
|
||||
private val packetParsable = ParsableByteArray()
|
||||
private val packetOut = LongArray(FfmpegDemuxerJni.OUT_LENGTH)
|
||||
private val prefixParsable = ParsableByteArray()
|
||||
|
||||
// Per-stream text handling picked in prepareTracks; parallel to trackOutputs.
|
||||
private var subtitleKinds: Array<SubtitleKind> = emptyArray()
|
||||
private val latmOutputs = ArrayList<LatmTrackOutput>()
|
||||
|
||||
// Per-audio-stream measured bitrate, parallel to trackOutputs. Written by
|
||||
// the loader thread, read by ExoPlayerCore.getStats on another thread.
|
||||
@Volatile private var bitrateMeters: Array<StreamBitrateMeter?> = emptyArray()
|
||||
|
||||
// Set by seek(), applied by the next read(): media3 calls both on the loader
|
||||
// thread, but only read() is allowed to throw IOException and the demuxer's
|
||||
// seek reads its index.
|
||||
private var pendingSeekUs = C.TIME_UNSET
|
||||
private var deliveredAnyPacket = false
|
||||
|
||||
private val sniffScratch = ByteArray(SNIFF_BYTES)
|
||||
|
||||
override fun sniff(input: ExtractorInput): Boolean {
|
||||
// media3 materializes the extractor array once per player session, so the
|
||||
// policy must be read live at sniff time — a preference captured at
|
||||
// construction would freeze for the session.
|
||||
if (!FfmpegDemuxerPolicy.enabled(preferenceSupplier())) return false
|
||||
val probed = probe(input) ?: return false
|
||||
Log.i(TAG, "sniff accepted $probed")
|
||||
return true
|
||||
}
|
||||
|
||||
private fun probe(input: ExtractorInput): String? {
|
||||
// create() only builds instances when the native library loaded.
|
||||
input.resetPeekPosition()
|
||||
return try {
|
||||
val filled =
|
||||
input.peekFully(
|
||||
sniffScratch,
|
||||
/* offset= */
|
||||
0,
|
||||
sniffScratch.size,
|
||||
/* allowEndOfInput= */
|
||||
true
|
||||
)
|
||||
if (!filled) return null
|
||||
FfmpegDemuxerJni.nativeProbeFormat(sniffScratch)?.lowercase()
|
||||
} catch (_: Throwable) {
|
||||
// A sniffer must never take playback down: media3 escalates anything
|
||||
// that is not an IOException into a fatal loader error.
|
||||
null
|
||||
} finally {
|
||||
input.resetPeekPosition()
|
||||
}
|
||||
}
|
||||
|
||||
override fun init(output: ExtractorOutput) {
|
||||
// media3 reuses extractor instances across sources; drop the previous
|
||||
// item's demuxer and byte source so this open starts clean.
|
||||
releaseDemuxer()
|
||||
// Same composition as the MP4/MKV paths: DoviConvertingTrackOutput
|
||||
// inspects each video track's codecs string and passes non-DV through.
|
||||
val doviWrapped = if (dvMode != DvConversionMode.DISABLED) {
|
||||
// The wrapper forwards emitLog into each converting track output; the
|
||||
// playback-info hook stays wired to the MKV/MP4 wrappers, so nothing to
|
||||
// capture here.
|
||||
DoviExtractorOutputWrapper(
|
||||
output,
|
||||
dvMode,
|
||||
emitLog = { level, prefix, message ->
|
||||
Log.println(if (level == "error") Log.ERROR else Log.INFO, TAG, "$prefix $message")
|
||||
},
|
||||
onVideoTrackWrapped = { _ -> }
|
||||
).also { doviOutputWrapper = it }
|
||||
} else {
|
||||
doviOutputWrapper = null
|
||||
output
|
||||
}
|
||||
// Text pipeline, extractor-outward: raw media3-shape samples first hit
|
||||
// AssTrackOutput (libass dialogue feed), then the transcoding wrapper
|
||||
// parses them into cue samples. media3 does NOT wrap third-party
|
||||
// extractors' outputs; without this wrapper no text track would ever
|
||||
// reach the renderer as cues.
|
||||
this.output = AssSubtitleExtractorOutput(
|
||||
SubtitleTranscodingExtractorOutput(doviWrapped, subtitleParserFactory),
|
||||
assHandler
|
||||
)
|
||||
}
|
||||
|
||||
override fun read(input: ExtractorInput, seekPosition: PositionHolder): Int {
|
||||
currentInput = input
|
||||
try {
|
||||
if (!opened) openStreams()
|
||||
applyPendingSeek()
|
||||
alignLoader(input)?.let { position ->
|
||||
seekPosition.position = position
|
||||
return Extractor.RESULT_SEEK
|
||||
}
|
||||
// Aligned: the loader serves the samples, so nothing needs a second
|
||||
// handle open until the demuxer jumps again.
|
||||
if (io.isOpen) io.close()
|
||||
return readPacket()
|
||||
} catch (e: Throwable) {
|
||||
Log.w(TAG, "read threw at input=${input.position}", e)
|
||||
throw e
|
||||
} finally {
|
||||
currentInput = null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Byte position the loader should move to, or null when it already stands
|
||||
* where libavformat reads.
|
||||
*
|
||||
* Reads outside the loader's window are served by [io] regardless, so this
|
||||
* is an optimization, never a correctness requirement: it keeps sample
|
||||
* delivery on media3's own connection, which is what drives its byte
|
||||
* accounting, back-pressure (ProgressiveMediaPeriod watches the input
|
||||
* position) and load-error policy. Nothing here needs a retry budget.
|
||||
*/
|
||||
private fun alignLoader(input: ExtractorInput): Long? {
|
||||
val demuxerPosition = FfmpegDemuxerJni.nativeLogicalPosition()
|
||||
if (demuxerPosition < 0 || demuxerPosition == input.position) return null
|
||||
val length = input.length
|
||||
// Opening a range at or past the end is a failed request, not an
|
||||
// alignment; let the read report end of input instead.
|
||||
if (length != C.LENGTH_UNSET.toLong() && demuxerPosition >= length) return null
|
||||
return demuxerPosition
|
||||
}
|
||||
|
||||
/**
|
||||
* Records the target; [read] performs it. media3's byte position is its
|
||||
* SeekMap guess and is deliberately ignored — libavformat picks the byte
|
||||
* position from its own index.
|
||||
*/
|
||||
override fun seek(position: Long, timeUs: Long) {
|
||||
Log.i(TAG, "extractor seek timeUs=$timeUs opened=$opened")
|
||||
doviOutputWrapper?.resetTracks()
|
||||
// Buffered LOAS bytes belong to the pre-seek stream; the StreamMuxConfig
|
||||
// survives so audio resumes without waiting for the next config.
|
||||
for (latm in latmOutputs) latm.reset()
|
||||
pendingSeekUs = timeUs
|
||||
}
|
||||
|
||||
private fun applyPendingSeek() {
|
||||
val target = pendingSeekUs
|
||||
if (target == C.TIME_UNSET) return
|
||||
pendingSeekUs = C.TIME_UNSET
|
||||
// media3 issues seek(0) before the first read of every item; a demuxer
|
||||
// that has not delivered a packet yet is already at the start, and
|
||||
// seeking would throw away find_stream_info's buffered packets and
|
||||
// re-read the header region.
|
||||
if (target == 0L && !deliveredAnyPacket) return
|
||||
val code = FfmpegDemuxerJni.nativeSeek(target)
|
||||
if (code == FfmpegDemuxerJni.ERR_JAVA) {
|
||||
throw IOException(inputProxy.lastError ?: "demuxer input failed")
|
||||
}
|
||||
if (code != 0) {
|
||||
// No usable index in this container: libavformat keeps delivering from
|
||||
// where it stands and the renderers decode-discard toward the target,
|
||||
// which is what media3's own extractors do for a cueless file.
|
||||
Log.w(TAG, "demuxer refused seek to ${target}us: $code")
|
||||
}
|
||||
}
|
||||
|
||||
override fun release() {
|
||||
releaseDemuxer()
|
||||
}
|
||||
|
||||
private fun releaseDemuxer() {
|
||||
if (opened) {
|
||||
opened = false
|
||||
FfmpegDemuxerJni.nativeClose()
|
||||
}
|
||||
io.close()
|
||||
pendingSeekUs = C.TIME_UNSET
|
||||
deliveredAnyPacket = false
|
||||
// media3's extractors may demux a later item while this instance keeps
|
||||
// the previous one's stream layout; a stale measurement must not leak
|
||||
// into stats.
|
||||
bitrateMeters = emptyArray()
|
||||
}
|
||||
|
||||
/**
|
||||
* Measured average bitrate (bps) of the audio stream whose index matches
|
||||
* [formatId] (this extractor sets `Format.id` to the stream index), or null
|
||||
* when this instance is not demuxing that stream. Fallback for containers
|
||||
* that declare no per-track bitrate (#2063).
|
||||
*/
|
||||
fun measuredAudioBitrateBps(formatId: String?): Int? {
|
||||
val index = formatId?.toIntOrNull() ?: return null
|
||||
return bitrateMeters.getOrNull(index)?.bitrateBps()
|
||||
}
|
||||
|
||||
private fun openStreams() {
|
||||
when (val code = FfmpegDemuxerJni.nativeOpen(inputProxy)) {
|
||||
0 -> {
|
||||
prepareTracks()
|
||||
opened = true
|
||||
Log.i(TAG, "ffmpeg demuxer ready: ${trackOutputs.count { it != null }} tracks")
|
||||
}
|
||||
FfmpegDemuxerJni.ERR_JAVA -> throw IOException(inputProxy.lastError ?: "demuxer input failed")
|
||||
else -> throw malformed("ffmpeg demuxer open failed: $code")
|
||||
}
|
||||
}
|
||||
|
||||
private enum class SubtitleKind { NONE, SSA, SUBRIP, VTT }
|
||||
|
||||
private fun prepareTracks() {
|
||||
val count = FfmpegDemuxerJni.nativeStreamCount()
|
||||
durationUs = FfmpegDemuxerJni.nativeDurationUs().takeIf { it >= 0 } ?: C.TIME_UNSET
|
||||
trackOutputs = arrayOfNulls(count)
|
||||
subtitleKinds = Array(count) { SubtitleKind.NONE }
|
||||
bitrateMeters = arrayOfNulls(count)
|
||||
latmOutputs.clear()
|
||||
// Fonts go in before any text track exists so AssHandler's store flushes
|
||||
// them into libass when the first ASS track is created.
|
||||
deliverFontAttachments()
|
||||
val numbers = LongArray(FfmpegDemuxerJni.INFO_LENGTH)
|
||||
val strings = arrayOfNulls<String>(3)
|
||||
var primaryVideo = -1
|
||||
var primaryAudio = -1
|
||||
|
||||
for (index in 0 until count) {
|
||||
if (!FfmpegDemuxerJni.nativeStreamInfo(index, numbers, strings)) continue
|
||||
val mime = strings[0] ?: continue
|
||||
val trackType = when (numbers[FfmpegDemuxerJni.INFO_TRACK_TYPE]) {
|
||||
0L -> C.TRACK_TYPE_VIDEO
|
||||
1L -> C.TRACK_TYPE_AUDIO
|
||||
2L -> C.TRACK_TYPE_TEXT
|
||||
else -> continue
|
||||
}
|
||||
|
||||
val builder = Format.Builder()
|
||||
.setId(index.toString())
|
||||
.setSampleMimeType(mime)
|
||||
.setLanguage(strings[1])
|
||||
.setLabel(strings[2])
|
||||
.setSelectionFlags(numbers[FfmpegDemuxerJni.INFO_SELECTION_FLAGS].toInt())
|
||||
.setRoleFlags(numbers[FfmpegDemuxerJni.INFO_ROLE_FLAGS].toInt())
|
||||
.setAverageBitrate(numbers[FfmpegDemuxerJni.INFO_BITRATE].toInt())
|
||||
|
||||
val extradata = FfmpegDemuxerJni.nativeStreamExtradata(index)
|
||||
if (extradata != null) {
|
||||
// Audio csd is codec-specific in media3 (see FfmpegAudioCsd); raw
|
||||
// extradata is only correct for video (already Annex-B via the JNI
|
||||
// bitstream filter) and text tracks.
|
||||
builder.setInitializationData(
|
||||
if (trackType == C.TRACK_TYPE_AUDIO) {
|
||||
FfmpegAudioCsd.initializationData(mime, extradata)
|
||||
} else {
|
||||
listOf(extradata)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
when (trackType) {
|
||||
C.TRACK_TYPE_VIDEO -> {
|
||||
// A Dolby Vision config record rides the stream as side data.
|
||||
// Mirror media3's MP4/Matroska extractors: recognized profiles
|
||||
// publish video/dolby-vision with the RFC 6381 codecs string, so
|
||||
// DoviConvertingTrackOutput's P7 conversion, the P8 passthrough
|
||||
// path, and the renderer's HEVC fallback engage exactly as they do
|
||||
// on the media3 demux path.
|
||||
val doviProfile = numbers[FfmpegDemuxerJni.INFO_DOVI_PROFILE].toInt()
|
||||
if (doviProfile >= 0) {
|
||||
val doviLevel = numbers[FfmpegDemuxerJni.INFO_DOVI_LEVEL].toInt().coerceAtLeast(0)
|
||||
val doviCodecs = DoviCodecs.rfc6381(doviProfile, doviLevel)
|
||||
if (doviCodecs != null) {
|
||||
builder.setCodecs(doviCodecs)
|
||||
builder.setSampleMimeType(MimeTypes.VIDEO_DOLBY_VISION)
|
||||
}
|
||||
Log.i(TAG, "video track $index: doviProfile=$doviProfile doviLevel=$doviLevel codecs=$doviCodecs baseMime=$mime")
|
||||
}
|
||||
val width = numbers[FfmpegDemuxerJni.INFO_WIDTH].toInt()
|
||||
val height = numbers[FfmpegDemuxerJni.INFO_HEIGHT].toInt()
|
||||
builder
|
||||
.setWidth(width)
|
||||
.setHeight(height)
|
||||
.setRotationDegrees(numbers[FfmpegDemuxerJni.INFO_ROTATION].toInt())
|
||||
val parNum = numbers[FfmpegDemuxerJni.INFO_PAR_NUM]
|
||||
val parDen = numbers[FfmpegDemuxerJni.INFO_PAR_DEN]
|
||||
if (parNum > 0 && parDen > 0 && parNum != parDen) {
|
||||
builder.setPixelWidthHeightRatio(parNum.toFloat() / parDen.toFloat())
|
||||
}
|
||||
val fpsNum = numbers[FfmpegDemuxerJni.INFO_FPS_NUM]
|
||||
val fpsDen = numbers[FfmpegDemuxerJni.INFO_FPS_DEN]
|
||||
if (fpsNum > 0 && fpsDen > 0) {
|
||||
builder.setFrameRate(fpsNum.toFloat() / fpsDen.toFloat())
|
||||
}
|
||||
if (primaryVideo < 0) {
|
||||
primaryVideo = index
|
||||
// libass needs the storage size before the first render; the
|
||||
// Matroska path published it from the Tracks element the same way.
|
||||
if (width > 0 && height > 0) assHandler.setVideoSize(width, height)
|
||||
}
|
||||
}
|
||||
C.TRACK_TYPE_AUDIO -> {
|
||||
builder
|
||||
.setSampleRate(numbers[FfmpegDemuxerJni.INFO_SAMPLE_RATE].toInt())
|
||||
.setChannelCount(numbers[FfmpegDemuxerJni.INFO_CHANNELS].toInt())
|
||||
val pcmEncoding = numbers[FfmpegDemuxerJni.INFO_PCM_ENCODING].toInt()
|
||||
if (pcmEncoding >= 0) builder.setPcmEncoding(pcmEncoding)
|
||||
if (primaryAudio < 0) primaryAudio = index
|
||||
bitrateMeters[index] = StreamBitrateMeter()
|
||||
}
|
||||
C.TRACK_TYPE_TEXT -> {
|
||||
val kind = when (mime) {
|
||||
MimeTypes.TEXT_SSA -> SubtitleKind.SSA
|
||||
MimeTypes.APPLICATION_SUBRIP -> SubtitleKind.SUBRIP
|
||||
MimeTypes.TEXT_VTT -> SubtitleKind.VTT
|
||||
else -> SubtitleKind.NONE
|
||||
}
|
||||
subtitleKinds[index] = kind
|
||||
if (kind == SubtitleKind.SSA) {
|
||||
// Embedded ASS reaches libass as per-sample dialogue, never as a
|
||||
// whole file: AssSubtitleParserFactory keys embedded handling off
|
||||
// the Matroska container mime, and AssHeaderParser reads the
|
||||
// header from initializationData[1] — the exact layout media3's
|
||||
// MatroskaExtractor publishes.
|
||||
builder.setContainerMimeType(MimeTypes.VIDEO_MATROSKA)
|
||||
if (extradata != null) {
|
||||
builder.setInitializationData(
|
||||
listOf(FfmpegSubtitleSamples.SSA_DIALOGUE_FORMAT, extradata)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val rawOutput = output.track(index, trackType)
|
||||
val trackOutput = if (trackType == C.TRACK_TYPE_AUDIO && numbers[FfmpegDemuxerJni.INFO_LATM] == 1L) {
|
||||
// LOAS/LATM-framed AAC: unwrap to raw access units; the wrapper
|
||||
// swallows this placeholder Format and emits the real one parsed from
|
||||
// the StreamMuxConfig.
|
||||
LatmTrackOutput(rawOutput, index).also { latmOutputs.add(it) }
|
||||
} else {
|
||||
rawOutput
|
||||
}
|
||||
trackOutput.format(builder.build())
|
||||
trackOutputs[index] = trackOutput
|
||||
}
|
||||
|
||||
output.endTracks()
|
||||
output.seekMap(SeekMapImpl())
|
||||
}
|
||||
|
||||
/** Hands embedded font attachments to libass, under the shared budgets. */
|
||||
private fun deliverFontAttachments() {
|
||||
val count = FfmpegDemuxerJni.nativeAttachmentCount()
|
||||
if (count <= 0) return
|
||||
var acceptedBytes = 0L
|
||||
val meta = arrayOfNulls<String>(2)
|
||||
for (ordinal in 0 until count) {
|
||||
val size = FfmpegDemuxerJni.nativeAttachmentInfo(ordinal, meta)
|
||||
if (size <= 0) continue
|
||||
val name = meta[0] ?: continue
|
||||
val mime = meta[1] ?: continue
|
||||
if (mime !in AssFonts.fontMimeTypes) continue
|
||||
val rejectionReason = AssFonts.rejectionReason(size, acceptedBytes)
|
||||
if (rejectionReason != null) {
|
||||
Log.w(TAG, "Skipping embedded font: $rejectionReason (bytes=$size, accepted=$acceptedBytes)")
|
||||
continue
|
||||
}
|
||||
val data = FfmpegDemuxerJni.nativeAttachmentData(ordinal) ?: continue
|
||||
acceptedBytes += size
|
||||
assHandler.addFont(name, data)
|
||||
}
|
||||
}
|
||||
|
||||
private fun readPacket(): Int {
|
||||
while (true) {
|
||||
val code = FfmpegDemuxerJni.nativeReadPacket(packetBytes, packetOut)
|
||||
when (code) {
|
||||
FfmpegDemuxerJni.CODE_PACKET -> {
|
||||
val streamIndex = packetOut[FfmpegDemuxerJni.OUT_STREAM_INDEX].toInt()
|
||||
val size = packetOut[FfmpegDemuxerJni.OUT_SIZE].toInt()
|
||||
val trackOutput = trackOutputs.getOrNull(streamIndex) ?: continue
|
||||
val ptsUs = packetOut[FfmpegDemuxerJni.OUT_PTS_US]
|
||||
val isKeyframe = packetOut[FfmpegDemuxerJni.OUT_FLAGS] and 1L != 0L
|
||||
val subtitleKind = subtitleKinds.getOrNull(streamIndex) ?: SubtitleKind.NONE
|
||||
if (subtitleKind != SubtitleKind.NONE) {
|
||||
// Text samples carry their duration inside the sample text, in
|
||||
// media3's MatroskaExtractor shape; a sample without a duration
|
||||
// cannot be displayed (same skip media3 performs).
|
||||
val sampleDurationUs = packetOut[FfmpegDemuxerJni.OUT_DURATION_US]
|
||||
if (sampleDurationUs <= 0) {
|
||||
Log.w(TAG, "Skipping subtitle sample with no duration (stream=$streamIndex)")
|
||||
continue
|
||||
}
|
||||
val prefix = when (subtitleKind) {
|
||||
SubtitleKind.SSA -> FfmpegSubtitleSamples.ssaPrefix(sampleDurationUs)
|
||||
SubtitleKind.SUBRIP -> FfmpegSubtitleSamples.subripPrefix(sampleDurationUs)
|
||||
else -> FfmpegSubtitleSamples.vttPrefix(sampleDurationUs)
|
||||
}
|
||||
prefixParsable.reset(prefix, prefix.size)
|
||||
trackOutput.sampleData(prefixParsable, prefix.size)
|
||||
packetParsable.reset(packetBytes, size)
|
||||
trackOutput.sampleData(packetParsable, size)
|
||||
trackOutput.sampleMetadata(
|
||||
ptsUs,
|
||||
C.BUFFER_FLAG_KEY_FRAME,
|
||||
prefix.size + size,
|
||||
/* offset= */
|
||||
0,
|
||||
/* cryptoData= */
|
||||
null
|
||||
)
|
||||
return Extractor.RESULT_CONTINUE
|
||||
}
|
||||
packetParsable.reset(packetBytes, size)
|
||||
trackOutput.sampleData(packetParsable, size)
|
||||
// Native drops packets without any timestamp, so ptsUs is always real.
|
||||
trackOutput.sampleMetadata(
|
||||
ptsUs,
|
||||
if (isKeyframe) C.BUFFER_FLAG_KEY_FRAME else 0,
|
||||
size,
|
||||
/* offset= */
|
||||
0,
|
||||
/* cryptoData= */
|
||||
null
|
||||
)
|
||||
deliveredAnyPacket = true
|
||||
bitrateMeters.getOrNull(streamIndex)?.onPacket(ptsUs, size)
|
||||
return Extractor.RESULT_CONTINUE
|
||||
}
|
||||
FfmpegDemuxerJni.CODE_EOF -> return Extractor.RESULT_END_OF_INPUT
|
||||
FfmpegDemuxerJni.CODE_GROW -> {
|
||||
val required = packetOut[FfmpegDemuxerJni.OUT_SIZE].toInt()
|
||||
packetBytes = ByteArray(required + 64 * 1024)
|
||||
}
|
||||
FfmpegDemuxerJni.ERR_JAVA ->
|
||||
throw IOException(inputProxy.lastError ?: "demuxer input failed")
|
||||
else -> throw malformed("ffmpeg demuxer read failed: $code")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun malformed(message: String): ParserException = ParserException.createForMalformedContainer(message, null)
|
||||
|
||||
private inner class SeekMapImpl : SeekMap {
|
||||
override fun isSeekable(): Boolean = this@FfmpegExtractor.durationUs != C.TIME_UNSET
|
||||
|
||||
/**
|
||||
* The demuxer owns seek resolution: it reads its own index and lands on
|
||||
* the right keyframe by itself, so there is no second index here to keep
|
||||
* consistent. The byte position exists only to satisfy the interface —
|
||||
* [alignLoader] moves the loader to wherever libavformat actually ended
|
||||
* up, on the read that follows the seek.
|
||||
*/
|
||||
override fun getSeekPoints(timeUs: Long): SeekMap.SeekPoints = SeekMap.SeekPoints(SeekPoint(timeUs, 0))
|
||||
|
||||
// Qualified on purpose: bare `durationUs` binds to the inherited Java
|
||||
// getter as a synthetic property (this.getDurationUs()) and recurses.
|
||||
override fun getDurationUs(): Long = this@FfmpegExtractor.durationUs
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.datasource.DataSource
|
||||
import androidx.media3.datasource.DataSpec
|
||||
import androidx.media3.datasource.TransferListener
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
* Random-access byte source for the libavformat demuxer.
|
||||
*
|
||||
* libavformat demuxers own their own IO: they jump to the end of the file for an
|
||||
* index (matroska Cues, MP4 moov, AVI idx1), back to the header, and binary
|
||||
* search (MPEG-PS) whenever they please. media3's [
|
||||
* androidx.media3.extractor.ExtractorInput] is forward-only — an extractor may
|
||||
* only ask the loader to re-open elsewhere and be invoked again — so serving
|
||||
* libavformat from the loader alone means every backward jump has to unwind the
|
||||
* in-flight libavformat call and replay it, which is what the demuxer shim used
|
||||
* to do (and what made a matroska Cues read unrecoverable, #2096).
|
||||
*
|
||||
* This class removes the mismatch instead of working around it: reads outside
|
||||
* the loader's window open a second [DataSource] from the same factory media3
|
||||
* uses, positioned exactly where libavformat asked. Cronet, download caches,
|
||||
* SAF and the item's own request headers therefore still apply, because the
|
||||
* [DataSpec] is cloned from the one media3 opened for this item.
|
||||
*
|
||||
* Sequential sample delivery deliberately does not come through here: it stays
|
||||
* on the loader's connection so media3 keeps its byte accounting, back-pressure
|
||||
* and load-error policy (see [FfmpegExtractor]). This source is opened for
|
||||
* header/index bursts and closed again as soon as the loader is back in step.
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
internal class FfmpegRandomAccessSource(
|
||||
private val factory: DataSource.Factory,
|
||||
private val specProvider: () -> DataSpec?
|
||||
) {
|
||||
private var source: DataSource? = null
|
||||
|
||||
/** Absolute position the open handle returns next; [C.INDEX_UNSET] when closed. */
|
||||
private var handlePosition = C.INDEX_UNSET.toLong()
|
||||
|
||||
private var resolvedLength = C.LENGTH_UNSET.toLong()
|
||||
|
||||
private var opens = 0
|
||||
|
||||
/** Handles opened so far; the tests assert an index seek does not walk the file. */
|
||||
val openCount: Int
|
||||
get() = synchronized(this) { opens }
|
||||
|
||||
val isOpen: Boolean
|
||||
get() = synchronized(this) { source != null }
|
||||
|
||||
/**
|
||||
* Reads up to [length] bytes at absolute [position]. Returns the number of
|
||||
* bytes read, or 0 at end of input. Reopens the underlying source whenever
|
||||
* the requested position is not where the current handle stands, which is the
|
||||
* only way to move backwards on a byte stream.
|
||||
*/
|
||||
fun readAt(position: Long, buffer: ByteArray, length: Int): Int = synchronized(this) {
|
||||
if (length <= 0) return 0
|
||||
val handle = handleAt(position)
|
||||
val read = handle.read(buffer, 0, length)
|
||||
if (read == C.RESULT_END_OF_INPUT) return 0
|
||||
handlePosition = position + read
|
||||
read
|
||||
}
|
||||
|
||||
/**
|
||||
* Total resource length once some open has resolved it, else
|
||||
* [C.LENGTH_UNSET]. Never performs IO of its own: the extractor prefers the
|
||||
* length media3 already resolved for the loader.
|
||||
*/
|
||||
fun length(): Long = synchronized(this) { resolvedLength }
|
||||
|
||||
fun close() = synchronized(this) {
|
||||
closeHandle()
|
||||
handlePosition = C.INDEX_UNSET.toLong()
|
||||
}
|
||||
|
||||
private fun handleAt(position: Long): DataSource {
|
||||
val existing = source
|
||||
if (existing != null && handlePosition == position) return existing
|
||||
closeHandle()
|
||||
val spec = specProvider() ?: throw IOException("ffmpeg demuxer has no data spec for random access")
|
||||
// Clone rather than subrange: the recorded spec carries the loader's own
|
||||
// position, and subrange() is relative to it.
|
||||
val positioned = spec.buildUpon()
|
||||
.setPosition(position)
|
||||
.setLength(C.LENGTH_UNSET.toLong())
|
||||
.build()
|
||||
val created = factory.createDataSource()
|
||||
val remaining = try {
|
||||
created.open(positioned)
|
||||
} catch (e: Throwable) {
|
||||
closeQuietly(created)
|
||||
throw e
|
||||
}
|
||||
source = created
|
||||
handlePosition = position
|
||||
opens++
|
||||
if (remaining != C.LENGTH_UNSET.toLong()) resolvedLength = position + remaining
|
||||
return created
|
||||
}
|
||||
|
||||
private fun closeHandle() {
|
||||
source?.let { closeQuietly(it) }
|
||||
source = null
|
||||
}
|
||||
|
||||
private fun closeQuietly(dataSource: DataSource) {
|
||||
try {
|
||||
dataSource.close()
|
||||
} catch (_: IOException) {
|
||||
// Closing a handle we are abandoning cannot fail the read that replaces it.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [DataSource.Factory] that remembers the [DataSpec] media3 opened for each
|
||||
* item, so [FfmpegRandomAccessSource] can clone it — same URI, cache key, flags
|
||||
* and request headers — instead of re-deriving one and silently losing, say, a
|
||||
* download's cache key.
|
||||
*
|
||||
* Keyed by URI because ExoPlayer prepares the next item's period while the
|
||||
* current one is still loading; the demuxer must never read the next item's
|
||||
* bytes.
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
internal class RecordingDataSourceFactory(private val delegate: DataSource.Factory) : DataSource.Factory {
|
||||
|
||||
private val specs = object : LinkedHashMap<Uri, DataSpec>(8, 0.75f, false) {
|
||||
override fun removeEldestEntry(eldest: MutableMap.MutableEntry<Uri, DataSpec>): Boolean = size > MAX_TRACKED_ITEMS
|
||||
}
|
||||
|
||||
fun specFor(uri: Uri): DataSpec? = synchronized(specs) { specs[uri] }
|
||||
|
||||
override fun createDataSource(): DataSource = RecordingDataSource(delegate.createDataSource())
|
||||
|
||||
private fun record(dataSpec: DataSpec) {
|
||||
synchronized(specs) { specs[dataSpec.uri] = dataSpec }
|
||||
}
|
||||
|
||||
private inner class RecordingDataSource(private val inner: DataSource) : DataSource {
|
||||
override fun open(dataSpec: DataSpec): Long {
|
||||
record(dataSpec)
|
||||
return inner.open(dataSpec)
|
||||
}
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int = inner.read(buffer, offset, length)
|
||||
|
||||
override fun addTransferListener(transferListener: TransferListener) = inner.addTransferListener(transferListener)
|
||||
|
||||
override fun getUri(): Uri? = inner.uri
|
||||
|
||||
override fun getResponseHeaders(): Map<String, List<String>> = inner.responseHeaders
|
||||
|
||||
override fun close() = inner.close()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val MAX_TRACKED_ITEMS = 4
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Builds text subtitle samples in the exact shape media3's MatroskaExtractor
|
||||
* writes, so the same downstream consumers work behind the FFmpeg demuxer:
|
||||
* the bundled SsaParser/SubripParser/WebvttParser (via
|
||||
* SubtitleTranscodingExtractorOutput) and AssTrackOutput's dialogue feed.
|
||||
*
|
||||
* MatroskaExtractor prefixes each raw payload with a synthetic header whose
|
||||
* *second* timecode carries the sample duration (BlockDuration), while the
|
||||
* first stays zero; parsers reconstruct absolute times as sampleTimeUs +
|
||||
* parsedStart. FFmpeg hands us the same raw payloads (an ASS packet is the
|
||||
* MKV block: "ReadOrder,Layer,Style,...,Text"; SubRip/WebVTT packets are the
|
||||
* bare cue text), so only the prefix needs synthesizing.
|
||||
*/
|
||||
internal object FfmpegSubtitleSamples {
|
||||
|
||||
val SSA_DIALOGUE_FORMAT: ByteArray =
|
||||
"Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text"
|
||||
.toByteArray(Charsets.UTF_8)
|
||||
|
||||
/** `Dialogue: 0:00:00:00,H:MM:SS:CC,` — centiseconds, ':' separator (media3's SSA shape). */
|
||||
fun ssaPrefix(durationUs: Long): ByteArray = "Dialogue: 0:00:00:00,${timecode(durationUs, "%01d:%02d:%02d:%02d", 10_000)},"
|
||||
.toByteArray(Charsets.UTF_8)
|
||||
|
||||
/** `1\n00:00:00,000 --> HH:MM:SS,mmm\n` — a complete SRT cue header. */
|
||||
fun subripPrefix(durationUs: Long): ByteArray = "1\n00:00:00,000 --> ${timecode(durationUs, "%02d:%02d:%02d,%03d", 1_000)}\n"
|
||||
.toByteArray(Charsets.UTF_8)
|
||||
|
||||
/** `WEBVTT\n\n00:00:00.000 --> HH:MM:SS.mmm\n` — a one-cue WebVTT document header. */
|
||||
fun vttPrefix(durationUs: Long): ByteArray = "WEBVTT\n\n00:00:00.000 --> ${timecode(durationUs, "%02d:%02d:%02d.%03d", 1_000)}\n"
|
||||
.toByteArray(Charsets.UTF_8)
|
||||
|
||||
private fun timecode(timeUs: Long, format: String, lastValueDivisor: Long): String {
|
||||
val hours = timeUs / 3_600_000_000L
|
||||
var remainder = timeUs - hours * 3_600_000_000L
|
||||
val minutes = remainder / 60_000_000L
|
||||
remainder -= minutes * 60_000_000L
|
||||
val seconds = remainder / 1_000_000L
|
||||
remainder -= seconds * 1_000_000L
|
||||
val lastValue = remainder / lastValueDivisor
|
||||
return String.format(Locale.US, format, hours, minutes, seconds, lastValue)
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
|
||||
/** MKV CodecID for Microsoft ACM compatibility mode. */
|
||||
private const val CODEC_ID_ACM = "A_MS/ACM"
|
||||
|
||||
/**
|
||||
* MatroskaExtractor.init is final and extractorOutput private; subclasses swap
|
||||
* in wrapping outputs via reflection once the Segment element starts (shared
|
||||
* with ZlibMatroskaExtractor).
|
||||
*/
|
||||
internal val matroskaExtractorOutputField by lazy {
|
||||
MatroskaExtractor::class.java.getDeclaredField("extractorOutput").apply {
|
||||
isAccessible = true
|
||||
}
|
||||
}
|
||||
|
||||
/** WAVEFORMATEX format tag for LOAS/LATM-wrapped AAC (WAVE_FORMAT_MPEG_LOAS). */
|
||||
private const val WAVE_FORMAT_MPEG_LOAS = 0x1602
|
||||
|
||||
/**
|
||||
* Returns whether a track is LOAS/LATM AAC muxed as A_MS/ACM — ffmpeg's
|
||||
* fallback mapping for aac_latm, which Matroska has no native codec ID for.
|
||||
* The WAVEFORMATEX wFormatTag is the first 2 bytes (LE) of CodecPrivate.
|
||||
*/
|
||||
fun isLoasAcmTrack(codecId: String?, codecPrivate: ByteArray?): Boolean = codecId == CODEC_ID_ACM &&
|
||||
codecPrivate != null &&
|
||||
codecPrivate.size >= 2 &&
|
||||
((codecPrivate[0].toInt() and 0xFF) or ((codecPrivate[1].toInt() and 0xFF) shl 8)) == WAVE_FORMAT_MPEG_LOAS
|
||||
|
||||
/**
|
||||
* ExtractorOutput wrapper that wraps marked tracks with [LatmTrackOutput].
|
||||
* Call [markNextTrackLatm] before the parent extractor creates the track
|
||||
* (i.e. before super.endMasterElement(ID_TRACK_ENTRY)).
|
||||
*/
|
||||
class LatmExtractorOutputWrapper(
|
||||
private val delegate: ExtractorOutput
|
||||
) : ExtractorOutput {
|
||||
|
||||
private var nextTrackIsLatm = false
|
||||
private val latmOutputs = mutableListOf<LatmTrackOutput>()
|
||||
|
||||
fun markNextTrackLatm() {
|
||||
nextTrackIsLatm = true
|
||||
}
|
||||
|
||||
/** Resets LATM parser state after an extractor seek. */
|
||||
fun resetTracks() {
|
||||
latmOutputs.forEach { it.reset() }
|
||||
}
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput {
|
||||
val original = delegate.track(id, type)
|
||||
if (!nextTrackIsLatm) return original
|
||||
nextTrackIsLatm = false
|
||||
return LatmTrackOutput(original, id).also { latmOutputs.add(it) }
|
||||
}
|
||||
|
||||
override fun endTracks() = delegate.endTracks()
|
||||
override fun seekMap(seekMap: SeekMap) = delegate.seekMap(seekMap)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
|
||||
/**
|
||||
* Delegates everything to [delegate] but hands it a wrapped [ExtractorOutput].
|
||||
* Used to compose the text pipeline (libass dialogue feed + subtitle cue
|
||||
* transcoding) around media3's raw-subtitle MatroskaExtractor without
|
||||
* subclassing or reflection.
|
||||
*/
|
||||
@UnstableApi
|
||||
internal class OutputWrappingExtractor(
|
||||
private val delegate: Extractor,
|
||||
private val wrap: (ExtractorOutput) -> ExtractorOutput
|
||||
) : Extractor {
|
||||
override fun sniff(input: ExtractorInput): Boolean = delegate.sniff(input)
|
||||
|
||||
override fun init(output: ExtractorOutput) = delegate.init(wrap(output))
|
||||
|
||||
override fun read(input: ExtractorInput, seekPosition: PositionHolder): Int = delegate.read(input, seekPosition)
|
||||
|
||||
override fun seek(position: Long, timeUs: Long) = delegate.seek(position, timeUs)
|
||||
|
||||
override fun release() = delegate.release()
|
||||
|
||||
override fun getUnderlyingImplementation(): Extractor = delegate.underlyingImplementation
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
/**
|
||||
* Rolling average bitrate of one demuxed stream, measured from packet sizes
|
||||
* over their presentation-time span — the same source of truth mpv uses for
|
||||
* its `audio-bitrate` property. It exists because containers frequently
|
||||
* declare no per-track bitrate (Matroska without BPS statistics tags), which
|
||||
* left the performance overlay with nothing to show (#2063).
|
||||
*
|
||||
* Fed from the loader thread ([onPacket]) and read from the stats path
|
||||
* ([bitrateBps]); both are synchronized. The measurement follows the demux
|
||||
* position, which runs ahead of the playhead by the buffered duration —
|
||||
* acceptable for a diagnostics overlay.
|
||||
*/
|
||||
internal class StreamBitrateMeter(private val windowUs: Long = DEFAULT_WINDOW_US) {
|
||||
|
||||
private val ptsUsQueue = ArrayDeque<Long>()
|
||||
private val sizeQueue = ArrayDeque<Int>()
|
||||
private var windowBytes = 0L
|
||||
|
||||
@Synchronized
|
||||
fun onPacket(ptsUs: Long, sizeBytes: Int) {
|
||||
if (sizeBytes <= 0) return
|
||||
// A backwards pts jump is a seek; packets on either side of it do not
|
||||
// form a contiguous span, so the window restarts.
|
||||
val last = ptsUsQueue.lastOrNull()
|
||||
if (last != null && ptsUs < last) reset()
|
||||
ptsUsQueue.addLast(ptsUs)
|
||||
sizeQueue.addLast(sizeBytes)
|
||||
windowBytes += sizeBytes
|
||||
while (ptsUsQueue.size > 1 && ptsUsQueue.last() - ptsUsQueue.first() > windowUs) {
|
||||
ptsUsQueue.removeFirst()
|
||||
windowBytes -= sizeQueue.removeFirst()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Average bitrate in bits per second over the current window, or null until
|
||||
* enough packets span a measurable interval.
|
||||
*/
|
||||
@Synchronized
|
||||
fun bitrateBps(): Int? {
|
||||
if (ptsUsQueue.size < MIN_PACKETS) return null
|
||||
val spanUs = ptsUsQueue.last() - ptsUsQueue.first()
|
||||
if (spanUs <= 0) return null
|
||||
// The pts span covers the durations of every packet except the last one,
|
||||
// whose bytes are therefore excluded — a constant-rate stream measures
|
||||
// exactly its rate.
|
||||
val bytes = windowBytes - sizeQueue.last()
|
||||
if (bytes <= 0) return null
|
||||
return (bytes * 8_000_000L / spanUs).toInt()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun reset() {
|
||||
ptsUsQueue.clear()
|
||||
sizeQueue.clear()
|
||||
windowBytes = 0L
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val DEFAULT_WINDOW_US = 10_000_000L
|
||||
private const val MIN_PACKETS = 16
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.ParserException
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import java.util.zip.DataFormatException
|
||||
import java.util.zip.Inflater
|
||||
|
||||
/**
|
||||
* TrackOutput wrapper that inflates zlib-compressed sample data (MKV ContentCompAlgo 0).
|
||||
* Each MKV block is independently zlib-compressed; this wrapper decompresses per-sample
|
||||
* between sampleData() and sampleMetadata() calls.
|
||||
*
|
||||
* All buffers are reused across samples to minimize GC pressure on the hot path.
|
||||
*/
|
||||
class ZlibInflatingTrackOutput(
|
||||
delegate: TrackOutput
|
||||
) : BufferedTransformingTrackOutput(
|
||||
delegate,
|
||||
INITIAL_BUFFER_SIZE,
|
||||
INFLATE_CHUNK,
|
||||
MAX_COMPRESSED_SAMPLE_SIZE
|
||||
) {
|
||||
|
||||
companion object {
|
||||
private const val INITIAL_BUFFER_SIZE = 256 * 1024
|
||||
private const val INFLATE_CHUNK = 64 * 1024
|
||||
private const val MAX_COMPRESSED_SAMPLE_SIZE = 16 * 1024 * 1024
|
||||
private const val MAX_INFLATED_SAMPLE_SIZE = 16 * 1024 * 1024
|
||||
private const val MAX_COMPRESSION_RATIO = 1024L
|
||||
private const val MIN_RATIO_ALLOWANCE = 1024L * 1024
|
||||
}
|
||||
|
||||
var active = false
|
||||
|
||||
private val inflater = Inflater()
|
||||
private var inflateBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private val overflowProbe = ByteArray(1)
|
||||
|
||||
override val transformEnabled: Boolean
|
||||
get() = active
|
||||
|
||||
override val transformedBuffer: ByteArray
|
||||
get() = inflateBuf
|
||||
|
||||
override fun transformSample(inputLength: Int, flags: Int): Int {
|
||||
inflater.reset()
|
||||
inflater.setInput(inputBuffer, 0, inputLength)
|
||||
var written = 0
|
||||
val ratioBound = maxOf(MIN_RATIO_ALLOWANCE, inputLength.toLong() * MAX_COMPRESSION_RATIO)
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
if (written == inflateBuf.size) {
|
||||
if (inflateBuf.size < MAX_INFLATED_SAMPLE_SIZE) {
|
||||
val nextSize = minOf(MAX_INFLATED_SAMPLE_SIZE, inflateBuf.size * 2)
|
||||
inflateBuf = inflateBuf.copyOf(nextSize)
|
||||
} else {
|
||||
val overflow = inflater.inflate(overflowProbe, 0, 1)
|
||||
if (overflow > 0) {
|
||||
throw malformed("Inflated sample exceeds the maximum size")
|
||||
}
|
||||
if (inflater.finished()) return written
|
||||
throw stalledInflate()
|
||||
}
|
||||
}
|
||||
|
||||
val count = inflater.inflate(inflateBuf, written, inflateBuf.size - written)
|
||||
written += count
|
||||
if (written.toLong() > ratioBound) {
|
||||
throw malformed("Inflated sample exceeds the maximum compression ratio")
|
||||
}
|
||||
if (inflater.finished()) return written
|
||||
if (count == 0) throw stalledInflate()
|
||||
}
|
||||
} catch (_: DataFormatException) {
|
||||
// Preserve playback for corrupt subtitle blocks; the raw sample remains bounded
|
||||
// by MAX_COMPRESSED_SAMPLE_SIZE and matches the pre-hardening fallback.
|
||||
if (inflateBuf.size < inputLength) inflateBuf = inflateBuf.copyOf(inputLength)
|
||||
inputBuffer.copyInto(inflateBuf, endIndex = inputLength)
|
||||
return inputLength
|
||||
}
|
||||
}
|
||||
|
||||
private fun stalledInflate(): ParserException = when {
|
||||
inflater.needsDictionary() -> malformed("Zlib-compressed sample requires a dictionary")
|
||||
inflater.needsInput() -> malformed("Truncated zlib-compressed sample")
|
||||
else -> malformed("Zlib decompressor made no progress")
|
||||
}
|
||||
|
||||
private fun malformed(message: String, cause: Throwable? = null): ParserException = ParserException.createForMalformedContainer(message, cause)
|
||||
}
|
||||
@@ -1,315 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.util.Log
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.text.SubtitleParser
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.extractor.AssMatroskaExtractor
|
||||
import java.io.EOFException
|
||||
import java.util.zip.DataFormatException
|
||||
import java.util.zip.Inflater
|
||||
|
||||
/**
|
||||
* Extends AssMatroskaExtractor to add support for MKV quirks media3 rejects:
|
||||
*
|
||||
* ContentCompAlgo 0 (zlib) — media3 only supports ContentCompAlgo 3 (header
|
||||
* stripping). This subclass intercepts the compression algorithm during track
|
||||
* header parsing:
|
||||
* - Tells the parent it's header stripping (algo 3) to avoid the ParserException
|
||||
* - Skips ContentCompSettings for zlib tracks (not applicable)
|
||||
* - For text subtitle tracks, inflates the block payload *before* the parent
|
||||
* parses it (see below). For every other zlib track, wraps TrackOutputs with
|
||||
* ZlibInflatingTrackOutput to decompress per-sample data.
|
||||
*
|
||||
* Text subtitle tracks (SRT/ASS/SSA/VTT) cannot be inflated at the TrackOutput
|
||||
* level: MatroskaExtractor rewrites their samples in-place before any TrackOutput
|
||||
* runs — it prepends a plaintext timecode prefix ("Dialogue: 0:00:00:00,…,") to
|
||||
* the still-compressed payload and truncates the sample at the first NUL byte,
|
||||
* which deflate streams routinely contain (#2023). AssTrackOutput additionally
|
||||
* feeds that same internal buffer straight to libass. So for zlib text tracks the
|
||||
* frame payload is inflated at the block level, before the parent's sample
|
||||
* assembly, and the TrackOutput wrapper is left inactive.
|
||||
*
|
||||
* LOAS/LATM AAC as A_MS/ACM — media3 sets audio/x-unknown for non-PCM ACM
|
||||
* tracks (silent playback). Detected tracks are wrapped with LatmTrackOutput,
|
||||
* which unwraps LOAS frames to raw AAC for direct-playing Matroska files.
|
||||
*/
|
||||
class ZlibMatroskaExtractor(
|
||||
subtitleParserFactory: SubtitleParser.Factory,
|
||||
assHandler: AssHandler
|
||||
) : AssMatroskaExtractor(subtitleParserFactory, assHandler) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ZlibMkvExtractor"
|
||||
|
||||
// Matroska EBML element IDs
|
||||
private const val ID_SEGMENT = 0x18538067
|
||||
private const val ID_TRACK_ENTRY = 0xAE
|
||||
private const val ID_CONTENT_COMPRESSION_ALGORITHM = 0x4254
|
||||
private const val ID_CONTENT_COMPRESSION_SETTINGS = 0x4255
|
||||
private const val ID_CONTENT_COMPRESSION = 0x5034
|
||||
private const val ID_SIMPLE_BLOCK = 0xA3
|
||||
private const val ID_BLOCK = 0xA1
|
||||
|
||||
/**
|
||||
* Codec IDs whose samples MatroskaExtractor rewrites in-place (timecode prefix
|
||||
* plus NUL truncation) before any TrackOutput runs — the authority is the
|
||||
* prefix list in MatroskaExtractor.writeSampleData.
|
||||
*/
|
||||
private val TEXT_SUBTITLE_CODEC_IDS = setOf("S_TEXT/UTF8", "S_TEXT/ASS", "S_TEXT/SSA", "S_TEXT/WEBVTT")
|
||||
|
||||
/** Subtitle blocks are tiny; anything above this passes through untouched. */
|
||||
private const val MAX_TEXT_BLOCK_BYTES = 16 * 1024 * 1024
|
||||
}
|
||||
|
||||
private var zlibOutput: ZlibExtractorOutputWrapper? = null
|
||||
private var latmOutput: LatmExtractorOutputWrapper? = null
|
||||
private var currentTrackUsesZlib = false
|
||||
|
||||
/** Track numbers whose blocks are inflated before the parent parses them. */
|
||||
private val zlibTextTrackNumbers = mutableSetOf<Int>()
|
||||
private val blockInflater = Inflater()
|
||||
private var blockBuf = ByteArray(0)
|
||||
private val peekBuf = ByteArray(8)
|
||||
|
||||
override fun startMasterElement(id: Int, contentPosition: Long, contentSize: Long) {
|
||||
super.startMasterElement(id, contentPosition, contentSize)
|
||||
|
||||
// ContentCompAlgo DEFAULTS to 0 (zlib), so mkvmerge omits the element for
|
||||
// zlib tracks entirely — the mere presence of ContentCompression means zlib
|
||||
// until an explicit ContentCompAlgo says otherwise. media3 ignores an empty
|
||||
// ContentCompression and would silently emit compressed samples.
|
||||
if (id == ID_CONTENT_COMPRESSION) {
|
||||
currentTrackUsesZlib = true
|
||||
Log.i(TAG, "Track has ContentCompression, assuming ContentCompAlgo 0 (zlib) until told otherwise")
|
||||
}
|
||||
|
||||
// After super installs AssSubtitleExtractorOutput, wrap it with our zlib +
|
||||
// LATM layers (zlib outermost so inflation runs before LATM parsing).
|
||||
if (id == ID_SEGMENT && zlibOutput == null) {
|
||||
val currentOutput = matroskaExtractorOutputField.get(this) as ExtractorOutput
|
||||
val latmWrapper = LatmExtractorOutputWrapper(currentOutput)
|
||||
latmOutput = latmWrapper
|
||||
val wrapper = ZlibExtractorOutputWrapper(latmWrapper)
|
||||
zlibOutput = wrapper
|
||||
matroskaExtractorOutputField.set(this, wrapper)
|
||||
Log.d(TAG, "Installed zlib+LATM ExtractorOutput wrapper")
|
||||
}
|
||||
}
|
||||
|
||||
override fun integerElement(id: Int, value: Long) {
|
||||
if (id == ID_CONTENT_COMPRESSION_ALGORITHM) {
|
||||
if (value == 0L) {
|
||||
currentTrackUsesZlib = true
|
||||
Log.i(TAG, "Track uses explicit ContentCompAlgo 0 (zlib), will inflate samples")
|
||||
// Tell parent it's header stripping (algo 3) to avoid ParserException
|
||||
super.integerElement(id, 3)
|
||||
return
|
||||
}
|
||||
// Explicit non-zlib algorithm: header stripping (3) is handled by the
|
||||
// parent; anything else makes the parent throw, matching stock behavior.
|
||||
currentTrackUsesZlib = false
|
||||
}
|
||||
super.integerElement(id, value)
|
||||
}
|
||||
|
||||
override fun binaryElement(id: Int, contentSize: Int, input: ExtractorInput) {
|
||||
if (id == ID_CONTENT_COMPRESSION_SETTINGS && currentTrackUsesZlib) {
|
||||
// Skip ContentCompSettings for zlib tracks — parent would store these as
|
||||
// sampleStrippedBytes and prepend them to every sample, corrupting output.
|
||||
input.skipFully(contentSize)
|
||||
return
|
||||
}
|
||||
if ((id == ID_SIMPLE_BLOCK || id == ID_BLOCK) &&
|
||||
zlibTextTrackNumbers.isNotEmpty() &&
|
||||
contentSize in MIN_BLOCK_BYTES..MAX_TEXT_BLOCK_BYTES &&
|
||||
peekBlockTrackNumber(input) in zlibTextTrackNumbers
|
||||
) {
|
||||
inflateTextBlock(id, contentSize, input)
|
||||
return
|
||||
}
|
||||
super.binaryElement(id, contentSize, input)
|
||||
}
|
||||
|
||||
override fun endMasterElement(id: Int) {
|
||||
var zlibTextTrackNumber: Int? = null
|
||||
if (id == ID_TRACK_ENTRY) {
|
||||
// Must inspect before super — the track output is created inside super's
|
||||
// endMasterElement, and the current track is cleared afterwards.
|
||||
val track = getCurrentTrack(id)
|
||||
if (isLoasAcmTrack(track.codecId, track.codecPrivate)) {
|
||||
Log.i(TAG, "Track ${track.number} is LOAS/LATM AAC, unwrapping to raw AAC")
|
||||
latmOutput?.markNextTrackLatm()
|
||||
}
|
||||
if (currentTrackUsesZlib && track.codecId in TEXT_SUBTITLE_CODEC_IDS) {
|
||||
zlibTextTrackNumber = track.number
|
||||
}
|
||||
}
|
||||
|
||||
val wasZlib = currentTrackUsesZlib
|
||||
super.endMasterElement(id)
|
||||
|
||||
if (id == ID_TRACK_ENTRY && wasZlib) {
|
||||
currentTrackUsesZlib = false
|
||||
if (zlibTextTrackNumber != null) {
|
||||
// Text subtitle samples are rewritten inside the parent before any
|
||||
// TrackOutput runs, so the TrackOutput wrapper stays inactive and the
|
||||
// block payload is inflated in binaryElement instead.
|
||||
zlibTextTrackNumbers.add(zlibTextTrackNumber)
|
||||
Log.i(TAG, "Track $zlibTextTrackNumber is a zlib text subtitle track, inflating at block level")
|
||||
} else {
|
||||
zlibOutput?.activateLast()
|
||||
Log.i(TAG, "Activated zlib inflation for track")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun seek(position: Long, timeUs: Long) {
|
||||
latmOutput?.resetTracks()
|
||||
zlibOutput?.resetTracks()
|
||||
super.seek(position, timeUs)
|
||||
}
|
||||
|
||||
/**
|
||||
* Peeks the EBML varint at the block start — the block's track number — without
|
||||
* consuming input. Returns null for malformed varints or truncated input; the
|
||||
* parent then produces the canonical failure for the untouched stream.
|
||||
*/
|
||||
private fun peekBlockTrackNumber(input: ExtractorInput): Int? {
|
||||
try {
|
||||
input.peekFully(peekBuf, 0, 1)
|
||||
val first = peekBuf[0].toInt() and 0xFF
|
||||
if (first == 0) return null
|
||||
val length = Integer.numberOfLeadingZeros(first) - 23
|
||||
var value = (first and (0xFF ushr length)).toLong()
|
||||
if (length > 1) {
|
||||
input.peekFully(peekBuf, 1, length - 1)
|
||||
for (i in 1 until length) {
|
||||
value = (value shl 8) or (peekBuf[i].toLong() and 0xFF)
|
||||
}
|
||||
}
|
||||
return if (value <= Int.MAX_VALUE) value.toInt() else null
|
||||
} catch (_: EOFException) {
|
||||
return null
|
||||
} finally {
|
||||
input.resetPeekPosition()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Buffers one text-subtitle block, inflates its frame payload, and hands the
|
||||
* parent a block whose payload is plaintext. A block that cannot be rewritten
|
||||
* (laced, corrupt, or over-bound) passes through byte-identical.
|
||||
*/
|
||||
private fun inflateTextBlock(id: Int, contentSize: Int, input: ExtractorInput) {
|
||||
val basePosition = input.position
|
||||
if (blockBuf.size < contentSize) blockBuf = ByteArray(maxOf(contentSize, blockBuf.size * 2))
|
||||
input.readFully(blockBuf, 0, contentSize)
|
||||
val rewritten = rewriteZlibTextBlock(blockBuf, contentSize, blockInflater)
|
||||
if (rewritten == null) {
|
||||
Log.w(TAG, "Passing zlib text block through uninflated (laced, corrupt, or over-bound)")
|
||||
super.binaryElement(id, contentSize, bufferedInput(blockBuf, contentSize, basePosition))
|
||||
} else {
|
||||
super.binaryElement(id, rewritten.size, bufferedInput(rewritten, rewritten.size, basePosition))
|
||||
}
|
||||
}
|
||||
|
||||
private fun bufferedInput(data: ByteArray, limit: Int, position: Long): ExtractorInput = DefaultExtractorInput(ByteRangeDataReader(data, limit), position, position + limit)
|
||||
|
||||
private class ByteRangeDataReader(private val data: ByteArray, private val limit: Int) : DataReader {
|
||||
private var position = 0
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
if (position == limit) return C.RESULT_END_OF_INPUT
|
||||
val count = minOf(length, limit - position)
|
||||
System.arraycopy(data, position, buffer, offset, count)
|
||||
position += count
|
||||
return count
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtractorOutput wrapper that wraps all TrackOutputs with ZlibInflatingTrackOutput.
|
||||
* Tracks are created inactive; activateLast() enables inflation for the most recently
|
||||
* created track (called when we know a track uses zlib compression).
|
||||
*/
|
||||
private class ZlibExtractorOutputWrapper(
|
||||
private val delegate: ExtractorOutput
|
||||
) : ExtractorOutput {
|
||||
|
||||
private var lastCreatedWrapper: ZlibInflatingTrackOutput? = null
|
||||
private val trackOutputs = mutableListOf<ZlibInflatingTrackOutput>()
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput {
|
||||
val original = delegate.track(id, type)
|
||||
return ZlibInflatingTrackOutput(original).also {
|
||||
trackOutputs.add(it)
|
||||
lastCreatedWrapper = it
|
||||
}
|
||||
}
|
||||
|
||||
fun activateLast() {
|
||||
lastCreatedWrapper?.active = true
|
||||
}
|
||||
|
||||
fun resetTracks() {
|
||||
trackOutputs.forEach { it.resetBufferedData() }
|
||||
}
|
||||
|
||||
override fun endTracks() = delegate.endTracks()
|
||||
override fun seekMap(seekMap: SeekMap) = delegate.seekMap(seekMap)
|
||||
}
|
||||
}
|
||||
|
||||
/** Smallest well-formed unlaced block: 1-byte varint + 2-byte timecode + flags + 1 payload byte. */
|
||||
internal const val MIN_BLOCK_BYTES = 5
|
||||
|
||||
/**
|
||||
* Rewrites one unlaced Matroska block whose frame payload is zlib-compressed:
|
||||
* returns the unchanged block header followed by the inflated payload, or null
|
||||
* when the block must pass through unchanged — lacing (never produced for text
|
||||
* subtitle tracks), a truncated or corrupt deflate stream, or an inflated size
|
||||
* beyond the bounds shared with [ZlibInflatingTrackOutput]'s hardening.
|
||||
*/
|
||||
internal fun rewriteZlibTextBlock(data: ByteArray, limit: Int, inflater: Inflater): ByteArray? {
|
||||
if (limit < MIN_BLOCK_BYTES) return null
|
||||
val first = data[0].toInt() and 0xFF
|
||||
if (first == 0) return null // track-number varint longer than 8 bytes
|
||||
val varintLength = Integer.numberOfLeadingZeros(first) - 23
|
||||
val headerLength = varintLength + 3 // varint + 2-byte timecode + flags
|
||||
if (limit <= headerLength) return null
|
||||
if (data[headerLength - 1].toInt() and 0x06 != 0) return null // laced
|
||||
|
||||
val payloadLength = limit - headerLength
|
||||
val ratioBound = maxOf(1024L * 1024, payloadLength.toLong() * 1024)
|
||||
val maxInflatedBytes = 16 * 1024 * 1024
|
||||
inflater.reset()
|
||||
inflater.setInput(data, headerLength, payloadLength)
|
||||
var buf = ByteArray(maxOf(4096, payloadLength * 4))
|
||||
var written = 0
|
||||
try {
|
||||
while (true) {
|
||||
if (written == buf.size) {
|
||||
if (buf.size >= maxInflatedBytes) return null
|
||||
buf = buf.copyOf(minOf(maxInflatedBytes, buf.size * 2))
|
||||
}
|
||||
val count = inflater.inflate(buf, written, buf.size - written)
|
||||
written += count
|
||||
if (written > ratioBound) return null
|
||||
if (inflater.finished()) break
|
||||
if (count == 0) return null // truncated stream or preset-dictionary request
|
||||
}
|
||||
} catch (_: DataFormatException) {
|
||||
return null
|
||||
}
|
||||
return ByteArray(headerLength + written).also {
|
||||
System.arraycopy(data, 0, it, 0, headerLength)
|
||||
System.arraycopy(buf, 0, it, headerLength, written)
|
||||
}
|
||||
}
|
||||
@@ -1205,6 +1205,7 @@ class MpvPlayerCore private constructor(
|
||||
extraDelayMs: Long,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int,
|
||||
matchResolution: Boolean,
|
||||
onComplete: (switched: Boolean) -> Unit
|
||||
) {
|
||||
val mgr = frameRateManager
|
||||
@@ -1212,7 +1213,7 @@ class MpvPlayerCore private constructor(
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
mgr.setVideoFrameRate(fps, videoDurationMs, extraDelayMs, videoWidth, videoHeight) { switched ->
|
||||
mgr.setVideoFrameRate(fps, videoDurationMs, extraDelayMs, videoWidth, videoHeight, matchResolution) { switched ->
|
||||
player?.let {
|
||||
updateDisplayFpsOverride(it, "frame rate switch, switched=$switched") {
|
||||
onComplete(switched)
|
||||
|
||||
@@ -464,14 +464,19 @@ open class MpvPlayerPlugin(
|
||||
val extraDelayMs = call.argument<Number>("extraDelayMs")?.toLong() ?: 0L
|
||||
val videoWidth = call.argument<Number>("videoWidth")?.toInt() ?: 0
|
||||
val videoHeight = call.argument<Number>("videoHeight")?.toInt() ?: 0
|
||||
val matchResolution = call.argument<Boolean>("matchResolution") ?: false
|
||||
|
||||
Log.d(tag, "setVideoFrameRate: fps=$fps, duration=$duration, extraDelayMs=$extraDelayMs, video=${videoWidth}x$videoHeight")
|
||||
Log.d(
|
||||
tag,
|
||||
"setVideoFrameRate: fps=$fps, duration=$duration, extraDelayMs=$extraDelayMs, " +
|
||||
"video=${videoWidth}x$videoHeight, matchResolution=$matchResolution"
|
||||
)
|
||||
val core = playerCore
|
||||
if (core == null) {
|
||||
result.success(false)
|
||||
return
|
||||
}
|
||||
core.setVideoFrameRate(fps, duration, extraDelayMs, videoWidth, videoHeight) { switched ->
|
||||
core.setVideoFrameRate(fps, duration, extraDelayMs, videoWidth, videoHeight, matchResolution) { switched ->
|
||||
result.success(switched)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* Pure display-mode selection policy for content-adaptive display switching.
|
||||
* Extracted from [FrameRateManager] so the policy is unit-testable on the
|
||||
* JVM, where android.view.Display.Mode cannot be instantiated.
|
||||
*/
|
||||
object DisplayModeSelector {
|
||||
const val RATE_TOLERANCE = 0.1f
|
||||
|
||||
/** JVM-testable mirror of android.view.Display.Mode. */
|
||||
data class ModeInfo(val modeId: Int, val width: Int, val height: Int, val refreshRate: Float) {
|
||||
val area: Long get() = width.toLong() * height
|
||||
}
|
||||
|
||||
data class RefreshRateMatch(val reason: String, val priority: Int, val error: Float)
|
||||
|
||||
data class Selection(val mode: ModeInfo, val reason: String)
|
||||
|
||||
private data class Candidate(val mode: ModeInfo, val match: RefreshRateMatch)
|
||||
|
||||
/** How well [refreshRate] presents [fps] content: exact, an integer multiple, or not at all. */
|
||||
fun matchRefreshRate(refreshRate: Float, fps: Float): RefreshRateMatch? {
|
||||
if (refreshRate <= 0f || fps <= 0f) return null
|
||||
|
||||
val exactError = abs(refreshRate - fps)
|
||||
if (exactError < RATE_TOLERANCE) {
|
||||
return RefreshRateMatch(reason = "exact", priority = 0, error = exactError)
|
||||
}
|
||||
|
||||
val multiple = (refreshRate / fps).roundToInt()
|
||||
if (multiple > 1) {
|
||||
val multipleError = abs(refreshRate - (fps * multiple))
|
||||
if (multipleError < RATE_TOLERANCE) {
|
||||
return RefreshRateMatch(reason = "${multiple}x", priority = 1, error = multipleError)
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Pick the display mode for the video, or null when no switch target exists.
|
||||
* The caller compares the result against the current mode to decide whether
|
||||
* an actual switch is needed.
|
||||
*
|
||||
* With [matchResolution] and known video dimensions, resolution wins over
|
||||
* cadence: the target is the smallest mode that still contains the video
|
||||
* (never downscaling it), rate-matched within that resolution when [fps] is
|
||||
* known. Otherwise the cadence-only policy applies and requires [fps] > 0.
|
||||
*/
|
||||
fun findBestMode(
|
||||
fps: Float,
|
||||
currentMode: ModeInfo,
|
||||
supportedModes: List<ModeInfo>,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int,
|
||||
matchResolution: Boolean
|
||||
): Selection? {
|
||||
if (matchResolution && videoWidth > 0 && videoHeight > 0) {
|
||||
resolutionMatch(fps, currentMode, supportedModes, videoWidth, videoHeight)?.let { return it }
|
||||
// No mode can contain the video (source larger than the panel):
|
||||
// fall back to the cadence-only policy below.
|
||||
}
|
||||
return cadenceMatch(fps, currentMode, supportedModes, videoWidth, videoHeight)
|
||||
}
|
||||
|
||||
private fun resolutionMatch(
|
||||
fps: Float,
|
||||
currentMode: ModeInfo,
|
||||
supportedModes: List<ModeInfo>,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int
|
||||
): Selection? {
|
||||
val candidates = supportedModes.filter { it.width >= videoWidth && it.height >= videoHeight }
|
||||
if (candidates.isEmpty()) return null
|
||||
|
||||
// Native target: the smallest resolution that still contains the video,
|
||||
// so the display (not the device) performs the upscale.
|
||||
val targetArea = candidates.minOf { it.area }
|
||||
val bucket = candidates.filter { it.area == targetArea }
|
||||
|
||||
// Rate-match within the target resolution when requested. Resolution
|
||||
// wins over cadence: a missing rate match here deliberately does not
|
||||
// widen back out to other resolutions.
|
||||
if (fps > 0f) {
|
||||
bucket
|
||||
.mapNotNull { mode -> matchRefreshRate(mode.refreshRate, fps)?.let { Candidate(mode, it) } }
|
||||
.minWithOrNull(
|
||||
compareBy<Candidate> { it.match.priority }
|
||||
.thenBy { it.match.error }
|
||||
.thenBy { abs(it.mode.refreshRate - currentMode.refreshRate) }
|
||||
)
|
||||
?.let { return Selection(it.mode, "resolution + ${it.match.reason} rate, error=${it.match.error}") }
|
||||
}
|
||||
|
||||
// Resolution-only request, or no cadence match at the target resolution:
|
||||
// stay as close to the current refresh rate as possible so the switch
|
||||
// renegotiates only what it has to.
|
||||
val fallback = bucket.minWithOrNull(
|
||||
compareBy<ModeInfo> { abs(it.refreshRate - currentMode.refreshRate) }.thenByDescending { it.refreshRate }
|
||||
)
|
||||
return fallback?.let { Selection(it, "resolution only") }
|
||||
}
|
||||
|
||||
private fun cadenceMatch(
|
||||
fps: Float,
|
||||
currentMode: ModeInfo,
|
||||
supportedModes: List<ModeInfo>,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int
|
||||
): Selection? {
|
||||
// Tier 1 — a matching-refresh mode at the CURRENT resolution: a refresh-only
|
||||
// switch, the least disruptive (no resolution/HDMI renegotiation).
|
||||
supportedModes.asSequence()
|
||||
.filter { it.width == currentMode.width && it.height == currentMode.height }
|
||||
.mapNotNull { mode -> matchRefreshRate(mode.refreshRate, fps)?.let { Candidate(mode, it) } }
|
||||
.minWithOrNull(
|
||||
compareBy<Candidate> { it.match.priority }
|
||||
.thenBy { it.match.error }
|
||||
.thenBy { abs(it.mode.refreshRate - currentMode.refreshRate) }
|
||||
)
|
||||
?.let { return Selection(it.mode, "${it.match.reason}, error=${it.match.error}") }
|
||||
|
||||
// Tier 2 — no same-resolution match (e.g. a 4K panel with no 4K@24 mode, but a
|
||||
// 1080p@23.976 mode for 1080p content). Allow a resolution change, but never one
|
||||
// that downscales the video below its native size (trading detail for cadence).
|
||||
// Requires known video dimensions; without them keep Tier-1-only behaviour.
|
||||
if (videoWidth <= 0 || videoHeight <= 0) return null
|
||||
return supportedModes.asSequence()
|
||||
.filter { it.width >= videoWidth && it.height >= videoHeight }
|
||||
.mapNotNull { mode -> matchRefreshRate(mode.refreshRate, fps)?.let { Candidate(mode, it) } }
|
||||
.minWithOrNull(
|
||||
// Prefer the resolution closest to the panel's current one (least change,
|
||||
// keeps panel-native res when a high-res match exists), then refresh match.
|
||||
compareBy<Candidate> { abs(it.mode.area - currentMode.area) }
|
||||
.thenBy { it.match.priority }
|
||||
.thenBy { it.match.error }
|
||||
)
|
||||
?.let { Selection(it.mode, "${it.match.reason}, error=${it.match.error}") }
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,6 @@ import android.util.Log
|
||||
import android.view.Display
|
||||
import android.view.WindowManager
|
||||
import androidx.annotation.RequiresApi
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class FrameRateManager(
|
||||
private val activity: Activity,
|
||||
@@ -21,24 +19,12 @@ class FrameRateManager(
|
||||
private const val TAG = "FrameRateManager"
|
||||
private const val DISPLAY_SETTLE_MS = 2000L
|
||||
private const val WATCHDOG_MARGIN_MS = 3000L
|
||||
private const val RATE_TOLERANCE = 0.1f
|
||||
}
|
||||
|
||||
private data class RefreshRateMatch(
|
||||
val reason: String,
|
||||
val priority: Int,
|
||||
val error: Float
|
||||
)
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private data class DisplayModeCandidate(
|
||||
val mode: Display.Mode,
|
||||
val match: RefreshRateMatch
|
||||
)
|
||||
|
||||
private var currentVideoFps: Float = 0f
|
||||
private var currentVideoWidth: Int = 0
|
||||
private var currentVideoHeight: Int = 0
|
||||
private var currentMatchResolution: Boolean = false
|
||||
private var displayListener: DisplayManager.DisplayListener? = null
|
||||
private var pendingSettleRunnable: Runnable? = null
|
||||
private var watchdogRunnable: Runnable? = null
|
||||
@@ -46,13 +32,17 @@ class FrameRateManager(
|
||||
|
||||
private fun getDisplayManager(): DisplayManager = activity.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
|
||||
|
||||
// Request a display frame-rate switch. Invokes [onComplete] once, either:
|
||||
// - immediately with `switched=false` when no switch is needed (invalid fps,
|
||||
// no matching mode, or already matching); or
|
||||
// Request a display mode switch for the video's frame rate and/or, with
|
||||
// [matchResolution], its native resolution. Invokes [onComplete] once, either:
|
||||
// - immediately with `switched=false` when no switch is needed (no usable
|
||||
// fps/resolution target, no matching mode, or already matching); or
|
||||
// - after the real DisplayListener event + [DISPLAY_SETTLE_MS] + the caller's
|
||||
// [extraDelayMs], with `switched=true`; or
|
||||
// - via a watchdog if the real event never arrives, so the caller doesn't hang.
|
||||
//
|
||||
// fps <= 0 with [matchResolution] requests a resolution-only switch that
|
||||
// keeps the refresh rate as close to the current one as possible.
|
||||
//
|
||||
// The caller is responsible for pausing playback before calling and resuming
|
||||
// it after [onComplete] fires.
|
||||
fun setVideoFrameRate(
|
||||
@@ -61,20 +51,24 @@ class FrameRateManager(
|
||||
extraDelayMs: Long,
|
||||
videoWidth: Int = 0,
|
||||
videoHeight: Int = 0,
|
||||
matchResolution: Boolean = false,
|
||||
onComplete: (switched: Boolean) -> Unit
|
||||
) {
|
||||
currentVideoFps = fps
|
||||
currentVideoWidth = videoWidth
|
||||
currentVideoHeight = videoHeight
|
||||
if (fps <= 0f) {
|
||||
Log.d(TAG, "setVideoFrameRate: Invalid fps ($fps), skipping")
|
||||
currentMatchResolution = matchResolution
|
||||
val hasResolutionTarget = matchResolution && videoWidth > 0 && videoHeight > 0
|
||||
if (fps <= 0f && !hasResolutionTarget) {
|
||||
Log.d(TAG, "setVideoFrameRate: no usable target (fps=$fps, video=${videoWidth}x$videoHeight), skipping")
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
|
||||
log(
|
||||
"request fps=$fps, duration=${videoDurationMs}ms, extraDelayMs=$extraDelayMs, " +
|
||||
"video=${videoWidth}x$videoHeight, API=${Build.VERSION.SDK_INT}, currentMode=${currentModeDescription()}"
|
||||
"video=${videoWidth}x$videoHeight, matchResolution=$matchResolution, " +
|
||||
"API=${Build.VERSION.SDK_INT}, currentMode=${currentModeDescription()}"
|
||||
)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
@@ -129,7 +123,12 @@ class FrameRateManager(
|
||||
cb(switched)
|
||||
}
|
||||
|
||||
private fun registerDisplayListener(fps: Float, extraDelayMs: Long, onComplete: (switched: Boolean) -> Unit) {
|
||||
private fun registerDisplayListener(
|
||||
fps: Float,
|
||||
targetModeId: Int,
|
||||
extraDelayMs: Long,
|
||||
onComplete: (switched: Boolean) -> Unit
|
||||
) {
|
||||
// Resolve any previous pending op before starting a new one.
|
||||
firePendingCompletion("superseded", switched = false)
|
||||
pendingCompletion = onComplete
|
||||
@@ -144,7 +143,9 @@ class FrameRateManager(
|
||||
getDisplayManager().unregisterDisplayListener(this)
|
||||
displayListener = null
|
||||
|
||||
val settle = Runnable { firePendingCompletion("display settled", switched = currentRateMatch(fps) != null) }
|
||||
val settle = Runnable {
|
||||
firePendingCompletion("display settled", switched = currentMatchesRequest(fps, targetModeId))
|
||||
}
|
||||
pendingSettleRunnable = settle
|
||||
handler.postDelayed(settle, DISPLAY_SETTLE_MS + extraDelayMs)
|
||||
}
|
||||
@@ -154,37 +155,20 @@ class FrameRateManager(
|
||||
// Watchdog: if the TV never signals a display change (silently ignoring
|
||||
// the mode request), still complete after a bounded wait so the caller
|
||||
// doesn't hang.
|
||||
val watchdog = Runnable { firePendingCompletion("watchdog", switched = currentRateMatch(fps) != null) }
|
||||
val watchdog = Runnable { firePendingCompletion("watchdog", switched = currentMatchesRequest(fps, targetModeId)) }
|
||||
watchdogRunnable = watchdog
|
||||
handler.postDelayed(watchdog, DISPLAY_SETTLE_MS + extraDelayMs + WATCHDOG_MARGIN_MS)
|
||||
}
|
||||
|
||||
private fun matchRefreshRate(refreshRate: Float, fps: Float): RefreshRateMatch? {
|
||||
if (refreshRate <= 0f || fps <= 0f) return null
|
||||
|
||||
val exactError = abs(refreshRate - fps)
|
||||
if (exactError < RATE_TOLERANCE) {
|
||||
return RefreshRateMatch(reason = "exact", priority = 0, error = exactError)
|
||||
}
|
||||
|
||||
val multiple = (refreshRate / fps).roundToInt()
|
||||
if (multiple > 1) {
|
||||
val multipleError = abs(refreshRate - (fps * multiple))
|
||||
if (multipleError < RATE_TOLERANCE) {
|
||||
return RefreshRateMatch(reason = "${multiple}x", priority = 1, error = multipleError)
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
private fun currentRateMatch(fps: Float): RefreshRateMatch? {
|
||||
val current = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
currentDisplayMode()?.refreshRate
|
||||
} else {
|
||||
null
|
||||
} ?: return null
|
||||
return matchRefreshRate(current, fps)
|
||||
// Whether the display landed on the requested mode: the exact target, or —
|
||||
// for a rate request — any mode whose refresh presents [fps] (a TV may pick
|
||||
// a different-but-equivalent mode). A resolution-only request (fps <= 0)
|
||||
// only counts the exact target.
|
||||
private fun currentMatchesRequest(fps: Float, targetModeId: Int): Boolean {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return false
|
||||
val current = currentDisplayMode() ?: return false
|
||||
if (current.modeId == targetModeId) return true
|
||||
return DisplayModeSelector.matchRefreshRate(current.refreshRate, fps) != null
|
||||
}
|
||||
|
||||
private fun currentModeDescription(): String = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
@@ -214,46 +198,11 @@ class FrameRateManager(
|
||||
private fun describeSupportedModes(modes: Array<Display.Mode>): String = modes.joinToString(prefix = "[", postfix = "]") { describeMode(it) }
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private fun findBestModeMatch(
|
||||
fps: Float,
|
||||
currentMode: Display.Mode,
|
||||
supportedModes: Array<Display.Mode>,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int
|
||||
): DisplayModeCandidate? {
|
||||
// Tier 1 — a matching-refresh mode at the CURRENT resolution: a refresh-only
|
||||
// switch, the least disruptive (no resolution/HDMI renegotiation).
|
||||
supportedModes.asSequence()
|
||||
.filter { it.physicalHeight == currentMode.physicalHeight && it.physicalWidth == currentMode.physicalWidth }
|
||||
.mapNotNull { mode -> matchRefreshRate(mode.refreshRate, fps)?.let { DisplayModeCandidate(mode, it) } }
|
||||
.minWithOrNull(
|
||||
compareBy<DisplayModeCandidate> { it.match.priority }
|
||||
.thenBy { it.match.error }
|
||||
.thenBy { abs(it.mode.refreshRate - currentMode.refreshRate) }
|
||||
)
|
||||
?.let { return it }
|
||||
|
||||
// Tier 2 — no same-resolution match (e.g. a 4K panel with no 4K@24 mode, but a
|
||||
// 1080p@23.976 mode for 1080p content). Allow a resolution change, but never one
|
||||
// that downscales the video below its native size (trading detail for cadence).
|
||||
// Requires known video dimensions; without them keep Tier-1-only behaviour.
|
||||
if (videoWidth <= 0 || videoHeight <= 0) return null
|
||||
val currentArea = currentMode.physicalWidth.toLong() * currentMode.physicalHeight
|
||||
return supportedModes.asSequence()
|
||||
.filter { it.physicalWidth >= videoWidth && it.physicalHeight >= videoHeight }
|
||||
.mapNotNull { mode -> matchRefreshRate(mode.refreshRate, fps)?.let { DisplayModeCandidate(mode, it) } }
|
||||
.minWithOrNull(
|
||||
// Prefer the resolution closest to the panel's current one (least change,
|
||||
// keeps panel-native res when a high-res match exists), then refresh match.
|
||||
compareBy<DisplayModeCandidate> { abs(it.mode.physicalWidth.toLong() * it.mode.physicalHeight - currentArea) }
|
||||
.thenBy { it.match.priority }
|
||||
.thenBy { it.match.error }
|
||||
)
|
||||
}
|
||||
private fun Display.Mode.toModeInfo(): DisplayModeSelector.ModeInfo = DisplayModeSelector.ModeInfo(modeId, physicalWidth, physicalHeight, refreshRate)
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private fun setDisplayMode(fps: Float, extraDelayMs: Long, onComplete: (switched: Boolean) -> Unit) {
|
||||
log("setDisplayMode fps=$fps")
|
||||
log("setDisplayMode fps=$fps, matchResolution=$currentMatchResolution")
|
||||
val display = currentDisplay()
|
||||
if (display == null) {
|
||||
log("display unavailable")
|
||||
@@ -270,34 +219,43 @@ class FrameRateManager(
|
||||
val currentMode = display.mode
|
||||
log("supported modes=${describeSupportedModes(supportedModes)}")
|
||||
|
||||
val modeMatch = findBestModeMatch(fps, currentMode, supportedModes, currentVideoWidth, currentVideoHeight)
|
||||
if (modeMatch == null) {
|
||||
val selection = DisplayModeSelector.findBestMode(
|
||||
fps,
|
||||
currentMode.toModeInfo(),
|
||||
supportedModes.map { it.toModeInfo() },
|
||||
currentVideoWidth,
|
||||
currentVideoHeight,
|
||||
currentMatchResolution
|
||||
)
|
||||
if (selection == null) {
|
||||
log(
|
||||
"no matching display mode for ${fps}fps at ${currentMode.physicalWidth}x${currentMode.physicalHeight} " +
|
||||
"(video=${currentVideoWidth}x$currentVideoHeight)"
|
||||
"(video=${currentVideoWidth}x$currentVideoHeight, matchResolution=$currentMatchResolution)"
|
||||
)
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
|
||||
val modeToUse = modeMatch.mode
|
||||
val modeToUse = supportedModes.firstOrNull { it.modeId == selection.mode.modeId }
|
||||
if (modeToUse == null) {
|
||||
log("selected mode #${selection.mode.modeId} disappeared from supported modes")
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
if (modeToUse.modeId == currentMode.modeId) {
|
||||
log("current mode already matches ${fps}fps (${modeMatch.match.reason}), no switch needed")
|
||||
log("current mode already matches ${fps}fps (${selection.reason}), no switch needed")
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
|
||||
log(
|
||||
"switching to ${describeMode(modeToUse)} for ${fps}fps " +
|
||||
"(${modeMatch.match.reason}, error=${modeMatch.match.error})"
|
||||
)
|
||||
log("switching to ${describeMode(modeToUse)} for ${fps}fps (${selection.reason})")
|
||||
val window = activity.window
|
||||
if (window == null) {
|
||||
log("window unavailable")
|
||||
onComplete(false)
|
||||
return
|
||||
}
|
||||
registerDisplayListener(fps, extraDelayMs, onComplete)
|
||||
registerDisplayListener(fps, modeToUse.modeId, extraDelayMs, onComplete)
|
||||
window.attributes = window.attributes.apply { preferredDisplayModeId = modeToUse.modeId }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ interface SurfacePlayerCore {
|
||||
extraDelayMs: Long,
|
||||
videoWidth: Int,
|
||||
videoHeight: Int,
|
||||
matchResolution: Boolean,
|
||||
onComplete: (switched: Boolean) -> Unit
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class DoviCodecsTest {
|
||||
@Test
|
||||
fun hevcProfilesUseDvhePrefix() {
|
||||
// Profile 8 level 6 is the stream from #2096: the record's dv_profile and
|
||||
// dv_level bytes must surface verbatim, matching media3's
|
||||
// DolbyVisionConfig output for the same file (dvhe.08.06).
|
||||
assertEquals("dvhe.08.06", DoviCodecs.rfc6381(8, 6))
|
||||
assertEquals("dvhe.04.09", DoviCodecs.rfc6381(4, 9))
|
||||
assertEquals("dvhe.05.06", DoviCodecs.rfc6381(5, 6))
|
||||
// Profile 7 keys DoviConvertingTrackOutput's P7 conversion.
|
||||
assertEquals("dvhe.07.06", DoviCodecs.rfc6381(7, 6))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun avcAndAv1ProfilesUseTheirOwnPrefixes() {
|
||||
assertEquals("dvav.09.05", DoviCodecs.rfc6381(9, 5))
|
||||
assertEquals("dav1.10.04", DoviCodecs.rfc6381(10, 4))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun twoDigitLevelsAreNotZeroPadded() {
|
||||
assertEquals("dvhe.08.10", DoviCodecs.rfc6381(8, 10))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun unrecognizedProfilesReturnNullSoTheBaseCodecFormatSurvives() {
|
||||
// Media3's DolbyVisionConfig table: anything it rejects must keep the
|
||||
// track's plain HEVC/AVC format instead of publishing an unplayable
|
||||
// video/dolby-vision variant.
|
||||
assertNull(DoviCodecs.rfc6381(0, 6))
|
||||
assertNull(DoviCodecs.rfc6381(2, 6))
|
||||
assertNull(DoviCodecs.rfc6381(6, 6))
|
||||
assertNull(DoviCodecs.rfc6381(20, 6))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.ParserException
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Spec for the per-codec initializationData shapes the ffmpeg demuxer must
|
||||
* publish so MediaCodec csd-0/1/2 and FfmpegAudioDecoder's extradata
|
||||
* reconstruction both see what media3's own extractors emit. Regression
|
||||
* coverage for #2088: Opus with a bare OpusHead csd made Android's decoders
|
||||
* eat the first two real packets as configuration and discard all output.
|
||||
*/
|
||||
class FfmpegAudioCsdTest {
|
||||
|
||||
private fun opusHead(preSkip: Int): ByteArray {
|
||||
val header = ByteArray(19)
|
||||
"OpusHead".toByteArray(Charsets.US_ASCII).copyInto(header)
|
||||
header[8] = 1 // version
|
||||
header[9] = 2 // channel count
|
||||
header[10] = (preSkip and 0xFF).toByte()
|
||||
header[11] = (preSkip ushr 8).toByte()
|
||||
return header
|
||||
}
|
||||
|
||||
private fun nativeOrderLong(bytes: ByteArray): Long = ByteBuffer.wrap(bytes).order(ByteOrder.nativeOrder()).long
|
||||
|
||||
@Test
|
||||
fun opusBuildsThreeCsdBuffers() {
|
||||
val header = opusHead(preSkip = 312)
|
||||
val csd = FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_OPUS, header)
|
||||
assertEquals(3, csd.size)
|
||||
assertArrayEquals(header, csd[0])
|
||||
// Pre-skip converted to nanoseconds at the Opus 48 kHz clock.
|
||||
assertEquals(312L * 1_000_000_000L / 48_000L, nativeOrderLong(csd[1]))
|
||||
// media3's default seek pre-roll: 3840 samples = 80 ms.
|
||||
assertEquals(80_000_000L, nativeOrderLong(csd[2]))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun opusRejectsTruncatedHeader() {
|
||||
assertThrows(ParserException::class.java) {
|
||||
FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_OPUS, ByteArray(11))
|
||||
}
|
||||
}
|
||||
|
||||
private fun xiphLace(length: Int): ByteArray {
|
||||
val bytes = ArrayList<Byte>()
|
||||
var remaining = length
|
||||
while (remaining >= 0xFF) {
|
||||
bytes.add(0xFF.toByte())
|
||||
remaining -= 0xFF
|
||||
}
|
||||
bytes.add(remaining.toByte())
|
||||
return bytes.toByteArray()
|
||||
}
|
||||
|
||||
private fun vorbisHeader(type: Int, payloadLength: Int): ByteArray = byteArrayOf(type.toByte()) + "vorbis".toByteArray(Charsets.US_ASCII) + ByteArray(payloadLength)
|
||||
|
||||
@Test
|
||||
fun vorbisSplitsLacedHeadersIntoIdentificationAndSetup() {
|
||||
val id = vorbisHeader(0x01, payloadLength = 23) // 30 bytes, the real identification header size
|
||||
val comment = vorbisHeader(0x03, payloadLength = 300) // > 255 exercises the 0xFF lacing
|
||||
val setup = vorbisHeader(0x05, payloadLength = 40)
|
||||
val extradata = byteArrayOf(0x02) + xiphLace(id.size) + xiphLace(comment.size) + id + comment + setup
|
||||
|
||||
val csd = FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_VORBIS, extradata)
|
||||
|
||||
assertEquals(2, csd.size)
|
||||
assertArrayEquals(id, csd[0])
|
||||
assertArrayEquals(setup, csd[1])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun vorbisRejectsNonLacedExtradata() {
|
||||
assertThrows(ParserException::class.java) {
|
||||
FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_VORBIS, byteArrayOf(0x01, 0x02, 0x03))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun vorbisRejectsTruncatedExtradata() {
|
||||
val id = vorbisHeader(0x01, payloadLength = 23)
|
||||
val truncated = byteArrayOf(0x02) + xiphLace(id.size) + xiphLace(64) + id // headers end early
|
||||
assertThrows(ParserException::class.java) {
|
||||
FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_VORBIS, truncated)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun flacWrapsBareStreamInfoInMarkedStream() {
|
||||
val streamInfo = ByteArray(34) { it.toByte() }
|
||||
val csd = FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_FLAC, streamInfo)
|
||||
assertEquals(1, csd.size)
|
||||
assertArrayEquals(
|
||||
"fLaC".toByteArray(Charsets.US_ASCII) + byteArrayOf(0x80.toByte(), 0x00, 0x00, 34) + streamInfo,
|
||||
csd[0]
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun flacPrependsMarkerToBlockHeadedStreamInfo() {
|
||||
val block = byteArrayOf(0x00, 0x00, 0x00, 34) + ByteArray(34) { it.toByte() }
|
||||
val csd = FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_FLAC, block)
|
||||
assertEquals(1, csd.size)
|
||||
assertArrayEquals("fLaC".toByteArray(Charsets.US_ASCII) + block, csd[0])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun flacKeepsMarkedStreamVerbatim() {
|
||||
val marked = "fLaC".toByteArray(Charsets.US_ASCII) + byteArrayOf(0x80.toByte(), 0x00, 0x00, 34) + ByteArray(34)
|
||||
val csd = FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_FLAC, marked)
|
||||
assertEquals(1, csd.size)
|
||||
assertSame(marked, csd[0])
|
||||
}
|
||||
|
||||
@Test
|
||||
fun flacRejectsUnrecognizedExtradata() {
|
||||
assertThrows(ParserException::class.java) {
|
||||
FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_FLAC, ByteArray(10))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun otherCodecsPassExtradataThroughAsSingleEntry() {
|
||||
val asc = byteArrayOf(0x12, 0x10) // AAC-LC 44.1 kHz stereo AudioSpecificConfig
|
||||
val csd = FfmpegAudioCsd.initializationData(MimeTypes.AUDIO_AAC, asc)
|
||||
assertEquals(1, csd.size)
|
||||
assertSame(asc, csd[0])
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class FfmpegDemuxerPolicyTest {
|
||||
@Test
|
||||
fun wireValuesRoundTrip() {
|
||||
assertEquals(FfmpegDemuxerPolicy.Preference.FFMPEG, FfmpegDemuxerPolicy.fromWire("ffmpeg"))
|
||||
assertEquals(FfmpegDemuxerPolicy.Preference.MEDIA3_ONLY, FfmpegDemuxerPolicy.fromWire("media3"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun unknownWireValuesResolveToFfmpeg() {
|
||||
assertEquals(FfmpegDemuxerPolicy.Preference.FFMPEG, FfmpegDemuxerPolicy.fromWire(null))
|
||||
assertEquals(FfmpegDemuxerPolicy.Preference.FFMPEG, FfmpegDemuxerPolicy.fromWire(""))
|
||||
assertEquals(FfmpegDemuxerPolicy.Preference.FFMPEG, FfmpegDemuxerPolicy.fromWire("bogus"))
|
||||
// Retired wire value from the container-list era maps to the default.
|
||||
assertEquals(FfmpegDemuxerPolicy.Preference.FFMPEG, FfmpegDemuxerPolicy.fromWire("auto"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ffmpegDemuxesByDefaultAndMedia3OnlyDisables() {
|
||||
assertTrue(FfmpegDemuxerPolicy.enabled(FfmpegDemuxerPolicy.Preference.FFMPEG))
|
||||
assertFalse(FfmpegDemuxerPolicy.enabled(FfmpegDemuxerPolicy.Preference.MEDIA3_ONLY))
|
||||
}
|
||||
}
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.datasource.DataSource
|
||||
import androidx.media3.datasource.DataSpec
|
||||
import androidx.media3.datasource.TransferListener
|
||||
import java.io.IOException
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
|
||||
/**
|
||||
* The demuxer's correctness now rests on this source answering any absolute
|
||||
* position, so these pin the contract libavformat depends on: a read lands on
|
||||
* the requested byte, a backward jump reopens rather than returning the wrong
|
||||
* bytes, and sequential reads do not reopen (which would turn steady-state
|
||||
* playback into one request per 64 KB).
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class FfmpegRandomAccessSourceTest {
|
||||
|
||||
private val content = ByteArray(4096) { (it % 251).toByte() }
|
||||
private val uri: Uri = Uri.parse("https://example.test/movie.mkv")
|
||||
|
||||
private class FakeDataSource(private val content: ByteArray) : DataSource {
|
||||
var openedAt: Long = -1
|
||||
var closed = false
|
||||
private var position = 0
|
||||
|
||||
override fun open(dataSpec: DataSpec): Long {
|
||||
openedAt = dataSpec.position
|
||||
position = dataSpec.position.toInt()
|
||||
return (content.size - position).toLong()
|
||||
}
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
if (position >= content.size) return C.RESULT_END_OF_INPUT
|
||||
val count = minOf(length, content.size - position)
|
||||
content.copyInto(buffer, offset, position, position + count)
|
||||
position += count
|
||||
return count
|
||||
}
|
||||
|
||||
override fun addTransferListener(transferListener: TransferListener) = Unit
|
||||
|
||||
override fun getUri(): Uri? = null
|
||||
|
||||
override fun getResponseHeaders(): Map<String, List<String>> = emptyMap()
|
||||
|
||||
override fun close() {
|
||||
closed = true
|
||||
}
|
||||
}
|
||||
|
||||
private inner class FakeFactory : DataSource.Factory {
|
||||
val created = mutableListOf<FakeDataSource>()
|
||||
|
||||
override fun createDataSource(): DataSource = FakeDataSource(content).also { created.add(it) }
|
||||
}
|
||||
|
||||
private fun sourceFor(factory: DataSource.Factory, spec: DataSpec? = DataSpec(uri)) = FfmpegRandomAccessSource(factory) { spec }
|
||||
|
||||
@Test
|
||||
fun readsLandOnTheRequestedAbsolutePosition() {
|
||||
val factory = FakeFactory()
|
||||
val source = sourceFor(factory)
|
||||
val buffer = ByteArray(16)
|
||||
|
||||
assertEquals(16, source.readAt(1000, buffer, 16))
|
||||
|
||||
assertArrayEquals(content.copyOfRange(1000, 1016), buffer)
|
||||
assertEquals(1000L, factory.created.single().openedAt)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sequentialReadsReuseOneHandle() {
|
||||
val factory = FakeFactory()
|
||||
val source = sourceFor(factory)
|
||||
val buffer = ByteArray(64)
|
||||
|
||||
source.readAt(0, buffer, 64)
|
||||
source.readAt(64, buffer, 64)
|
||||
source.readAt(128, buffer, 64)
|
||||
|
||||
assertEquals(1, source.openCount)
|
||||
assertArrayEquals(content.copyOfRange(128, 192), buffer)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun backwardJumpReopensAndReturnsTheRequestedBytes() {
|
||||
val factory = FakeFactory()
|
||||
val source = sourceFor(factory)
|
||||
val buffer = ByteArray(32)
|
||||
|
||||
source.readAt(2048, buffer, 32)
|
||||
// The jump libavformat makes for an index at the end of the file, then back.
|
||||
assertEquals(32, source.readAt(16, buffer, 32))
|
||||
|
||||
assertArrayEquals(content.copyOfRange(16, 48), buffer)
|
||||
assertEquals(2, source.openCount)
|
||||
assertTrue("abandoned handle must be closed", factory.created.first().closed)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun endOfInputReportsZeroWithoutAdvancing() {
|
||||
val factory = FakeFactory()
|
||||
val source = sourceFor(factory)
|
||||
val buffer = ByteArray(8)
|
||||
|
||||
assertEquals(0, source.readAt(content.size.toLong(), buffer, 8))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun lengthResolvesFromAnOpenAndStaysKnown() {
|
||||
val factory = FakeFactory()
|
||||
val source = sourceFor(factory)
|
||||
|
||||
assertEquals(C.LENGTH_UNSET.toLong(), source.length())
|
||||
source.readAt(512, ByteArray(8), 8)
|
||||
|
||||
assertEquals(content.size.toLong(), source.length())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun clonedSpecKeepsCacheKeyAndFlagsButTakesOurPosition() {
|
||||
val recorded = DataSpec.Builder()
|
||||
.setUri(uri)
|
||||
.setPosition(9999)
|
||||
.setLength(1234)
|
||||
.setKey("download-cache-key")
|
||||
.setFlags(DataSpec.FLAG_ALLOW_CACHE_FRAGMENTATION)
|
||||
.setHttpRequestHeaders(mapOf("X-Test" to "1"))
|
||||
.build()
|
||||
var openedSpec: DataSpec? = null
|
||||
val factory = DataSource.Factory {
|
||||
object : DataSource {
|
||||
override fun open(dataSpec: DataSpec): Long {
|
||||
openedSpec = dataSpec
|
||||
return C.LENGTH_UNSET.toLong()
|
||||
}
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int = C.RESULT_END_OF_INPUT
|
||||
|
||||
override fun addTransferListener(transferListener: TransferListener) = Unit
|
||||
|
||||
override fun getUri(): Uri? = null
|
||||
|
||||
override fun getResponseHeaders(): Map<String, List<String>> = emptyMap()
|
||||
|
||||
override fun close() = Unit
|
||||
}
|
||||
}
|
||||
|
||||
sourceFor(factory, recorded).readAt(4242, ByteArray(4), 4)
|
||||
|
||||
val spec = requireNotNull(openedSpec)
|
||||
assertEquals(4242L, spec.position)
|
||||
assertEquals(C.LENGTH_UNSET.toLong(), spec.length)
|
||||
assertEquals("download-cache-key", spec.key)
|
||||
assertEquals(DataSpec.FLAG_ALLOW_CACHE_FRAGMENTATION, spec.flags)
|
||||
assertEquals("1", spec.httpRequestHeaders["X-Test"])
|
||||
assertEquals(uri, spec.uri)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun readWithoutARecordedSpecFails() {
|
||||
val source = sourceFor(FakeFactory(), spec = null)
|
||||
|
||||
assertThrows(IOException::class.java) { source.readAt(0, ByteArray(4), 4) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun closeReleasesTheHandle() {
|
||||
val factory = FakeFactory()
|
||||
val source = sourceFor(factory)
|
||||
source.readAt(0, ByteArray(4), 4)
|
||||
|
||||
assertTrue(source.isOpen)
|
||||
source.close()
|
||||
|
||||
assertFalse(source.isOpen)
|
||||
assertTrue(factory.created.single().closed)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun recordingFactoryReportsTheSpecMedia3OpenedPerUri() {
|
||||
val delegate = FakeFactory()
|
||||
val recorder = RecordingDataSourceFactory(delegate)
|
||||
val other = Uri.parse("https://example.test/next-episode.mkv")
|
||||
|
||||
assertNull(recorder.specFor(uri))
|
||||
recorder.createDataSource().open(DataSpec.Builder().setUri(uri).setPosition(64).setKey("a").build())
|
||||
recorder.createDataSource().open(DataSpec.Builder().setUri(other).setPosition(128).build())
|
||||
|
||||
// Preloading the next item must not redirect the current demuxer's reads.
|
||||
assertEquals(64L, recorder.specFor(uri)?.position)
|
||||
assertEquals("a", recorder.specFor(uri)?.key)
|
||||
assertEquals(128L, recorder.specFor(other)?.position)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun recordingFactoryDelegatesReads() {
|
||||
val delegate = FakeFactory()
|
||||
val recorder = RecordingDataSourceFactory(delegate)
|
||||
val buffer = ByteArray(16)
|
||||
|
||||
val dataSource = recorder.createDataSource()
|
||||
dataSource.open(DataSpec.Builder().setUri(uri).setPosition(32).build())
|
||||
assertEquals(16, dataSource.read(buffer, 0, 16))
|
||||
|
||||
assertArrayEquals(content.copyOfRange(32, 48), buffer)
|
||||
assertSame(delegate.created.single(), delegate.created.first())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Byte-exact spec for the media3-shaped subtitle sample prefixes. The shapes
|
||||
* mirror media3 1.11.0 MatroskaExtractor's SSA_PREFIX/SUBRIP_PREFIX/VTT_PREFIX
|
||||
* with the duration patched into the second timecode; SsaParser,
|
||||
* SubripParser, WebvttParser, and AssTrackOutput all parse these exact bytes.
|
||||
*/
|
||||
class FfmpegSubtitleSamplesTest {
|
||||
|
||||
private fun string(bytes: ByteArray): String = bytes.toString(Charsets.UTF_8)
|
||||
|
||||
@Test
|
||||
fun ssaPrefixMatchesMatroskaExtractorShape() {
|
||||
// 1h 2m 3s 450ms -> centiseconds, ':' separator, single-digit hour.
|
||||
assertEquals(
|
||||
"Dialogue: 0:00:00:00,1:02:03:45,",
|
||||
string(FfmpegSubtitleSamples.ssaPrefix(3_723_450_000L))
|
||||
)
|
||||
assertEquals("Dialogue: 0:00:00:00,0:00:05:00,", string(FfmpegSubtitleSamples.ssaPrefix(5_000_000L)))
|
||||
// Sub-centisecond remainders truncate, matching integer division.
|
||||
assertEquals("Dialogue: 0:00:00:00,0:00:00:99,", string(FfmpegSubtitleSamples.ssaPrefix(999_999L)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun subripPrefixIsACompleteCueHeader() {
|
||||
assertEquals(
|
||||
"1\n00:00:00,000 --> 01:02:03,450\n",
|
||||
string(FfmpegSubtitleSamples.subripPrefix(3_723_450_000L))
|
||||
)
|
||||
assertEquals("1\n00:00:00,000 --> 00:00:05,000\n", string(FfmpegSubtitleSamples.subripPrefix(5_000_000L)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun vttPrefixIsAOneCueDocumentHeader() {
|
||||
assertEquals(
|
||||
"WEBVTT\n\n00:00:00.000 --> 01:02:03.450\n",
|
||||
string(FfmpegSubtitleSamples.vttPrefix(3_723_450_000L))
|
||||
)
|
||||
assertEquals("WEBVTT\n\n00:00:00.000 --> 00:00:05.000\n", string(FfmpegSubtitleSamples.vttPrefix(5_000_000L)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ssaDialogueFormatMatchesMedia3Constant() {
|
||||
assertEquals(
|
||||
"Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text",
|
||||
string(FfmpegSubtitleSamples.SSA_DIALOGUE_FORMAT)
|
||||
)
|
||||
}
|
||||
}
|
||||
+33
-82
@@ -5,14 +5,7 @@ import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.parser.AssSubtitleParserFactory
|
||||
import java.io.EOFException
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
@@ -24,16 +17,17 @@ import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
/**
|
||||
* Extracts the committed fixture (1s 440Hz sine, AAC-LC 48kHz stereo, LATM/LOAS
|
||||
* muxed into MKV as A_MS/ACM tag 0x1602) and verifies direct Matroska playback
|
||||
* unwraps LOAS frames to raw AAC with a synthesized AudioSpecificConfig.
|
||||
* Drives LatmTrackOutput with LOAS frames from the committed fixture (1s 440Hz
|
||||
* sine, AAC-LC 48kHz stereo, LATM/LOAS) and verifies it unwraps them to raw
|
||||
* AAC with a synthesized AudioSpecificConfig. Both demuxer paths deliver LOAS
|
||||
* this way: the FFmpeg extractor wraps aac_latm tracks directly.
|
||||
*
|
||||
* Robolectric provides real android.util.* implementations — MatroskaExtractor
|
||||
* stores tracks in a SparseArray, which is a no-op stub on plain JVM.
|
||||
* Robolectric provides real android.util.* implementations for media3's
|
||||
* internals.
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class MatroskaLatmSupportTest {
|
||||
class LatmTrackOutputTest {
|
||||
|
||||
private class CapturedSample(val timeUs: Long, val flags: Int, val data: ByteArray)
|
||||
|
||||
@@ -71,14 +65,6 @@ class MatroskaLatmSupportTest {
|
||||
}
|
||||
}
|
||||
|
||||
private class FakeExtractorOutput : ExtractorOutput {
|
||||
val tracks = mutableMapOf<Int, FakeTrackOutput>()
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput = tracks.getOrPut(id) { FakeTrackOutput() }
|
||||
override fun endTracks() {}
|
||||
override fun seekMap(seekMap: SeekMap) {}
|
||||
}
|
||||
|
||||
private class ByteArrayDataReader(private val data: ByteArray) : DataReader {
|
||||
var position = 0L
|
||||
|
||||
@@ -118,76 +104,46 @@ class MatroskaLatmSupportTest {
|
||||
return frames
|
||||
}
|
||||
|
||||
private fun extractFixture(): FakeExtractorOutput {
|
||||
val data = fixtureData()
|
||||
|
||||
val assHandler = AssHandler()
|
||||
val extractor = ZlibMatroskaExtractor(AssSubtitleParserFactory(assHandler), assHandler)
|
||||
val output = FakeExtractorOutput()
|
||||
extractor.init(output)
|
||||
|
||||
val reader = ByteArrayDataReader(data)
|
||||
var input = DefaultExtractorInput(reader, 0, data.size.toLong())
|
||||
val seekPosition = PositionHolder()
|
||||
while (true) {
|
||||
when (extractor.read(input, seekPosition)) {
|
||||
Extractor.RESULT_END_OF_INPUT -> return output
|
||||
Extractor.RESULT_SEEK -> {
|
||||
reader.position = seekPosition.position
|
||||
input = DefaultExtractorInput(reader, seekPosition.position, data.size.toLong())
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun placeholderFormat(): Format = Format.Builder()
|
||||
.setId("1")
|
||||
.setSampleMimeType(MimeTypes.AUDIO_AAC)
|
||||
.setLabel("LATM track")
|
||||
.setLanguage("eng")
|
||||
.build()
|
||||
|
||||
@Test
|
||||
fun unwrapsLoasAcmTrackToRawAac() {
|
||||
val output = extractFixture()
|
||||
fun unwrapsLoasFramesToRawAac() {
|
||||
val delegate = FakeTrackOutput()
|
||||
val output = LatmTrackOutput(delegate, 1)
|
||||
output.format(placeholderFormat())
|
||||
|
||||
assertEquals(1, output.tracks.size)
|
||||
val track = output.tracks.values.first()
|
||||
val frames = loasFrames(40)
|
||||
var timeUs = 0L
|
||||
for (frame in frames) {
|
||||
output.sampleData(ParsableByteArray(frame), frame.size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(timeUs, C.BUFFER_FLAG_KEY_FRAME, frame.size, 0, null)
|
||||
timeUs += 21_333
|
||||
}
|
||||
|
||||
// No audio/x-unknown format may reach the queue; the LATM-derived AAC
|
||||
// format must carry the AudioSpecificConfig for MediaCodec.
|
||||
assertFalse(track.formats.any { it.sampleMimeType == MimeTypes.AUDIO_UNKNOWN })
|
||||
val format = track.formats.last()
|
||||
// The placeholder format must be swallowed; the LATM-derived AAC format
|
||||
// carries the AudioSpecificConfig and the original track metadata.
|
||||
val format = delegate.formats.last()
|
||||
assertEquals(MimeTypes.AUDIO_AAC, format.sampleMimeType)
|
||||
assertEquals(48000, format.sampleRate)
|
||||
assertEquals(2, format.channelCount)
|
||||
assertEquals("1", format.id)
|
||||
assertEquals("LATM track", format.label)
|
||||
assertTrue(format.initializationData.isNotEmpty())
|
||||
assertTrue(format.initializationData[0].isNotEmpty())
|
||||
|
||||
// 1s at 48kHz / 1024 samples per AAC frame ≈ 47 frames
|
||||
assertTrue("expected ~47 samples, got ${track.samples.size}", track.samples.size in 40..55)
|
||||
|
||||
// Raw AAC payloads: smaller than the LOAS wrapping, no LOAS syncword,
|
||||
// keyframe-flagged, monotonic timestamps spanning ~1s.
|
||||
var prevTimeUs = Long.MIN_VALUE
|
||||
for (sample in track.samples) {
|
||||
assertTrue("expected ~40 samples, got ${delegate.samples.size}", delegate.samples.size in 35..40)
|
||||
for (sample in delegate.samples) {
|
||||
assertTrue(sample.data.isNotEmpty())
|
||||
val isLoasSync = sample.data.size >= 2 &&
|
||||
(sample.data[0].toInt() and 0xFF) == 0x56 &&
|
||||
(sample.data[1].toInt() and 0xE0) == 0xE0
|
||||
assertFalse("sample still LOAS-framed", isLoasSync)
|
||||
assertEquals(C.BUFFER_FLAG_KEY_FRAME, sample.flags and C.BUFFER_FLAG_KEY_FRAME)
|
||||
assertTrue(sample.timeUs >= prevTimeUs)
|
||||
prevTimeUs = sample.timeUs
|
||||
}
|
||||
val spanUs = track.samples.last().timeUs - track.samples.first().timeUs
|
||||
assertTrue("expected ~1s span, got ${spanUs}us", spanUs in 800_000..1_200_000)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun detectsLoasAcmCodecPrivate() {
|
||||
val loas = byteArrayOf(0x02, 0x16, 0, 0, 0, 0)
|
||||
assertTrue(isLoasAcmTrack("A_MS/ACM", loas))
|
||||
// Wrong tag (PCM), wrong codec, or missing private data must not match
|
||||
assertFalse(isLoasAcmTrack("A_MS/ACM", byteArrayOf(0x01, 0x00, 0, 0)))
|
||||
assertFalse(isLoasAcmTrack("A_AAC", loas))
|
||||
assertFalse(isLoasAcmTrack("A_MS/ACM", null))
|
||||
assertFalse(isLoasAcmTrack("A_MS/ACM", byteArrayOf(0x02)))
|
||||
assertFalse(isLoasAcmTrack(null, loas))
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -205,19 +161,14 @@ class MatroskaLatmSupportTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun preservesStreamMuxConfigAcrossExtractorSeek() {
|
||||
fun preservesStreamMuxConfigAcrossReset() {
|
||||
val frames = loasFrames(2)
|
||||
assertEquals(0, frames[0][3].toInt() and 0x80)
|
||||
assertEquals(0x80, frames[1][3].toInt() and 0x80)
|
||||
|
||||
val delegate = FakeTrackOutput()
|
||||
val output = LatmTrackOutput(delegate, 1)
|
||||
output.format(
|
||||
Format.Builder()
|
||||
.setId("1")
|
||||
.setSampleMimeType(MimeTypes.AUDIO_UNKNOWN)
|
||||
.build()
|
||||
)
|
||||
output.format(placeholderFormat())
|
||||
|
||||
output.sampleData(ParsableByteArray(frames[0]), frames[0].size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(0, C.BUFFER_FLAG_KEY_FRAME, frames[0].size, 0, null)
|
||||
@@ -1,154 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.parser.AssSubtitleParserFactory
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
/** Regression coverage for Matroska files whose SeekHead references Tracks after the Clusters. */
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class MatroskaLateTracksTest {
|
||||
|
||||
private class CapturedTrack(val type: Int) : TrackOutput {
|
||||
val timesUs = mutableListOf<Long>()
|
||||
var format: Format? = null
|
||||
|
||||
val sampleCount: Int
|
||||
get() = timesUs.size
|
||||
|
||||
override fun format(format: Format) {
|
||||
this.format = format
|
||||
}
|
||||
|
||||
override fun sampleData(input: DataReader, length: Int, allowEndOfInput: Boolean, sampleDataPart: Int): Int = input.read(ByteArray(length), 0, length)
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
data.skipBytes(length)
|
||||
}
|
||||
|
||||
override fun sampleMetadata(timeUs: Long, flags: Int, size: Int, offset: Int, cryptoData: TrackOutput.CryptoData?) {
|
||||
timesUs.add(timeUs)
|
||||
}
|
||||
}
|
||||
|
||||
private class CapturingExtractorOutput : ExtractorOutput {
|
||||
val tracks = mutableMapOf<Int, CapturedTrack>()
|
||||
val seekMaps = mutableListOf<SeekMap>()
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput = tracks.getOrPut(id) { CapturedTrack(type) }
|
||||
override fun endTracks() = Unit
|
||||
override fun seekMap(seekMap: SeekMap) {
|
||||
seekMaps.add(seekMap)
|
||||
}
|
||||
}
|
||||
|
||||
private class ByteArrayDataReader(private val data: ByteArray) : DataReader {
|
||||
var position = 0L
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
if (position >= data.size) return C.RESULT_END_OF_INPUT
|
||||
val bytesRead = minOf(length, data.size - position.toInt())
|
||||
data.copyInto(buffer, offset, position.toInt(), position.toInt() + bytesRead)
|
||||
position += bytesRead
|
||||
return bytesRead
|
||||
}
|
||||
}
|
||||
|
||||
private fun fixtureData(): ByteArray = checkNotNull(javaClass.getResourceAsStream("/matroska_tracks_at_end.mkv")) {
|
||||
"fixture matroska_tracks_at_end.mkv missing from test resources"
|
||||
}.use { it.readBytes() }
|
||||
|
||||
private fun readToEnd(extractor: Extractor, reader: ByteArrayDataReader, length: Long) {
|
||||
var input: ExtractorInput = DefaultExtractorInput(reader, reader.position, length)
|
||||
val seekPosition = PositionHolder()
|
||||
repeat(100_000) {
|
||||
when (extractor.read(input, seekPosition)) {
|
||||
Extractor.RESULT_END_OF_INPUT -> return
|
||||
Extractor.RESULT_SEEK -> {
|
||||
reader.position = seekPosition.position
|
||||
input = DefaultExtractorInput(reader, seekPosition.position, length)
|
||||
}
|
||||
}
|
||||
}
|
||||
error("extractor did not reach end of input")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun extractsSamplesWhenSeekHeadReferencesTracksAfterClusters() {
|
||||
val assHandler = AssHandler()
|
||||
val extractor = ZlibMatroskaExtractor(AssSubtitleParserFactory(assHandler), assHandler)
|
||||
val output = CapturingExtractorOutput()
|
||||
extractor.init(output)
|
||||
|
||||
val data = fixtureData()
|
||||
readToEnd(extractor, ByteArrayDataReader(data), data.size.toLong())
|
||||
|
||||
assertEquals(2, output.tracks.size)
|
||||
assertEquals(setOf(C.TRACK_TYPE_VIDEO, C.TRACK_TYPE_AUDIO), output.tracks.values.map { it.type }.toSet())
|
||||
output.tracks.values.forEach { track ->
|
||||
assertNotNull(track.format)
|
||||
assertTrue("expected extracted samples for track type ${track.type}", track.sampleCount > 0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* media3 1.11.0 builds the Matroska seek map at the end of the Cues element, which for
|
||||
* tracks-after-clusters files is before the Tracks element parsed — the map then permanently
|
||||
* reports unseekable and resolves every seek to byte 0, snapping playback to the start
|
||||
* (#1969; upstream androidx/media #3377).
|
||||
* The production stack must repair it through the per-track cue lookups.
|
||||
*/
|
||||
@Test
|
||||
fun seeksViaCuesWhenSeekMapIsBuiltBeforeTracks() {
|
||||
val assHandler = AssHandler()
|
||||
val extractor = CuelessSeekExtractorWrapper(ZlibMatroskaExtractor(AssSubtitleParserFactory(assHandler), assHandler))
|
||||
val output = CapturingExtractorOutput()
|
||||
extractor.init(output)
|
||||
|
||||
val data = fixtureData()
|
||||
val reader = ByteArrayDataReader(data)
|
||||
readToEnd(extractor, reader, data.size.toLong())
|
||||
|
||||
assertEquals(1, output.seekMaps.size)
|
||||
val seekMap = output.seekMaps.single()
|
||||
assertTrue("tracks-after-clusters file with Cues must be seekable", seekMap.isSeekable)
|
||||
|
||||
val points = seekMap.getSeekPoints(500_000L)
|
||||
// Cue-based resolution snaps to the fixture's only cue point (t=0); a byte-proportional
|
||||
// estimate would return the requested time instead.
|
||||
assertEquals(0L, points.first.timeUs)
|
||||
val position = points.first.position
|
||||
val clusterId = byteArrayOf(0x1F, 0x43, 0xB6.toByte(), 0x75)
|
||||
assertTrue(
|
||||
"seek position $position must point at a Cluster element",
|
||||
data.copyOfRange(position.toInt(), position.toInt() + 4).contentEquals(clusterId)
|
||||
)
|
||||
|
||||
output.tracks.values.forEach { it.timesUs.clear() }
|
||||
extractor.seek(position, points.first.timeUs)
|
||||
reader.position = position
|
||||
readToEnd(extractor, reader, data.size.toLong())
|
||||
|
||||
output.tracks.values.forEach { track ->
|
||||
assertTrue("expected extracted samples after seek for track type ${track.type}", track.sampleCount > 0)
|
||||
assertEquals(points.first.timeUs, track.timesUs.first())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class StreamBitrateMeterTest {
|
||||
|
||||
/** Feeds [count] packets of [sizeBytes] every [intervalUs], starting at [startUs]. */
|
||||
private fun StreamBitrateMeter.feed(count: Int, sizeBytes: Int, intervalUs: Long, startUs: Long = 0L) {
|
||||
for (i in 0 until count) onPacket(startUs + i * intervalUs, sizeBytes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `constant packet stream measures its bitrate`() {
|
||||
val meter = StreamBitrateMeter()
|
||||
// 1200-byte packets every 32 ms: 1200 * 8 / 0.032 = 300 kbps.
|
||||
meter.feed(count = 32, sizeBytes = 1200, intervalUs = 32_000)
|
||||
assertEquals(300_000, meter.bitrateBps())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `too few packets report nothing`() {
|
||||
val meter = StreamBitrateMeter()
|
||||
meter.feed(count = 15, sizeBytes = 1200, intervalUs = 32_000)
|
||||
assertNull(meter.bitrateBps())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `zero pts span reports nothing`() {
|
||||
val meter = StreamBitrateMeter()
|
||||
repeat(32) { meter.onPacket(0L, 1200) }
|
||||
assertNull(meter.bitrateBps())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `window drops old packets so a bitrate change is followed`() {
|
||||
val meter = StreamBitrateMeter(windowUs = 1_000_000)
|
||||
meter.feed(count = 100, sizeBytes = 1200, intervalUs = 32_000)
|
||||
// Continue at four times the packet size; after well over a window of
|
||||
// new packets, only the new rate remains.
|
||||
meter.feed(count = 100, sizeBytes = 4800, intervalUs = 32_000, startUs = 100 * 32_000L)
|
||||
assertEquals(1_200_000, meter.bitrateBps())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `backwards pts jump resets the window`() {
|
||||
val meter = StreamBitrateMeter()
|
||||
meter.feed(count = 32, sizeBytes = 1200, intervalUs = 32_000)
|
||||
// Seek back: the single post-seek packet must not combine with the
|
||||
// pre-seek span.
|
||||
meter.onPacket(0L, 1200)
|
||||
assertNull(meter.bitrateBps())
|
||||
meter.feed(count = 31, sizeBytes = 1200, intervalUs = 32_000, startUs = 32_000)
|
||||
assertEquals(300_000, meter.bitrateBps())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `empty packets are ignored`() {
|
||||
val meter = StreamBitrateMeter()
|
||||
meter.feed(count = 32, sizeBytes = 1200, intervalUs = 32_000)
|
||||
meter.onPacket(32 * 32_000L, 0)
|
||||
assertEquals(300_000, meter.bitrateBps())
|
||||
}
|
||||
}
|
||||
-248
@@ -1,248 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.ParserException
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.util.zip.Deflater
|
||||
import java.util.zip.DeflaterOutputStream
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
||||
class ZlibInflatingTrackOutputTest {
|
||||
@Before
|
||||
fun enableMedia3TestBoundsChecks() {
|
||||
ParsableByteArray.setShouldEnforceLimitOnLegacyMethods(true)
|
||||
}
|
||||
|
||||
@After
|
||||
fun resetMedia3TestBoundsChecks() {
|
||||
ParsableByteArray.setShouldEnforceLimitOnLegacyMethods(null)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun activeTransformInflatesChunkedSampleAndPreservesMetadata() {
|
||||
val original = ByteArray(512 * 1024) { (it % 251).toByte() }
|
||||
val compressed = deflate(original)
|
||||
val delegate = RecordingTrackOutput(retainBytes = true)
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
val split = compressed.size / 2
|
||||
|
||||
output.sampleData(
|
||||
ParsableByteArray(compressed.copyOfRange(0, split)),
|
||||
split,
|
||||
TrackOutput.SAMPLE_DATA_PART_MAIN
|
||||
)
|
||||
output.sampleData(
|
||||
ParsableByteArray(compressed.copyOfRange(split, compressed.size)),
|
||||
compressed.size - split,
|
||||
TrackOutput.SAMPLE_DATA_PART_MAIN
|
||||
)
|
||||
output.sampleMetadata(42L, C.BUFFER_FLAG_KEY_FRAME, compressed.size, 0, null)
|
||||
|
||||
assertArrayEquals(original, delegate.retained.toByteArray())
|
||||
assertEquals(42L, delegate.timeUs)
|
||||
assertEquals(C.BUFFER_FLAG_KEY_FRAME, delegate.flags)
|
||||
assertEquals(original.size, delegate.sampleSize)
|
||||
assertEquals(0, delegate.offset)
|
||||
assertEquals(1, delegate.metadataCount)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun activeTransformUsesMetadataBoundariesForBufferedSamples() {
|
||||
val first = ByteArray(4096) { (it % 19).toByte() }
|
||||
val second = ByteArray(2048) { (it % 23).toByte() }
|
||||
val firstCompressed = deflate(first)
|
||||
val secondCompressed = deflate(second)
|
||||
val combined = firstCompressed + secondCompressed
|
||||
val delegate = RecordingTrackOutput(retainBytes = true)
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
|
||||
output.sampleData(ParsableByteArray(combined), combined.size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(1, 0, firstCompressed.size, secondCompressed.size, null)
|
||||
output.sampleMetadata(2, 0, secondCompressed.size, 0, null)
|
||||
|
||||
assertArrayEquals(first + second, delegate.retained.toByteArray())
|
||||
assertEquals(2, delegate.metadataCount)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exactlySixteenMiBInflatedSampleIsAccepted() {
|
||||
val size = 16 * 1024 * 1024
|
||||
val compressed = deflateRepeated(size)
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
|
||||
feed(output, compressed)
|
||||
|
||||
assertEquals(size, delegate.byteCount)
|
||||
assertEquals(size, delegate.sampleSize)
|
||||
assertEquals(1, delegate.metadataCount)
|
||||
assertTrue(compressed.size < 64 * 1024)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun oneByteOverInflatedLimitFailsBeforeDelegation() {
|
||||
val compressed = deflateRepeated(16 * 1024 * 1024 + 1)
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
|
||||
assertThrows(ParserException::class.java) { feed(output, compressed) }
|
||||
|
||||
assertEquals(0, delegate.byteCount)
|
||||
assertEquals(0, delegate.metadataCount)
|
||||
assertTrue(compressed.size < 64 * 1024)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun excessiveCompressionRatioFailsBeforeInflatedSizeLimit() {
|
||||
val compressed = deflate(ByteArray(8 * 1024 * 1024))
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
|
||||
assertThrows(ParserException::class.java) { feed(output, compressed) }
|
||||
|
||||
assertEquals(0, delegate.byteCount)
|
||||
assertEquals(0, delegate.metadataCount)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun corruptStreamPassesTheBoundedSampleThroughUnchanged() {
|
||||
val corrupt = byteArrayOf(0, 1, 2, 3)
|
||||
val delegate = RecordingTrackOutput(retainBytes = true)
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
|
||||
feed(output, corrupt)
|
||||
|
||||
assertArrayEquals(corrupt, delegate.retained.toByteArray())
|
||||
assertEquals(corrupt.size, delegate.sampleSize)
|
||||
assertEquals(1, delegate.metadataCount)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun truncatedAndDictionaryStreamsFailClosed() {
|
||||
val valid = deflate(ByteArray(4096) { 7 })
|
||||
val dictionary = "shared-zlib-dictionary".toByteArray()
|
||||
val cases = listOf(
|
||||
valid.copyOf(valid.size - 2),
|
||||
deflate(ByteArray(4096) { 3 }, dictionary)
|
||||
)
|
||||
|
||||
for (compressed in cases) {
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = ZlibInflatingTrackOutput(delegate).apply { active = true }
|
||||
|
||||
assertThrows(ParserException::class.java) { feed(output, compressed) }
|
||||
assertEquals(0, delegate.byteCount)
|
||||
assertEquals(0, delegate.metadataCount)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun inactiveWrapperDelegatesBytesAndMetadataUnchanged() {
|
||||
val bytes = byteArrayOf(9, 8, 7, 6)
|
||||
val trailing = byteArrayOf(5, 4)
|
||||
val allBytes = bytes + trailing
|
||||
val delegate = RecordingTrackOutput(retainBytes = true)
|
||||
val output = ZlibInflatingTrackOutput(delegate)
|
||||
|
||||
output.sampleData(ParsableByteArray(allBytes), allBytes.size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(99L, 3, bytes.size, trailing.size, null)
|
||||
|
||||
assertArrayEquals(allBytes, delegate.retained.toByteArray())
|
||||
assertEquals(bytes.size, delegate.sampleSize)
|
||||
assertEquals(trailing.size, delegate.offset)
|
||||
assertEquals(99L, delegate.timeUs)
|
||||
}
|
||||
|
||||
private fun feed(output: ZlibInflatingTrackOutput, compressed: ByteArray) {
|
||||
output.sampleData(
|
||||
ParsableByteArray(compressed),
|
||||
compressed.size,
|
||||
TrackOutput.SAMPLE_DATA_PART_MAIN
|
||||
)
|
||||
output.sampleMetadata(1L, C.BUFFER_FLAG_KEY_FRAME, compressed.size, 0, null)
|
||||
}
|
||||
|
||||
private fun deflate(bytes: ByteArray, dictionary: ByteArray? = null): ByteArray {
|
||||
val target = ByteArrayOutputStream()
|
||||
val deflater = Deflater().apply {
|
||||
if (dictionary != null) setDictionary(dictionary)
|
||||
}
|
||||
DeflaterOutputStream(target, deflater).use { it.write(bytes) }
|
||||
return target.toByteArray()
|
||||
}
|
||||
|
||||
private fun deflateRepeated(size: Int): ByteArray {
|
||||
val target = ByteArrayOutputStream()
|
||||
val chunk = ByteArray(8192) { (it % 7).toByte() }
|
||||
DeflaterOutputStream(target).use { stream ->
|
||||
var remaining = size
|
||||
while (remaining > 0) {
|
||||
val count = minOf(remaining, chunk.size)
|
||||
stream.write(chunk, 0, count)
|
||||
remaining -= count
|
||||
}
|
||||
}
|
||||
return target.toByteArray()
|
||||
}
|
||||
|
||||
private class RecordingTrackOutput(
|
||||
private val retainBytes: Boolean = false
|
||||
) : TrackOutput {
|
||||
val retained = ByteArrayOutputStream()
|
||||
var byteCount = 0
|
||||
var metadataCount = 0
|
||||
var timeUs = C.TIME_UNSET
|
||||
var flags = 0
|
||||
var sampleSize = -1
|
||||
var offset = -1
|
||||
|
||||
override fun format(format: Format) = Unit
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
val buffer = ByteArray(length)
|
||||
val read = input.read(buffer, 0, length)
|
||||
if (read > 0) record(buffer, read)
|
||||
return read
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
val buffer = ByteArray(length)
|
||||
data.readBytes(buffer, 0, length)
|
||||
record(buffer, length)
|
||||
}
|
||||
|
||||
private fun record(buffer: ByteArray, length: Int) {
|
||||
byteCount += length
|
||||
if (retainBytes) retained.write(buffer, 0, length)
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
size: Int,
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
metadataCount++
|
||||
this.timeUs = timeUs
|
||||
this.flags = flags
|
||||
sampleSize = size
|
||||
this.offset = offset
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.util.zip.Deflater
|
||||
import java.util.zip.DeflaterOutputStream
|
||||
import java.util.zip.Inflater
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Unit spec for [rewriteZlibTextBlock]: the block header (track-number varint,
|
||||
* timecode, flags) must survive byte-identically, the payload must inflate, and
|
||||
* every block the rewriter cannot prove safe must pass through unchanged (null).
|
||||
*/
|
||||
class ZlibTextBlockTest {
|
||||
|
||||
private val inflater = Inflater()
|
||||
|
||||
private fun block(header: ByteArray, payload: ByteArray): ByteArray = header + payload
|
||||
|
||||
private fun deflate(bytes: ByteArray): ByteArray {
|
||||
val target = ByteArrayOutputStream()
|
||||
DeflaterOutputStream(target, Deflater()).use { it.write(bytes) }
|
||||
return target.toByteArray()
|
||||
}
|
||||
|
||||
// Track 3 (varint 0x83), relative timecode 0x0102, no lacing.
|
||||
private val unlacedHeader = byteArrayOf(0x83.toByte(), 0x01, 0x02, 0x00)
|
||||
|
||||
@Test
|
||||
fun inflatesUnlacedBlockPayloadAndPreservesHeader() {
|
||||
val dialogue = "42,,Default,,0,0,0,,SUBTITLE LINE 1 (0:00:00.00)".toByteArray()
|
||||
val data = block(unlacedHeader, deflate(dialogue))
|
||||
|
||||
val rewritten = rewriteZlibTextBlock(data, data.size, inflater)!!
|
||||
|
||||
assertArrayEquals(unlacedHeader + dialogue, rewritten)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun twoByteTrackNumberVarintIsPreserved() {
|
||||
val dialogue = "1,,Default,,0,0,0,,hello".toByteArray()
|
||||
val header = byteArrayOf(0x41, 0x2A, 0x01, 0x02, 0x00) // varint 0x412A = track 298
|
||||
val data = block(header, deflate(dialogue))
|
||||
|
||||
val rewritten = rewriteZlibTextBlock(data, data.size, inflater)!!
|
||||
|
||||
assertArrayEquals(header + dialogue, rewritten)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun lacedBlockPassesThrough() {
|
||||
val laced = byteArrayOf(0x83.toByte(), 0x01, 0x02, 0x06) // EBML lacing bits set
|
||||
val data = block(laced, deflate("payload".toByteArray()))
|
||||
|
||||
assertNull(rewriteZlibTextBlock(data, data.size, inflater))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun corruptStreamPassesThrough() {
|
||||
val data = block(unlacedHeader, byteArrayOf(0x44, 0x69, 0x61, 0x6C)) // "Dial", not zlib
|
||||
|
||||
assertNull(rewriteZlibTextBlock(data, data.size, inflater))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun truncatedStreamPassesThrough() {
|
||||
val compressed = deflate("a longer payload that spans several deflate symbols".toByteArray())
|
||||
val truncated = compressed.copyOf(compressed.size - 4)
|
||||
val data = block(unlacedHeader, truncated)
|
||||
|
||||
assertNull(rewriteZlibTextBlock(data, data.size, inflater))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun headerOnlyBlockPassesThrough() {
|
||||
assertNull(rewriteZlibTextBlock(unlacedHeader, unlacedHeader.size, inflater))
|
||||
}
|
||||
}
|
||||
-170
@@ -1,170 +0,0 @@
|
||||
package com.edde746.plezy.exoplayer
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.Extractor
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.PositionHolder
|
||||
import androidx.media3.extractor.SeekMap
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import androidx.media3.extractor.text.CueDecoder
|
||||
import androidx.media3.extractor.text.DefaultSubtitleParserFactory
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
/**
|
||||
* Extracts the committed fixtures — one ASS subtitle track muxed by mkvmerge with
|
||||
* `--compression 0:zlib` (ContentCompAlgo 0, the anime-release convention that
|
||||
* broke #2023) and an identical uncompressed mux — and verifies the zlib block
|
||||
* payloads are inflated *before* MatroskaExtractor's subtitle sample assembly.
|
||||
*
|
||||
* Regenerate with:
|
||||
* mkvmerge -o zlib_ssa.mkv --compression 0:zlib repro.ass
|
||||
* mkvmerge -o plain_ssa.mkv --compression 0:none repro.ass
|
||||
* where repro.ass holds 45 two-second "SUBTITLE LINE N (H:MM:SS.00)" events.
|
||||
*
|
||||
* Robolectric provides real android.util/android.os implementations —
|
||||
* MatroskaExtractor uses SparseArray and CueDecoder uses Parcel, both of which
|
||||
* are no-op stubs on plain JVM.
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class ZlibTextSubtitleExtractionTest {
|
||||
|
||||
private class CapturedSample(val timeUs: Long, val data: ByteArray)
|
||||
|
||||
private class FakeTrackOutput : TrackOutput {
|
||||
val formats = mutableListOf<androidx.media3.common.Format>()
|
||||
val samples = mutableListOf<CapturedSample>()
|
||||
private var buf = ByteArray(64 * 1024)
|
||||
private var bufLen = 0
|
||||
|
||||
override fun format(format: androidx.media3.common.Format) {
|
||||
formats.add(format)
|
||||
}
|
||||
|
||||
override fun sampleData(input: DataReader, length: Int, allowEndOfInput: Boolean, sampleDataPart: Int): Int {
|
||||
ensureCapacity(bufLen + length)
|
||||
val read = input.read(buf, bufLen, length)
|
||||
if (read > 0) bufLen += read
|
||||
return read
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
ensureCapacity(bufLen + length)
|
||||
data.readBytes(buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(timeUs: Long, flags: Int, size: Int, offset: Int, cryptoData: TrackOutput.CryptoData?) {
|
||||
val start = bufLen - offset - size
|
||||
samples.add(CapturedSample(timeUs, buf.copyOfRange(start, start + size)))
|
||||
if (offset == 0) bufLen = 0
|
||||
}
|
||||
|
||||
private fun ensureCapacity(needed: Int) {
|
||||
if (buf.size < needed) buf = buf.copyOf(maxOf(needed, buf.size * 2))
|
||||
}
|
||||
}
|
||||
|
||||
private class FakeExtractorOutput : ExtractorOutput {
|
||||
val tracks = mutableMapOf<Int, FakeTrackOutput>()
|
||||
|
||||
override fun track(id: Int, type: Int): TrackOutput = tracks.getOrPut(id) { FakeTrackOutput() }
|
||||
override fun endTracks() {}
|
||||
override fun seekMap(seekMap: SeekMap) {}
|
||||
}
|
||||
|
||||
private class ByteArrayDataReader(private val data: ByteArray) : DataReader {
|
||||
var position = 0L
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
if (position >= data.size) return C.RESULT_END_OF_INPUT
|
||||
val toRead = minOf(length, data.size - position.toInt())
|
||||
System.arraycopy(data, position.toInt(), buffer, offset, toRead)
|
||||
position += toRead
|
||||
return toRead
|
||||
}
|
||||
}
|
||||
|
||||
private fun extract(resource: String): FakeExtractorOutput {
|
||||
val data = checkNotNull(javaClass.getResourceAsStream(resource)) {
|
||||
"fixture $resource missing from test resources"
|
||||
}.use { it.readBytes() }
|
||||
|
||||
// DefaultSubtitleParserFactory (not AssSubtitleParserFactory) so the SSA track
|
||||
// transcodes to decodable media3 cues instead of loading native libass.
|
||||
val extractor = ZlibMatroskaExtractor(DefaultSubtitleParserFactory(), AssHandler())
|
||||
val output = FakeExtractorOutput()
|
||||
extractor.init(output)
|
||||
|
||||
val reader = ByteArrayDataReader(data)
|
||||
var input = DefaultExtractorInput(reader, 0, data.size.toLong())
|
||||
val seekPosition = PositionHolder()
|
||||
while (true) {
|
||||
when (extractor.read(input, seekPosition)) {
|
||||
Extractor.RESULT_END_OF_INPUT -> return output
|
||||
Extractor.RESULT_SEEK -> {
|
||||
reader.position = seekPosition.position
|
||||
input = DefaultExtractorInput(reader, seekPosition.position, data.size.toLong())
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class DecodedCue(val startTimeUs: Long, val durationUs: Long, val text: String)
|
||||
|
||||
private fun decodeCues(output: FakeExtractorOutput): List<DecodedCue> {
|
||||
val track = output.tracks.values.single()
|
||||
val format = track.formats.last()
|
||||
assertEquals(MimeTypes.APPLICATION_MEDIA3_CUES, format.sampleMimeType)
|
||||
assertEquals(MimeTypes.TEXT_SSA, format.codecs)
|
||||
val decoder = CueDecoder()
|
||||
return track.samples.map { sample ->
|
||||
val cues = decoder.decode(sample.timeUs, sample.data, 0, sample.data.size)
|
||||
DecodedCue(
|
||||
cues.startTimeUs,
|
||||
cues.durationUs,
|
||||
cues.cues.joinToString("\n") { it.text.toString() }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun zlibCompressedAssDialogueIsInflatedToParseableCues() {
|
||||
val cues = decodeCues(extract("/zlib_ssa.mkv"))
|
||||
|
||||
assertEquals(45, cues.size)
|
||||
assertEquals("SUBTITLE LINE 1 (0:00:00.00)", cues.first().text)
|
||||
assertEquals(0L, cues.first().startTimeUs)
|
||||
assertEquals(2_000_000L, cues.first().durationUs)
|
||||
assertEquals("SUBTITLE LINE 45 (0:01:28.00)", cues.last().text)
|
||||
assertEquals(88_000_000L, cues.last().startTimeUs)
|
||||
cues.forEachIndexed { index, cue ->
|
||||
assertEquals(index * 2_000_000L, cue.startTimeUs)
|
||||
assertTrue("cue $index text: ${cue.text}", cue.text.startsWith("SUBTITLE LINE ${index + 1} "))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun zlibAndPlainMuxesProduceIdenticalCues() {
|
||||
val zlib = decodeCues(extract("/zlib_ssa.mkv"))
|
||||
val plain = decodeCues(extract("/plain_ssa.mkv"))
|
||||
|
||||
assertEquals(plain.size, zlib.size)
|
||||
plain.zip(zlib).forEachIndexed { index, (expected, actual) ->
|
||||
assertEquals("startTimeUs of cue $index", expected.startTimeUs, actual.startTimeUs)
|
||||
assertEquals("durationUs of cue $index", expected.durationUs, actual.durationUs)
|
||||
assertEquals("text of cue $index", expected.text, actual.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.edde746.plezy.shared
|
||||
|
||||
import com.edde746.plezy.shared.DisplayModeSelector.ModeInfo
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class DisplayModeSelectorTest {
|
||||
|
||||
// A typical 4K TV: panel-native modes plus lower-resolution HDMI modes.
|
||||
private val uhd60 = ModeInfo(1, 3840, 2160, 60f)
|
||||
private val uhd50 = ModeInfo(2, 3840, 2160, 50f)
|
||||
private val uhd24 = ModeInfo(3, 3840, 2160, 23.976f)
|
||||
private val fhd60 = ModeInfo(4, 1920, 1080, 60f)
|
||||
private val fhd50 = ModeInfo(5, 1920, 1080, 50f)
|
||||
private val fhd24 = ModeInfo(6, 1920, 1080, 23.976f)
|
||||
private val hd60 = ModeInfo(7, 1280, 720, 60f)
|
||||
private val sd60 = ModeInfo(8, 720, 480, 60f)
|
||||
private val allModes = listOf(uhd60, uhd50, uhd24, fhd60, fhd50, fhd24, hd60, sd60)
|
||||
|
||||
private fun select(
|
||||
fps: Float,
|
||||
current: ModeInfo = uhd60,
|
||||
modes: List<ModeInfo> = allModes,
|
||||
videoWidth: Int = 0,
|
||||
videoHeight: Int = 0,
|
||||
matchResolution: Boolean = false
|
||||
) = DisplayModeSelector.findBestMode(fps, current, modes, videoWidth, videoHeight, matchResolution)
|
||||
|
||||
// --- Resolution matching ---
|
||||
|
||||
@Test
|
||||
fun resolutionMatchingPicksNativeResolutionAndRate() {
|
||||
val selection = select(23.976f, videoWidth = 1920, videoHeight = 1080, matchResolution = true)
|
||||
assertEquals(fhd24, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolutionOnlyRequestKeepsCurrentRefreshRate() {
|
||||
val selection = select(0f, videoWidth = 1920, videoHeight = 1080, matchResolution = true)
|
||||
assertEquals(fhd60, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolutionMatchingNeverDownscalesTheVideo() {
|
||||
// 1080p-class anamorphic content is wider than 720p even though shorter:
|
||||
// the smallest containing mode is 1080p, not 720p.
|
||||
val selection = select(0f, videoWidth = 1920, videoHeight = 800, matchResolution = true)
|
||||
assertEquals(fhd60, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolutionWinsOverCadenceWhenNativeResolutionHasNoMatchingRate() {
|
||||
// No 720p24 mode exists; the 720p video still lands on 720p (TV upscales)
|
||||
// instead of widening back out to a 24 Hz mode at another resolution.
|
||||
val selection = select(23.976f, videoWidth = 1280, videoHeight = 720, matchResolution = true)
|
||||
assertEquals(hd60, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun panelNativeContentStaysAtPanelResolution() {
|
||||
val selection = select(23.976f, videoWidth = 3840, videoHeight = 2160, matchResolution = true)
|
||||
assertEquals(uhd24, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun panelNativeResolutionOnlyRequestNeedsNoSwitch() {
|
||||
val selection = select(0f, videoWidth = 3840, videoHeight = 2160, matchResolution = true)
|
||||
assertEquals(uhd60, selection?.mode) // caller sees modeId == current and skips
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sourceLargerThanPanelFallsBackToCadencePolicy() {
|
||||
val selection = select(23.976f, videoWidth = 7680, videoHeight = 4320, matchResolution = true)
|
||||
assertEquals(uhd24, selection?.mode) // Tier-1 refresh-only switch
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sourceLargerThanPanelWithoutFpsHasNoTarget() {
|
||||
assertNull(select(0f, videoWidth = 7680, videoHeight = 4320, matchResolution = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolutionMatchingWithoutDimensionsBehavesLikeCadenceOnly() {
|
||||
val selection = select(23.976f, matchResolution = true)
|
||||
assertEquals(uhd24, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolutionOnlyPrefersRateClosestToCurrent() {
|
||||
// From a 50 Hz current mode, a resolution-only switch keeps 50 Hz.
|
||||
val selection = select(0f, current = uhd50, videoWidth = 1920, videoHeight = 1080, matchResolution = true)
|
||||
assertEquals(fhd50, selection?.mode)
|
||||
}
|
||||
|
||||
// --- Cadence-only policy (matchResolution off): pre-existing behaviour ---
|
||||
|
||||
@Test
|
||||
fun cadenceMatchingStaysAtCurrentResolution() {
|
||||
val selection = select(23.976f, videoWidth = 1920, videoHeight = 1080)
|
||||
assertEquals(uhd24, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cadenceTierTwoAllowsResolutionChangeButNeverBelowVideo() {
|
||||
// Panel has no 4K@24; only 1080p@24 remains for 1080p content.
|
||||
val modes = listOf(uhd60, uhd50, fhd60, fhd24, hd60)
|
||||
val selection = select(23.976f, modes = modes, videoWidth = 1920, videoHeight = 1080)
|
||||
assertEquals(fhd24, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cadenceTierTwoRequiresKnownDimensions() {
|
||||
val modes = listOf(uhd60, uhd50, fhd60, fhd24, hd60)
|
||||
assertNull(select(23.976f, modes = modes))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun invalidFpsWithoutResolutionRequestHasNoTarget() {
|
||||
assertNull(select(0f, videoWidth = 1920, videoHeight = 1080))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun multipleRateCountsAsCadenceMatch() {
|
||||
// 30 fps on a 60 Hz mode is a clean 2x pulldown; current 60 Hz mode wins.
|
||||
val selection = select(29.97f, current = uhd60, modes = listOf(uhd60, uhd50))
|
||||
assertNotNull(selection)
|
||||
assertEquals(uhd60, selection?.mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exactRateBeatsMultipleRate() {
|
||||
val uhd30 = ModeInfo(9, 3840, 2160, 29.97f)
|
||||
val selection = select(29.97f, modes = allModes + uhd30)
|
||||
assertEquals(uhd30, selection?.mode)
|
||||
}
|
||||
|
||||
// --- matchRefreshRate ---
|
||||
|
||||
@Test
|
||||
fun refreshRateMatchClassifiesExactMultipleAndMiss() {
|
||||
assertEquals(0, DisplayModeSelector.matchRefreshRate(23.976f, 23.976f)?.priority)
|
||||
assertEquals(1, DisplayModeSelector.matchRefreshRate(59.94f, 29.97f)?.priority)
|
||||
assertNull(DisplayModeSelector.matchRefreshRate(60f, 23.976f))
|
||||
assertNull(DisplayModeSelector.matchRefreshRate(60f, 0f))
|
||||
assertNull(DisplayModeSelector.matchRefreshRate(0f, 24f))
|
||||
}
|
||||
}
|
||||
@@ -58,4 +58,6 @@ dependencies {
|
||||
implementation("androidx.media3:media3-ui:1.11.0")
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
// media3 Format/MimeTypes touch android.util in static initializers.
|
||||
testImplementation("org.robolectric:robolectric:4.16.1")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.edde746.plezy.libass.media
|
||||
|
||||
/**
|
||||
* Shared policy for embedded font attachments delivered to libass: which
|
||||
* attachment mime types are fonts, and the per-font/aggregate byte budgets
|
||||
* that keep a hostile container from ballooning the font store.
|
||||
*/
|
||||
object AssFonts {
|
||||
const val MAX_FONT_BYTES = 16L * 1024 * 1024
|
||||
const val MAX_TOTAL_FONT_BYTES = 32L * 1024 * 1024
|
||||
|
||||
val fontMimeTypes = listOf(
|
||||
"font/ttf",
|
||||
"font/otf",
|
||||
"font/sfnt",
|
||||
"font/woff",
|
||||
"font/woff2",
|
||||
"application/font-sfnt",
|
||||
"application/font-woff",
|
||||
"application/x-truetype-font",
|
||||
"application/vnd.ms-opentype",
|
||||
"application/x-font-ttf"
|
||||
)
|
||||
|
||||
/** Null to accept the font, or a human-readable rejection reason. */
|
||||
fun rejectionReason(size: Long, acceptedBytes: Long): String? = when {
|
||||
size > MAX_FONT_BYTES -> "per-font limit"
|
||||
size > MAX_TOTAL_FONT_BYTES - acceptedBytes -> "aggregate limit"
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
-169
@@ -1,169 +0,0 @@
|
||||
package com.edde746.plezy.libass.media.extractor
|
||||
|
||||
import android.util.Log
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.ParserException
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.mkv.EbmlProcessor
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor
|
||||
import androidx.media3.extractor.text.SubtitleParser
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.text.AssSubtitleExtractorOutput
|
||||
|
||||
@OptIn(UnstableApi::class)
|
||||
open class AssMatroskaExtractor(
|
||||
subtitleParserFactory: SubtitleParser.Factory,
|
||||
private val assHandler: AssHandler,
|
||||
flags: Int = 0
|
||||
) : MatroskaExtractor(subtitleParserFactory, flags) {
|
||||
|
||||
private var currentAttachmentName: String? = null
|
||||
private var currentAttachmentMime: String? = null
|
||||
internal var acceptedFontBytes = 0L
|
||||
private set
|
||||
|
||||
internal val subtitleSample = subtitleSampleField.get(this) as ParsableByteArray
|
||||
|
||||
override fun getElementType(id: Int): Int = when (id) {
|
||||
ID_ATTACHMENTS -> EbmlProcessor.ELEMENT_TYPE_MASTER
|
||||
ID_ATTACHED_FILE -> EbmlProcessor.ELEMENT_TYPE_MASTER
|
||||
ID_FILE_NAME -> EbmlProcessor.ELEMENT_TYPE_STRING
|
||||
ID_FILE_MIME_TYPE -> EbmlProcessor.ELEMENT_TYPE_STRING
|
||||
ID_FILE_DATA -> EbmlProcessor.ELEMENT_TYPE_BINARY
|
||||
else -> super.getElementType(id)
|
||||
}
|
||||
|
||||
override fun isLevel1Element(id: Int): Boolean = super.isLevel1Element(id) || id == ID_ATTACHMENTS
|
||||
|
||||
override fun startMasterElement(id: Int, contentPosition: Long, contentSize: Long) {
|
||||
when (id) {
|
||||
ID_EBML -> {
|
||||
val currentExtractor = extractorOutput.get(this) as ExtractorOutput
|
||||
if (currentExtractor !is AssSubtitleExtractorOutput) {
|
||||
extractorOutput.set(
|
||||
this,
|
||||
AssSubtitleExtractorOutput(currentExtractor, assHandler, this)
|
||||
)
|
||||
}
|
||||
super.startMasterElement(id, contentPosition, contentSize)
|
||||
}
|
||||
ID_ATTACHED_FILE -> clearAttachment()
|
||||
else -> super.startMasterElement(id, contentPosition, contentSize)
|
||||
}
|
||||
}
|
||||
|
||||
override fun endMasterElement(id: Int) {
|
||||
when (id) {
|
||||
ID_VIDEO -> {
|
||||
// We need to get the video dimensions very early
|
||||
val track = getCurrentTrack(id)
|
||||
assHandler.setVideoSize(track.width, track.height)
|
||||
super.endMasterElement(id)
|
||||
}
|
||||
ID_ATTACHED_FILE -> clearAttachment()
|
||||
else -> super.endMasterElement(id)
|
||||
}
|
||||
}
|
||||
|
||||
override fun stringElement(id: Int, value: String) {
|
||||
when (id) {
|
||||
ID_FILE_NAME -> currentAttachmentName = value
|
||||
ID_FILE_MIME_TYPE -> currentAttachmentMime = value
|
||||
else -> super.stringElement(id, value)
|
||||
}
|
||||
}
|
||||
|
||||
override fun binaryElement(id: Int, contentSize: Int, input: ExtractorInput) {
|
||||
when (id) {
|
||||
ID_FILE_DATA -> {
|
||||
if (contentSize < 0) {
|
||||
throw ParserException.createForMalformedContainer(
|
||||
"Negative Matroska attachment size",
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
val attachmentName = requireNotNull(currentAttachmentName)
|
||||
val attachmentMime = requireNotNull(currentAttachmentMime)
|
||||
if (attachmentMime !in fontMimeTypes) {
|
||||
input.skipFully(contentSize)
|
||||
return
|
||||
}
|
||||
if (contentSize == 0) {
|
||||
input.skipFully(0)
|
||||
return
|
||||
}
|
||||
|
||||
val size = contentSize.toLong()
|
||||
val rejectionReason = when {
|
||||
size > MAX_FONT_BYTES -> "per-font limit"
|
||||
size > MAX_TOTAL_FONT_BYTES - acceptedFontBytes -> "aggregate limit"
|
||||
else -> null
|
||||
}
|
||||
if (rejectionReason != null) {
|
||||
onFontRejected(contentSize, acceptedFontBytes, rejectionReason)
|
||||
input.skipFully(contentSize)
|
||||
return
|
||||
}
|
||||
|
||||
val data = ByteArray(contentSize)
|
||||
input.readFully(data, 0, contentSize)
|
||||
acceptedFontBytes += size
|
||||
assHandler.addFont(attachmentName, data)
|
||||
}
|
||||
else -> super.binaryElement(id, contentSize, input)
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun onFontRejected(
|
||||
contentSize: Int,
|
||||
acceptedBytes: Long,
|
||||
reason: String
|
||||
) {
|
||||
Log.w(
|
||||
TAG,
|
||||
"Skipping embedded font: $reason (bytes=$contentSize, accepted=$acceptedBytes)"
|
||||
)
|
||||
}
|
||||
|
||||
private fun clearAttachment() {
|
||||
currentAttachmentName = null
|
||||
currentAttachmentMime = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AssMatroskaExtractor"
|
||||
internal const val MAX_FONT_BYTES = 16L * 1024 * 1024
|
||||
internal const val MAX_TOTAL_FONT_BYTES = 32L * 1024 * 1024
|
||||
const val ID_EBML = 0x1A45DFA3
|
||||
const val ID_VIDEO = 0xE0
|
||||
const val ID_ATTACHMENTS = 0x1941A469
|
||||
const val ID_ATTACHED_FILE = 0x61A7
|
||||
const val ID_FILE_NAME = 0x466E
|
||||
const val ID_FILE_MIME_TYPE = 0x4660
|
||||
const val ID_FILE_DATA = 0x465C
|
||||
|
||||
val fontMimeTypes = listOf(
|
||||
"font/ttf",
|
||||
"font/otf",
|
||||
"font/sfnt",
|
||||
"font/woff",
|
||||
"font/woff2",
|
||||
"application/font-sfnt",
|
||||
"application/font-woff",
|
||||
"application/x-truetype-font",
|
||||
"application/vnd.ms-opentype",
|
||||
"application/x-font-ttf"
|
||||
)
|
||||
|
||||
val extractorOutput = MatroskaExtractor::class.java.getDeclaredField("extractorOutput").apply {
|
||||
isAccessible = true
|
||||
}
|
||||
val subtitleSampleField = MatroskaExtractor::class.java.getDeclaredField("subtitleSample").apply {
|
||||
isAccessible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-7
@@ -5,21 +5,22 @@ import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.extractor.ExtractorOutput
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.extractor.AssMatroskaExtractor
|
||||
|
||||
/**
|
||||
* This class is only used by the overlay renderer. It's needed to get the start time of the subtitles.
|
||||
* Wraps every text track with [AssTrackOutput] so embedded ASS dialogue
|
||||
* reaches libass. Install it on the raw-subtitle side of the output chain —
|
||||
* between the extractor and the SubtitleTranscodingExtractorOutput — so the
|
||||
* dialogue bytes are still unparsed when they pass through.
|
||||
*/
|
||||
@UnstableApi
|
||||
class AssSubtitleExtractorOutput(
|
||||
private val delegate: ExtractorOutput,
|
||||
private val assHandler: AssHandler,
|
||||
private val extractor: AssMatroskaExtractor
|
||||
private val assHandler: AssHandler
|
||||
) : ExtractorOutput by delegate {
|
||||
override fun track(id: Int, type: Int): TrackOutput = if (type == C.TRACK_TYPE_TEXT) {
|
||||
// We can't know at this time if the subtitle track is ASS or other format, so we wrap
|
||||
// every subtitle track
|
||||
AssTrackOutput(delegate.track(id, type), assHandler, extractor)
|
||||
// We can't know at this time if the subtitle track is ASS or another
|
||||
// format, so we wrap every subtitle track; non-ASS tracks pass through.
|
||||
AssTrackOutput(delegate.track(id, type), assHandler::readTrackDialogue)
|
||||
} else {
|
||||
delegate.track(id, type)
|
||||
}
|
||||
|
||||
+98
-30
@@ -1,29 +1,50 @@
|
||||
package com.edde746.plezy.libass.media.text
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.common.util.Util
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import com.edde746.plezy.libass.media.extractor.AssMatroskaExtractor
|
||||
import java.io.EOFException
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* This class is only used by the overlay renderer. It's needed to get the start time of the subtitles.
|
||||
* Feeds embedded ASS dialogue to libass while forwarding every sample
|
||||
* unchanged. Only used by the overlay renderer, which needs the start time and
|
||||
* duration of each dialogue line.
|
||||
*
|
||||
* Samples must arrive in the media3 MatroskaExtractor subtitle shape
|
||||
* `Dialogue: 0:00:00:00,<duration timecode>,<ReadOrder,Layer,Style,...>` — the
|
||||
* second field carries the sample *duration* (MatroskaExtractor patches
|
||||
* BlockDuration into it; the FFmpeg extractor writes the packet duration).
|
||||
* The extractor beneath must therefore emit raw subtitle samples: media3's
|
||||
* MatroskaExtractor with FLAG_EMIT_RAW_SUBTITLE_DATA, or the FFmpeg demuxer
|
||||
* path. Cue transcoding happens downstream of this wrapper.
|
||||
*/
|
||||
@UnstableApi
|
||||
class AssTrackOutput(
|
||||
private val delegate: TrackOutput,
|
||||
private val assHandler: AssHandler,
|
||||
private val extractor: AssMatroskaExtractor
|
||||
) : TrackOutput by delegate {
|
||||
private val dialogueSink: DialogueSink
|
||||
) : TrackOutput {
|
||||
|
||||
/** Receives one dialogue line; mirrors AssHandler.readTrackDialogue. */
|
||||
fun interface DialogueSink {
|
||||
fun onDialogue(trackId: String?, startMs: Long, durationMs: Long, data: ByteArray, offset: Int, length: Int)
|
||||
}
|
||||
|
||||
private var isAss = false
|
||||
|
||||
private var trackId: String? = null
|
||||
|
||||
// Sample bytes buffered between sampleData and sampleMetadata; only
|
||||
// populated for ASS tracks.
|
||||
private var buf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private var bufLen = 0
|
||||
private var readBuf = ByteArray(INITIAL_BUFFER_SIZE)
|
||||
private val forwardParsable = ParsableByteArray()
|
||||
|
||||
override fun format(format: Format) {
|
||||
if (format.sampleMimeType == MimeTypes.TEXT_SSA || format.codecs == MimeTypes.TEXT_SSA) {
|
||||
isAss = true
|
||||
@@ -32,6 +53,34 @@ class AssTrackOutput(
|
||||
delegate.format(format)
|
||||
}
|
||||
|
||||
override fun sampleData(
|
||||
input: DataReader,
|
||||
length: Int,
|
||||
allowEndOfInput: Boolean,
|
||||
sampleDataPart: Int
|
||||
): Int {
|
||||
if (!isAss) return delegate.sampleData(input, length, allowEndOfInput, sampleDataPart)
|
||||
if (readBuf.size < length) readBuf = ByteArray(length)
|
||||
val bytesRead = input.read(readBuf, 0, length)
|
||||
if (bytesRead == C.RESULT_END_OF_INPUT) {
|
||||
if (!allowEndOfInput) throw EOFException()
|
||||
return C.RESULT_END_OF_INPUT
|
||||
}
|
||||
append(readBuf, bytesRead)
|
||||
forwardParsable.reset(readBuf, bytesRead)
|
||||
delegate.sampleData(forwardParsable, bytesRead, sampleDataPart)
|
||||
return bytesRead
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
if (isAss) {
|
||||
ensureCapacity(bufLen + length)
|
||||
System.arraycopy(data.data, data.position, buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
delegate.sampleData(data, length, sampleDataPart)
|
||||
}
|
||||
|
||||
override fun sampleMetadata(
|
||||
timeUs: Long,
|
||||
flags: Int,
|
||||
@@ -39,26 +88,37 @@ class AssTrackOutput(
|
||||
offset: Int,
|
||||
cryptoData: TrackOutput.CryptoData?
|
||||
) {
|
||||
if (isAss && timeUs.isValidTs) {
|
||||
val sample = extractor.subtitleSample
|
||||
val endIndex = findTokenIndex(sample.data, 1)
|
||||
val lineIndex = findTokenIndex(sample.data, 2)
|
||||
|
||||
val rawDuration = sample.data.decodeToString(endIndex, lineIndex - 1)
|
||||
val durationUs = parseTimecodeUs(rawDuration)
|
||||
|
||||
assHandler.readTrackDialogue(
|
||||
trackId = trackId,
|
||||
start = timeUs / 1000,
|
||||
duration = durationUs / 1000,
|
||||
data = sample.data,
|
||||
offset = lineIndex,
|
||||
length = sample.limit() - lineIndex
|
||||
)
|
||||
if (isAss) {
|
||||
// offset counts bytes buffered after this sample; the slice math matches
|
||||
// media3's TrackOutput contract even though subtitle samples are
|
||||
// normally delivered one at a time with offset 0.
|
||||
val start = bufLen - offset - size
|
||||
if (timeUs != C.TIME_UNSET && start >= 0) {
|
||||
feedDialogue(timeUs, start, size)
|
||||
}
|
||||
if (offset == 0) bufLen = 0
|
||||
}
|
||||
delegate.sampleMetadata(timeUs, flags, size, offset, cryptoData)
|
||||
}
|
||||
|
||||
private fun feedDialogue(timeUs: Long, start: Int, size: Int) {
|
||||
val end = start + size
|
||||
val durationIndex = findTokenIndex(start, end, 1)
|
||||
val lineIndex = findTokenIndex(start, end, 2)
|
||||
if (durationIndex <= start || lineIndex <= durationIndex) return
|
||||
val rawDuration = buf.decodeToString(durationIndex, lineIndex - 1)
|
||||
val durationUs = parseTimecodeUs(rawDuration)
|
||||
if (durationUs == C.TIME_UNSET) return
|
||||
dialogueSink.onDialogue(
|
||||
trackId,
|
||||
timeUs / 1000,
|
||||
durationUs / 1000,
|
||||
buf,
|
||||
lineIndex,
|
||||
end - lineIndex
|
||||
)
|
||||
}
|
||||
|
||||
private fun parseTimecodeUs(timeString: String): Long {
|
||||
val matcher = SSA_TIMECODE_PATTERN.matcher(timeString.trim { it <= ' ' })
|
||||
if (!matcher.matches()) {
|
||||
@@ -72,24 +132,32 @@ class AssTrackOutput(
|
||||
return timestampUs
|
||||
}
|
||||
|
||||
private fun findTokenIndex(array: ByteArray, tokenNumber: Int): Int {
|
||||
if (tokenNumber == 0) return 0
|
||||
/** Index just past the [tokenNumber]th comma inside [from, to), or [from]. */
|
||||
private fun findTokenIndex(from: Int, to: Int, tokenNumber: Int): Int {
|
||||
var tokensFound = 0
|
||||
array.forEachIndexed { index, byte ->
|
||||
if (byte == COMMA && ++tokensFound == tokenNumber) {
|
||||
for (index in from until to) {
|
||||
if (buf[index] == COMMA && ++tokensFound == tokenNumber) {
|
||||
return index + 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
return from
|
||||
}
|
||||
|
||||
private val Long.isValidTs
|
||||
get() = this != C.TIME_UNSET
|
||||
private fun append(src: ByteArray, length: Int) {
|
||||
ensureCapacity(bufLen + length)
|
||||
System.arraycopy(src, 0, buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
|
||||
private fun ensureCapacity(needed: Int) {
|
||||
if (buf.size < needed) buf = buf.copyOf(maxOf(needed, buf.size * 2))
|
||||
}
|
||||
|
||||
private companion object {
|
||||
val SSA_TIMECODE_PATTERN: Pattern =
|
||||
Pattern.compile("""(?:(\d+):)?(\d+):(\d+)[:.](\d+)""")
|
||||
|
||||
const val COMMA = ','.code.toByte()
|
||||
const val INITIAL_BUFFER_SIZE = 1024
|
||||
}
|
||||
}
|
||||
|
||||
-156
@@ -1,156 +0,0 @@
|
||||
package com.edde746.plezy.libass.media.extractor
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.DataReader
|
||||
import androidx.media3.common.ParserException
|
||||
import androidx.media3.extractor.DefaultExtractorInput
|
||||
import androidx.media3.extractor.ExtractorInput
|
||||
import androidx.media3.extractor.text.DefaultSubtitleParserFactory
|
||||
import com.edde746.plezy.libass.media.AssHandler
|
||||
import java.io.EOFException
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Test
|
||||
|
||||
class AssMatroskaExtractorTest {
|
||||
|
||||
@Test
|
||||
fun smallFontIsDeliveredAndNonFontDoesNotConsumeBudget() {
|
||||
val handler = AssHandler()
|
||||
val extractor = extractor(handler)
|
||||
|
||||
attachment(extractor, "font/ttf")
|
||||
extractor.fileData(4, input(4, seed = 11))
|
||||
attachment(extractor, "application/octet-stream")
|
||||
extractor.fileData(9, input(9, seed = 22))
|
||||
|
||||
val pending = handler.fontStore.pendingSnapshot()
|
||||
assertEquals(1, pending.size)
|
||||
assertEquals("fixture-font", pending.single().first)
|
||||
assertArrayEquals(byteArrayOf(11, 12, 13, 14), pending.single().second)
|
||||
assertEquals(4L, extractor.acceptedFontBytes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun perFontLimitAcceptsExactBoundaryAndSkipsOneByteOver() {
|
||||
val handler = AssHandler()
|
||||
val extractor = extractor(handler)
|
||||
val limit = AssMatroskaExtractor.MAX_FONT_BYTES.toInt()
|
||||
|
||||
attachment(extractor, "font/otf")
|
||||
extractor.fileData(limit, input(limit))
|
||||
attachment(extractor, "font/otf")
|
||||
extractor.fileData(limit + 1, input(limit + 1))
|
||||
|
||||
assertEquals(limit.toLong(), extractor.acceptedFontBytes)
|
||||
assertEquals(1, handler.fontStore.pendingSnapshot().size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aggregateLimitIsDeterministicAcrossAttachmentEntries() {
|
||||
val handler = AssHandler()
|
||||
val extractor = extractor(handler)
|
||||
val perFont = AssMatroskaExtractor.MAX_FONT_BYTES.toInt()
|
||||
|
||||
repeat(2) {
|
||||
attachment(extractor, "font/ttf")
|
||||
extractor.fileData(perFont, input(perFont, seed = it))
|
||||
extractor.endAttachment()
|
||||
}
|
||||
attachment(extractor, "font/ttf")
|
||||
extractor.fileData(1, input(1))
|
||||
|
||||
assertEquals(AssMatroskaExtractor.MAX_TOTAL_FONT_BYTES, extractor.acceptedFontBytes)
|
||||
assertEquals(2, handler.fontStore.pendingSnapshot().size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun negativeAndZeroSizesAllocateAndDeliverNothing() {
|
||||
val handler = AssHandler()
|
||||
val extractor = extractor(handler)
|
||||
attachment(extractor, "font/woff2")
|
||||
|
||||
assertThrows(ParserException::class.java) {
|
||||
extractor.fileData(-1, input(0))
|
||||
}
|
||||
attachment(extractor, "font/woff2")
|
||||
extractor.fileData(0, input(0))
|
||||
|
||||
assertEquals(0L, extractor.acceptedFontBytes)
|
||||
assertEquals(0, handler.fontStore.pendingSnapshot().size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun failedReadDoesNotChargeAggregateBudgetOrDeliverPartialFont() {
|
||||
val handler = AssHandler()
|
||||
val extractor = extractor(handler)
|
||||
attachment(extractor, "font/ttf")
|
||||
|
||||
assertThrows(EOFException::class.java) {
|
||||
extractor.fileData(1024, input(1024, available = 4))
|
||||
}
|
||||
assertEquals(0L, extractor.acceptedFontBytes)
|
||||
assertEquals(0, handler.fontStore.pendingSnapshot().size)
|
||||
|
||||
attachment(extractor, "font/ttf")
|
||||
extractor.fileData(1024, input(1024))
|
||||
assertEquals(1024L, extractor.acceptedFontBytes)
|
||||
assertEquals(1, handler.fontStore.pendingSnapshot().size)
|
||||
}
|
||||
|
||||
private fun extractor(handler: AssHandler) = TestExtractor(handler)
|
||||
|
||||
private fun attachment(extractor: TestExtractor, mime: String) {
|
||||
extractor.setAttachment(mime)
|
||||
}
|
||||
|
||||
private class TestExtractor(handler: AssHandler) :
|
||||
AssMatroskaExtractor(
|
||||
DefaultSubtitleParserFactory(),
|
||||
handler
|
||||
) {
|
||||
fun setAttachment(mime: String) {
|
||||
startMasterElement(ID_ATTACHED_FILE, 0, 0)
|
||||
stringElement(ID_FILE_NAME, "fixture-font")
|
||||
stringElement(ID_FILE_MIME_TYPE, mime)
|
||||
}
|
||||
|
||||
fun fileData(contentSize: Int, input: ExtractorInput) {
|
||||
binaryElement(ID_FILE_DATA, contentSize, input)
|
||||
}
|
||||
|
||||
fun endAttachment() {
|
||||
endMasterElement(ID_ATTACHED_FILE)
|
||||
}
|
||||
|
||||
override fun onFontRejected(contentSize: Int, acceptedBytes: Long, reason: String) = Unit
|
||||
}
|
||||
|
||||
private fun input(
|
||||
declared: Int,
|
||||
available: Int = declared,
|
||||
seed: Int = 0
|
||||
): ExtractorInput = DefaultExtractorInput(
|
||||
PatternDataReader(available, seed),
|
||||
0,
|
||||
declared.toLong()
|
||||
)
|
||||
|
||||
private class PatternDataReader(
|
||||
private val size: Int,
|
||||
private val seed: Int
|
||||
) : DataReader {
|
||||
private var position = 0
|
||||
|
||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||
if (position >= size) return C.RESULT_END_OF_INPUT
|
||||
val count = minOf(length, size - position)
|
||||
for (index in 0 until count) {
|
||||
buffer[offset + index] = ((seed + position + index) and 0xFF).toByte()
|
||||
}
|
||||
position += count
|
||||
return count
|
||||
}
|
||||
}
|
||||
}
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
package com.edde746.plezy.libass.media.text
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.Format
|
||||
import androidx.media3.common.MimeTypes
|
||||
import androidx.media3.common.util.ParsableByteArray
|
||||
import androidx.media3.extractor.TrackOutput
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
/**
|
||||
* Spec for the dialogue feed both demuxer paths rely on: samples arrive in
|
||||
* media3's MatroskaExtractor shape ("Dialogue: 0:00:00:00,<duration>,<rest>")
|
||||
* and the sink must receive the sample start, the parsed duration, and the
|
||||
* payload after the second comma — while every byte is still forwarded
|
||||
* unchanged to the delegate.
|
||||
*/
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class AssTrackOutputTest {
|
||||
|
||||
private class CapturedDialogue(val trackId: String?, val startMs: Long, val durationMs: Long, val line: ByteArray)
|
||||
|
||||
private class RecordingSink : AssTrackOutput.DialogueSink {
|
||||
val dialogues = mutableListOf<CapturedDialogue>()
|
||||
|
||||
override fun onDialogue(trackId: String?, startMs: Long, durationMs: Long, data: ByteArray, offset: Int, length: Int) {
|
||||
dialogues.add(CapturedDialogue(trackId, startMs, durationMs, data.copyOfRange(offset, offset + length)))
|
||||
}
|
||||
}
|
||||
|
||||
private class RecordingTrackOutput : TrackOutput {
|
||||
val formats = mutableListOf<Format>()
|
||||
val samples = mutableListOf<ByteArray>()
|
||||
val sampleTimes = mutableListOf<Long>()
|
||||
private var buf = ByteArray(1024)
|
||||
private var bufLen = 0
|
||||
|
||||
override fun format(format: Format) {
|
||||
formats.add(format)
|
||||
}
|
||||
|
||||
override fun sampleData(input: androidx.media3.common.DataReader, length: Int, allowEndOfInput: Boolean, sampleDataPart: Int): Int {
|
||||
if (buf.size < bufLen + length) buf = buf.copyOf(bufLen + length)
|
||||
val read = input.read(buf, bufLen, length)
|
||||
if (read > 0) bufLen += read
|
||||
return read
|
||||
}
|
||||
|
||||
override fun sampleData(data: ParsableByteArray, length: Int, sampleDataPart: Int) {
|
||||
if (buf.size < bufLen + length) buf = buf.copyOf(bufLen + length)
|
||||
data.readBytes(buf, bufLen, length)
|
||||
bufLen += length
|
||||
}
|
||||
|
||||
override fun sampleMetadata(timeUs: Long, flags: Int, size: Int, offset: Int, cryptoData: TrackOutput.CryptoData?) {
|
||||
val start = bufLen - offset - size
|
||||
samples.add(buf.copyOfRange(start, start + size))
|
||||
sampleTimes.add(timeUs)
|
||||
if (offset == 0) bufLen = 0
|
||||
}
|
||||
}
|
||||
|
||||
private fun ssaFormat(id: String = "3"): Format = Format.Builder()
|
||||
.setId(id)
|
||||
.setSampleMimeType(MimeTypes.TEXT_SSA)
|
||||
.build()
|
||||
|
||||
private fun deliver(output: AssTrackOutput, sample: String, timeUs: Long) {
|
||||
val bytes = sample.toByteArray(Charsets.UTF_8)
|
||||
output.sampleData(ParsableByteArray(bytes), bytes.size, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
output.sampleMetadata(timeUs, C.BUFFER_FLAG_KEY_FRAME, bytes.size, 0, null)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun feedsDialogueAndForwardsSampleUnchanged() {
|
||||
val sink = RecordingSink()
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = AssTrackOutput(delegate, sink)
|
||||
output.format(ssaFormat())
|
||||
|
||||
val sample = "Dialogue: 0:00:00:00,0:00:05:00,7,0,Default,,0,0,0,,Hello, world"
|
||||
deliver(output, sample, 90_000_000L)
|
||||
|
||||
assertEquals(1, sink.dialogues.size)
|
||||
val dialogue = sink.dialogues.first()
|
||||
assertEquals("3", dialogue.trackId)
|
||||
assertEquals(90_000L, dialogue.startMs)
|
||||
assertEquals(5_000L, dialogue.durationMs)
|
||||
// Payload after the second comma: the raw MKV/FFmpeg block, commas in the
|
||||
// text field intact.
|
||||
assertEquals("7,0,Default,,0,0,0,,Hello, world", dialogue.line.toString(Charsets.UTF_8))
|
||||
|
||||
// The delegate still receives the full untouched sample.
|
||||
assertEquals(1, delegate.samples.size)
|
||||
assertArrayEquals(sample.toByteArray(Charsets.UTF_8), delegate.samples.first())
|
||||
assertEquals(90_000_000L, delegate.sampleTimes.first())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun ignoresNonAssTracksAndMalformedSamples() {
|
||||
val sink = RecordingSink()
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = AssTrackOutput(delegate, sink)
|
||||
|
||||
// SubRip track: forwarded, never fed to libass.
|
||||
output.format(Format.Builder().setId("1").setSampleMimeType(MimeTypes.APPLICATION_SUBRIP).build())
|
||||
deliver(output, "1\n00:00:00,000 --> 00:00:05,000\nplain text", 1_000_000L)
|
||||
assertTrue(sink.dialogues.isEmpty())
|
||||
assertEquals(1, delegate.samples.size)
|
||||
|
||||
// ASS track with an unparseable duration: forwarded, not fed.
|
||||
val assOutput = AssTrackOutput(RecordingTrackOutput(), sink)
|
||||
assOutput.format(ssaFormat())
|
||||
deliver(assOutput, "Dialogue: bogus", 1_000_000L)
|
||||
assertTrue(sink.dialogues.isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun handlesChunkedSampleDataAndDataReaderPath() {
|
||||
val sink = RecordingSink()
|
||||
val delegate = RecordingTrackOutput()
|
||||
val output = AssTrackOutput(delegate, sink)
|
||||
output.format(ssaFormat("0"))
|
||||
|
||||
val sample = "Dialogue: 0:00:00:00,0:00:01:50,1,0,Style,,0,0,0,,Line"
|
||||
val bytes = sample.toByteArray(Charsets.UTF_8)
|
||||
val split = bytes.size / 2
|
||||
output.sampleData(ParsableByteArray(bytes.copyOfRange(0, split)), split, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
val rest = bytes.copyOfRange(split, bytes.size)
|
||||
var consumed = 0
|
||||
val reader = androidx.media3.common.DataReader { buffer, offset, length ->
|
||||
if (consumed >= rest.size) {
|
||||
C.RESULT_END_OF_INPUT
|
||||
} else {
|
||||
val toRead = minOf(length, rest.size - consumed)
|
||||
System.arraycopy(rest, consumed, buffer, offset, toRead)
|
||||
consumed += toRead
|
||||
toRead
|
||||
}
|
||||
}
|
||||
while (consumed < rest.size) {
|
||||
output.sampleData(reader, rest.size - consumed, false, TrackOutput.SAMPLE_DATA_PART_MAIN)
|
||||
}
|
||||
output.sampleMetadata(0L, C.BUFFER_FLAG_KEY_FRAME, bytes.size, 0, null)
|
||||
|
||||
assertEquals(1, sink.dialogues.size)
|
||||
assertEquals(1_500L, sink.dialogues.first().durationMs)
|
||||
assertEquals("1,0,Style,,0,0,0,,Line", sink.dialogues.first().line.toString(Charsets.UTF_8))
|
||||
assertArrayEquals(bytes, delegate.samples.first())
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/universal_gamepad/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
||||
Flutter: 71a624a5bc0c04062bf19101d501e466baf2fb47
|
||||
os_media_controls: 048eb9a75974191b2496d85575b6edcefc572d4e
|
||||
universal_gamepad: 7c0cc0c2e3909dfb803d325387e42963b3ed842c
|
||||
|
||||
|
||||
@@ -797,8 +797,8 @@
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/edde746/MPVKit";
|
||||
requirement = {
|
||||
kind = exactVersion;
|
||||
version = 1.0.23;
|
||||
kind = revision;
|
||||
revision = 0097fea015fe9b59bcfed866e61acb5896454bd4;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
@@ -32,8 +32,7 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/edde746/MPVKit",
|
||||
"state" : {
|
||||
"revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e",
|
||||
"version" : "1.0.23"
|
||||
"revision" : "0097fea015fe9b59bcfed866e61acb5896454bd4"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -32,8 +32,7 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/edde746/MPVKit",
|
||||
"state" : {
|
||||
"revision" : "ee423a7e8727eeee4748f08cb7d3c00e935ed45e",
|
||||
"version" : "1.0.23"
|
||||
"revision" : "0097fea015fe9b59bcfed866e61acb5896454bd4"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:drift/drift.dart';
|
||||
|
||||
import '../database/app_database.dart';
|
||||
@@ -16,6 +17,19 @@ class ConnectionRegistry {
|
||||
ConnectionRegistry(this._db);
|
||||
|
||||
final AppDatabase _db;
|
||||
static const DeepCollectionEquality _configEquality = DeepCollectionEquality();
|
||||
|
||||
final Expando<Map<String, Object?>> _decryptedConfigs = Expando<Map<String, Object?>>(
|
||||
'ConnectionRegistry.decryptedConfigs',
|
||||
);
|
||||
|
||||
/// Compares the decrypted persisted config projections retained while rows
|
||||
/// are decoded. The fallback covers models supplied outside this registry.
|
||||
bool hasSameConfig(Connection a, Connection b) {
|
||||
final aConfig = _decryptedConfigs[a] ??= a.toConfigJson();
|
||||
final bConfig = _decryptedConfigs[b] ??= b.toConfigJson();
|
||||
return _configEquality.equals(aConfig, bConfig);
|
||||
}
|
||||
|
||||
/// Emits the current set of connections after every mutation. Drift's
|
||||
/// `watch()` provides this for free.
|
||||
@@ -121,6 +135,7 @@ class ConnectionRegistry {
|
||||
dialect: kind.dialect!,
|
||||
),
|
||||
};
|
||||
_decryptedConfigs[connection] = revealed.config;
|
||||
if (revealed.migrated) {
|
||||
await upsert(connection);
|
||||
}
|
||||
|
||||
@@ -433,14 +433,20 @@ extension DownloadDatabaseOperations on AppDatabase {
|
||||
}
|
||||
|
||||
/// Get next item from queue (highest priority, oldest first)
|
||||
/// Only returns items that are not paused
|
||||
Future<DownloadQueueItem?> getNextQueueItem() async {
|
||||
/// Only returns items that are not paused.
|
||||
///
|
||||
/// [excludedGlobalKeys] filters out heads the caller already tried and could
|
||||
/// not resolve, so one stale row cannot starve the rest of the queue.
|
||||
Future<DownloadQueueItem?> getNextQueueItem({Set<String> excludedGlobalKeys = const {}}) async {
|
||||
final query = select(
|
||||
downloadQueue,
|
||||
).join([innerJoin(downloadedMedia, downloadedMedia.globalKey.equalsExp(downloadQueue.mediaGlobalKey))]);
|
||||
|
||||
query.where(downloadedMedia.status.equals(DownloadStatus.queued.index));
|
||||
if (excludedGlobalKeys.isNotEmpty) {
|
||||
query.where(downloadQueue.mediaGlobalKey.isNotIn(excludedGlobalKeys.toList(growable: false)));
|
||||
}
|
||||
query
|
||||
..where(downloadedMedia.status.equals(DownloadStatus.queued.index))
|
||||
..orderBy([
|
||||
OrderingTerm(expression: downloadQueue.priority, mode: OrderingMode.desc),
|
||||
OrderingTerm(expression: downloadQueue.addedAt),
|
||||
|
||||
@@ -38,7 +38,7 @@ class MediaServerAuthException extends MediaServerException {
|
||||
/// Auth polling reached a terminal server-side expiry/rejection state before
|
||||
/// the user completed the external sign-in flow.
|
||||
class MediaServerPinExpiredException extends MediaServerAuthException {
|
||||
const MediaServerPinExpiredException({String? display}) : super('PIN expired before sign-in', display: display);
|
||||
const MediaServerPinExpiredException({super.display}) : super('PIN expired before sign-in');
|
||||
}
|
||||
|
||||
/// HTTP transport / non-2xx errors. Carries the status code (when known),
|
||||
@@ -57,11 +57,11 @@ class MediaServerHttpException extends MediaServerException {
|
||||
MediaServerHttpException({
|
||||
required this.type,
|
||||
String? message,
|
||||
String? display,
|
||||
super.display,
|
||||
this.statusCode,
|
||||
this.responseData,
|
||||
this.requestUri,
|
||||
}) : super(message ?? '', display: display);
|
||||
}) : super(message ?? '');
|
||||
|
||||
/// Map a caught exception to a [MediaServerHttpException].
|
||||
factory MediaServerHttpException.from(Object error, {Uri? uri}) {
|
||||
@@ -119,6 +119,17 @@ class MediaServerHttpException extends MediaServerException {
|
||||
}
|
||||
}
|
||||
|
||||
/// The backend already has a recording scheduled for the requested airing.
|
||||
///
|
||||
/// Plex signals duplicates with a bare 409, which UI maps by status code.
|
||||
/// Jellyfin/Emby answer `POST /LiveTv/Timers` duplicates with a 400 that is
|
||||
/// indistinguishable from a malformed request by status alone — only the DVR
|
||||
/// adapter knows that call site's semantics, so it rethrows this type and UI
|
||||
/// maps it to the "already scheduled" outcome without a backend check.
|
||||
class RecordingConflictException extends MediaServerException {
|
||||
const RecordingConflictException(super.message, {super.display});
|
||||
}
|
||||
|
||||
/// The server explicitly terminated the client's playback session (admin
|
||||
/// "stop stream", paused-too-long auto-termination, concurrent-stream limit).
|
||||
///
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -70,29 +71,73 @@ extension DpadKeyExtension on LogicalKeyboardKey {
|
||||
bool get isDownKey => this == LogicalKeyboardKey.arrowDown;
|
||||
}
|
||||
|
||||
/// Base class for suppressing key-up events after a key category triggers an
|
||||
/// action (e.g. opening a sheet). While suppressed, all events for the matched
|
||||
/// key category are consumed; suppression auto-clears on [KeyUpEvent].
|
||||
/// Base class for suppressing key events after a key category triggers an
|
||||
/// action (e.g. opening a sheet). While suppressed, every event of the matched
|
||||
/// key category is consumed — including a [KeyDownEvent] when
|
||||
/// [consumeKeyDowns] is set, because an armer running in the
|
||||
/// [HardwareKeyboard] handler phase (the hotkey recorder) arms against the
|
||||
/// very KeyDown that is then re-dispatched through the focus tree.
|
||||
///
|
||||
/// Suppression ends with the physical press: a global [HardwareKeyboard]
|
||||
/// observer watches for the matching [KeyUpEvent] and clears the armed state
|
||||
/// in a microtask — after that KeyUp's own synchronous focus dispatch, so
|
||||
/// focus-phase consumers still swallow it — which guarantees a stale armed
|
||||
/// state (a KeyUp delivered to a focus chain that never consulted us) can
|
||||
/// never swallow the next press.
|
||||
///
|
||||
/// Armers that target an in-flight KeyUp ([consumeKeyDowns] unset) treat a
|
||||
/// matching [KeyDownEvent] as proof the suppressed press already ended without
|
||||
/// its KeyUp reaching us (e.g. a closing TV IME session ate it): the armed
|
||||
/// state is cleared and the fresh press passes through unconsumed.
|
||||
class _KeyUpSuppressor {
|
||||
final bool Function(LogicalKeyboardKey) _keyMatcher;
|
||||
|
||||
_KeyUpSuppressor(this._keyMatcher);
|
||||
/// Whether a matching [KeyDownEvent] is consumed while armed. See the class
|
||||
/// documentation for why armers targeting an in-flight KeyUp must unset it.
|
||||
final bool consumeKeyDowns;
|
||||
|
||||
_KeyUpSuppressor(this._keyMatcher, {this.consumeKeyDowns = true});
|
||||
|
||||
bool _suppressed = false;
|
||||
|
||||
void suppress() => _suppressed = true;
|
||||
void suppress() {
|
||||
// Re-registered on every arm because flutter_test's HardwareKeyboard
|
||||
// clearState() drops handlers between tests; remove-then-add keeps exactly
|
||||
// one live registration. The observer only reads state and returns false,
|
||||
// so it can never consume an event, and it is intentionally never removed
|
||||
// outside re-registration.
|
||||
HardwareKeyboard.instance
|
||||
..removeHandler(_observeKeyUp)
|
||||
..addHandler(_observeKeyUp);
|
||||
_suppressed = true;
|
||||
}
|
||||
|
||||
bool _observeKeyUp(KeyEvent event) {
|
||||
if (_suppressed && event is KeyUpEvent && _keyMatcher(event.logicalKey)) {
|
||||
// The hardware phase runs before the same event's focus dispatch;
|
||||
// clearing in a microtask keeps the armed state visible to the KeyUp's
|
||||
// focus-phase consumers while ending it before any later event.
|
||||
scheduleMicrotask(clearSuppression);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void clearSuppression() => _suppressed = false;
|
||||
|
||||
/// Returns `true` (consumed) when the event belongs to the matched key
|
||||
/// category and suppression is active. Clears suppression on [KeyUpEvent].
|
||||
/// category and suppression is active. Clears suppression on [KeyUpEvent],
|
||||
/// and on a stale [KeyDownEvent] when [consumeKeyDowns] is unset.
|
||||
bool consumeIfSuppressed(KeyEvent event) {
|
||||
if (!_suppressed) return false;
|
||||
if (_keyMatcher(event.logicalKey)) {
|
||||
if (event is KeyUpEvent) _suppressed = false;
|
||||
return true;
|
||||
if (!_keyMatcher(event.logicalKey)) return false;
|
||||
if (event is KeyUpEvent) _suppressed = false;
|
||||
if (event is KeyDownEvent && !consumeKeyDowns) {
|
||||
// The in-flight KeyUp never arrived; this is a fresh press, not the
|
||||
// suppressed one. Clear and let it through.
|
||||
_suppressed = false;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,10 +153,13 @@ class SelectKeyUpSuppressor {
|
||||
/// Global helper to suppress the next BACK key-up event.
|
||||
///
|
||||
/// Armed when a modal (dialog, sheet) closes while a back key is still held —
|
||||
/// e.g. by [BackKeySuppressorObserver] when a route pops mid-press — so the
|
||||
/// in-flight key-up doesn't propagate to the underlying screen's back handler.
|
||||
/// e.g. by [BackKeySuppressorObserver] when a route pops mid-press — or when a
|
||||
/// down-only back handler moves focus before the matching KeyUp is dispatched.
|
||||
/// A matching KeyDown while armed clears the arming instead of consuming: it
|
||||
/// can only mean the suppressed press's KeyUp was swallowed off-app, so the
|
||||
/// fresh press must act normally.
|
||||
class BackKeyUpSuppressor {
|
||||
static final _instance = _KeyUpSuppressor((k) => k.isBackKey);
|
||||
static final _instance = _KeyUpSuppressor((k) => k.isBackKey, consumeKeyDowns: false);
|
||||
|
||||
static void suppressBackUntilKeyUp() => _instance.suppress();
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ Widget buildFocusChrome(
|
||||
bool useBackgroundFocus = false,
|
||||
bool useFocusGlow = false,
|
||||
bool delegateFocusBorder = false,
|
||||
bool? showGlow,
|
||||
Size? glowSize,
|
||||
required Widget child,
|
||||
}) {
|
||||
@@ -44,10 +45,12 @@ Widget buildFocusChrome(
|
||||
}
|
||||
|
||||
// Glow (full-bleed cards) renders in an overlay above siblings so it stays
|
||||
// symmetric; the in-card decoration only carries the border.
|
||||
// symmetric; the in-card decoration only carries the border. [showGlow] lets
|
||||
// callers hold back just the glow (e.g. while a viewport scroll animates)
|
||||
// without touching the border or scale chrome.
|
||||
if (useFocusGlow) {
|
||||
card = FocusGlowOverlay(
|
||||
isFocused: showFocus,
|
||||
isFocused: showGlow ?? showFocus,
|
||||
borderRadius: borderRadius,
|
||||
color: focusColor ?? FocusTheme.getFocusBorderColor(context),
|
||||
glowSize: glowSize,
|
||||
|
||||
@@ -57,6 +57,12 @@ class _FocusGlowOverlayState extends State<FocusGlowOverlay> {
|
||||
/// fades out before the portal is hidden in [_handleFadeEnd].
|
||||
bool _visible = false;
|
||||
|
||||
/// Whether the previous [build] mounted the [OverlayPortal] — i.e. whether
|
||||
/// [_controller] is attached. An attached controller's show()/hide() assert
|
||||
/// when called during build, so [didUpdateWidget] must defer; a detached
|
||||
/// controller's show() merely records pending state and is build-safe.
|
||||
bool _portalInTree = false;
|
||||
|
||||
/// Glow is skipped on the reduced effects tier (blurred shadows + fade
|
||||
/// saveLayer are too expensive on weak GPUs) and when the user turned the
|
||||
/// Focus Glow setting off (#1278). The crisp focus border remains.
|
||||
@@ -77,12 +83,25 @@ class _FocusGlowOverlayState extends State<FocusGlowOverlay> {
|
||||
if (_disabled) return;
|
||||
if (widget.isFocused == oldWidget.isFocused) return;
|
||||
if (widget.isFocused) {
|
||||
_controller.show();
|
||||
// Start hidden, then fade in next frame.
|
||||
_visible = false;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted && widget.isFocused) setState(() => _visible = true);
|
||||
});
|
||||
if (_portalInTree) {
|
||||
// The portal from a previous glow session is still attached (mid
|
||||
// fade-out, or the rail held the glow back during a vertical scroll):
|
||||
// show() would assert during build, so defer it out of the frame and
|
||||
// fade back in from wherever the fade-out got to.
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted || !widget.isFocused) return;
|
||||
if (!_controller.isShowing) _controller.show();
|
||||
setState(() => _visible = true);
|
||||
});
|
||||
} else {
|
||||
// Detached: a build-time show() only records pending state, applied
|
||||
// when this build mounts the portal. Start hidden, fade in next frame.
|
||||
_controller.show();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted && widget.isFocused) setState(() => _visible = true);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Fade out; _handleFadeEnd hides the portal once opacity reaches 0.
|
||||
setState(() => _visible = false);
|
||||
@@ -98,13 +117,18 @@ class _FocusGlowOverlayState extends State<FocusGlowOverlay> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_disabled) return widget.child;
|
||||
if (_disabled) {
|
||||
_portalInTree = false;
|
||||
return widget.child;
|
||||
}
|
||||
|
||||
// Gate the LeaderLayer to the focused card only: when not focused and not
|
||||
// mid-fade, return the bare child (no OverlayPortal, no leader).
|
||||
if (!widget.isFocused && !_controller.isShowing) {
|
||||
_portalInTree = false;
|
||||
return widget.child;
|
||||
}
|
||||
_portalInTree = true;
|
||||
|
||||
final duration = FocusTheme.getAnimationDuration(context);
|
||||
|
||||
|
||||
@@ -33,6 +33,26 @@ class DirectionalShortcutFocusNode extends FocusNode {
|
||||
node is DirectionalShortcutFocusNode && node.consumesDirectionalKeys(key);
|
||||
}
|
||||
|
||||
/// A [FocusNode] for a locked-focus row: the node spans the whole row while
|
||||
/// its owner steps an internal selection index between the row's items.
|
||||
///
|
||||
/// Swipe-step pricing follows the focused *item's* geometry (see
|
||||
/// `AppleTvRemoteTouchService`), and for a locked-focus row the node's own
|
||||
/// rect is the row — screen-wide — which would price a swipe step at the
|
||||
/// travel cap and make the row feel dead. The owner instead vends the
|
||||
/// selected item's global rect here; a null return (item not built yet,
|
||||
/// unknown geometry) falls back to the fixed step distance.
|
||||
///
|
||||
/// Like [DirectionalShortcutFocusNode], the fact rides on the node because it
|
||||
/// depends on what has focus, not on where a widget sits.
|
||||
class LockedFocusRowNode extends FocusNode {
|
||||
LockedFocusRowNode({required this.focusedItemRect, super.debugLabel, super.skipTraversal});
|
||||
|
||||
/// Global rect of the row's currently selected item, evaluated per swipe
|
||||
/// frame so selection moves need no syncing.
|
||||
final Rect? Function() focusedItemRect;
|
||||
}
|
||||
|
||||
/// Whether [event] is evidence that the viewer wants to navigate by focus.
|
||||
///
|
||||
/// This is the single answer to two questions that must never disagree:
|
||||
|
||||
@@ -130,8 +130,7 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
void didUpdateWidget(FocusableActionBar oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (_shouldRebuildFocusNodes(oldWidget)) {
|
||||
_disposeNodes();
|
||||
_initNodes();
|
||||
_rebindNodes(oldWidget.actions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,31 +143,120 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
return false;
|
||||
}
|
||||
|
||||
void _initNodes() {
|
||||
_focusBindings = [];
|
||||
_focusNodes = [];
|
||||
_focusStates = List<bool>.filled(widget.actions.length, false);
|
||||
for (var i = 0; i < widget.actions.length; i++) {
|
||||
final index = i;
|
||||
final binding = OwnedFocusNodeBinding();
|
||||
binding.bind(
|
||||
externalNode: widget.actions[i].focusNode,
|
||||
debugLabel: widget.actions[i].debugLabel ?? 'ActionBar[$i]',
|
||||
listener: () {
|
||||
final hasFocus = _focusNodes[index].hasFocus;
|
||||
if (_focusStates[index] != hasFocus) {
|
||||
setState(() => _focusStates[index] = hasFocus);
|
||||
}
|
||||
_notifyRowFocusIfChanged();
|
||||
},
|
||||
);
|
||||
_focusBindings.add(binding);
|
||||
_focusNodes.add(binding.node);
|
||||
_focusStates[i] = binding.node.hasFocus;
|
||||
/// Stable identity for matching an action across list changes: the supplied
|
||||
/// [FocusableAction.focusNode] first, else [FocusableAction.debugLabel].
|
||||
/// Unlabeled actions have no identity and only ever match positionally.
|
||||
static Object? _actionIdentity(FocusableAction action) => action.focusNode ?? action.debugLabel;
|
||||
|
||||
/// Whether the action-list shape is unchanged: same length and every
|
||||
/// labeled identity present in both lists sits at the index it had. Only
|
||||
/// then does an unlabeled action's position provably still refer to the
|
||||
/// same conceptual action.
|
||||
bool _unlabeledPositionsStable(List<FocusableAction> oldActions) {
|
||||
if (oldActions.length != widget.actions.length) return false;
|
||||
for (var i = 0; i < oldActions.length; i++) {
|
||||
final identity = _actionIdentity(oldActions[i]);
|
||||
if (identity == null) continue;
|
||||
for (var j = 0; j < widget.actions.length; j++) {
|
||||
if (j != i && _actionIdentity(widget.actions[j]) == identity) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
OwnedFocusNodeBinding _createBinding(FocusableAction action, int index) {
|
||||
final binding = OwnedFocusNodeBinding();
|
||||
binding.bind(
|
||||
externalNode: action.focusNode,
|
||||
debugLabel: action.debugLabel ?? 'ActionBar[$index]',
|
||||
listener: () => _handleBindingFocusChange(binding),
|
||||
);
|
||||
return binding;
|
||||
}
|
||||
|
||||
/// Index resolved at call time: a binding survives action-list changes, so
|
||||
/// a listener must not capture the slot it was created for.
|
||||
void _handleBindingFocusChange(OwnedFocusNodeBinding binding) {
|
||||
final index = _focusBindings.indexOf(binding);
|
||||
if (index != -1) {
|
||||
final hasFocus = binding.node.hasFocus;
|
||||
if (_focusStates[index] != hasFocus) {
|
||||
setState(() => _focusStates[index] = hasFocus);
|
||||
}
|
||||
}
|
||||
_notifyRowFocusIfChanged();
|
||||
}
|
||||
|
||||
void _initNodes() {
|
||||
_focusBindings = [for (var i = 0; i < widget.actions.length; i++) _createBinding(widget.actions[i], i)];
|
||||
_focusNodes = [for (final binding in _focusBindings) binding.node];
|
||||
_focusStates = [for (final node in _focusNodes) node.hasFocus];
|
||||
_hasAnyFocus = _focusNodes.any((node) => node.hasFocus);
|
||||
}
|
||||
|
||||
/// Rebind on an action-list change, reusing the binding of every action
|
||||
/// whose identity survives so its focus node is not disposed out from under
|
||||
/// the user (media detail's watchlist action arrives asynchronously and
|
||||
/// used to drop D-pad focus with the wholesale rebuild). A removed focused
|
||||
/// action is disposed with its listener already detached, so the genuine
|
||||
/// row-focus loss is reported through [_notifyRowFocusIfChanged] here.
|
||||
void _rebindNodes(List<FocusableAction> oldActions) {
|
||||
final oldBindings = _focusBindings;
|
||||
final focusedOldIndex = _focusNodes.indexWhere((node) => node.hasFocus);
|
||||
|
||||
final claimed = List<bool>.filled(oldBindings.length, false);
|
||||
final unlabeledPositionsStable = _unlabeledPositionsStable(oldActions);
|
||||
int? matchOldIndex(int newIndex) {
|
||||
final identity = _actionIdentity(widget.actions[newIndex]);
|
||||
if (identity != null) {
|
||||
for (var i = 0; i < oldActions.length; i++) {
|
||||
if (!claimed[i] && _actionIdentity(oldActions[i]) == identity) return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// Positional reuse is the only option for an unlabeled action, but it
|
||||
// is only provably correct while the list shape is unchanged; across an
|
||||
// insertion/removal its successor is unknowable, so fall through to a
|
||||
// fresh binding — genuinely dropping focus beats silently retargeting
|
||||
// the focused binding (and its next Select) onto a different action.
|
||||
if (unlabeledPositionsStable && !claimed[newIndex] && _actionIdentity(oldActions[newIndex]) == null) {
|
||||
return newIndex;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
var focusedNewIndex = -1;
|
||||
final newBindings = <OwnedFocusNodeBinding>[];
|
||||
for (var i = 0; i < widget.actions.length; i++) {
|
||||
final oldIndex = matchOldIndex(i);
|
||||
if (oldIndex == null) {
|
||||
newBindings.add(_createBinding(widget.actions[i], i));
|
||||
continue;
|
||||
}
|
||||
claimed[oldIndex] = true;
|
||||
if (oldIndex == focusedOldIndex) focusedNewIndex = i;
|
||||
newBindings.add(oldBindings[oldIndex]);
|
||||
}
|
||||
|
||||
_focusBindings = newBindings;
|
||||
_focusNodes = [for (final binding in newBindings) binding.node];
|
||||
_focusStates = [for (final node in _focusNodes) node.hasFocus];
|
||||
|
||||
for (var i = 0; i < oldBindings.length; i++) {
|
||||
if (!claimed[i]) oldBindings[i].dispose();
|
||||
}
|
||||
|
||||
// The focused action survived: keep focus on it. The keyed row keeps its
|
||||
// Focus element attached across reorders, so this only re-requests focus
|
||||
// if the framework unfocused the node during widget churn.
|
||||
if (focusedNewIndex != -1 &&
|
||||
widget.actions[focusedNewIndex].onPressed != null &&
|
||||
!_focusNodes[focusedNewIndex].hasFocus) {
|
||||
_focusNodes[focusedNewIndex].requestFocus();
|
||||
}
|
||||
_notifyRowFocusIfChanged();
|
||||
}
|
||||
|
||||
void _notifyRowFocusIfChanged() {
|
||||
final hasAnyFocus = _focusNodes.any((node) => node.hasFocus);
|
||||
if (_hasAnyFocus == hasAnyFocus) return;
|
||||
@@ -223,6 +311,9 @@ class FocusableActionBarState extends State<FocusableActionBar> {
|
||||
final customChild = action.builder?.call(context, buildState);
|
||||
|
||||
return Focus(
|
||||
// Keyed on the binding so an insertion moves the element with its node
|
||||
// instead of detaching (and thereby unfocusing) it slot by slot.
|
||||
key: ObjectKey(_focusBindings[index]),
|
||||
focusNode: _focusNodes[index],
|
||||
canRequestFocus: enabled,
|
||||
autofocus: action.autofocus && enabled,
|
||||
|
||||
@@ -227,9 +227,32 @@ KeyEventResult _handleInputKey({
|
||||
if (result != KeyEventResult.ignored) return finish(result, 'custom-tv-hardware-keyboard');
|
||||
}
|
||||
|
||||
if (onBack != null && key.isBackKey) {
|
||||
if (event is KeyDownEvent) onBack();
|
||||
return finish(KeyEventResult.handled, 'onBack');
|
||||
if (onBack != null && event.logicalKey.isBackKey) {
|
||||
// On TV the native text-input path can swallow the matching KeyUp (the
|
||||
// closing IME session eats it), so back fires on KeyDown — the same
|
||||
// down-only shape as [handleBackKeyAction]'s Apple TV branch, coordinator
|
||||
// mark included so a parallel back dispatch still dedupes. Elsewhere the
|
||||
// shared handler's KeyUp semantics apply.
|
||||
if (PlatformDetector.isTV()) {
|
||||
if (BackKeyUpSuppressor.consumeIfSuppressed(event)) return finish(KeyEventResult.handled, 'onBack');
|
||||
if (event is KeyDownEvent) {
|
||||
BackKeyCoordinator.markHandled();
|
||||
onBack();
|
||||
// onBack may move focus (empty search field -> sidebar); the matching
|
||||
// KeyUp is then delivered to the NEW focus chain, whose shared
|
||||
// handlers act on KeyUp — a second back action. Arm the suppressor
|
||||
// (after onBack, so a modal opened by it cannot clear the arming) so
|
||||
// whichever chain receives the KeyUp swallows it. This cannot pin:
|
||||
// the suppressor's hardware observer clears the armed state once the
|
||||
// physical press ends, and if the IME swallows that KeyUp entirely,
|
||||
// the next back KeyDown is treated as stale arming and passes
|
||||
// through — see _KeyUpSuppressor.
|
||||
BackKeyUpSuppressor.suppressBackUntilKeyUp();
|
||||
}
|
||||
return finish(KeyEventResult.handled, 'onBack');
|
||||
}
|
||||
final backResult = handleBackKeyAction(event, onBack);
|
||||
if (backResult != KeyEventResult.ignored) return finish(backResult, 'onBack');
|
||||
}
|
||||
|
||||
// Enter/numpad enter are left to TextField.onSubmitted. Handle only
|
||||
|
||||
@@ -76,11 +76,10 @@ KeyEventResult handleBackKeyAction(KeyEvent event, VoidCallback onBack) {
|
||||
// AppleTV back (Siri Remote Menu via engine-synthesized escape): run onBack
|
||||
// on KeyDown only; consume KeyUp silently. Some engine paths report Menu as
|
||||
// a non-keyboard device, but the same down-only handling is still required.
|
||||
// The suppressor-based "arm-on-KeyDown, clear-on-KeyUp" pattern leaks here
|
||||
// because onBack typically calls Navigator.pop, swapping the focus tree
|
||||
// before the matching KeyUp is dispatched — the orphaned KeyUp then never
|
||||
// reaches a consumeIfSuppressed call, pinning the suppressor armed and
|
||||
// silently swallowing the next press's KeyDown.
|
||||
// No suppressor arming is needed here: onBack typically calls
|
||||
// Navigator.pop, swapping the focus tree before the matching KeyUp is
|
||||
// dispatched — but the orphaned KeyUp lands on the new chain, where this
|
||||
// same branch consumes it silently.
|
||||
if (PlatformDetector.isAppleTV()) {
|
||||
if (event is KeyDownEvent) {
|
||||
BackKeyCoordinator.markHandled();
|
||||
@@ -246,10 +245,10 @@ class BackKeySuppressorObserver extends NavigatorObserver {
|
||||
@override
|
||||
void didPop(Route route, Route? previousRoute) {
|
||||
// On AppleTV, handleBackKeyAction consumes the KeyUp silently regardless,
|
||||
// so the suppressor isn't needed and arming it would pin state across the
|
||||
// pop's focus-tree swap. (The atomic engine fix delivers KeyDown+KeyUp in
|
||||
// a single recognizer Began callback, so didPop fires squarely inside the
|
||||
// window where BackKeyPressTracker.isBackKeyDown is true.)
|
||||
// so the suppressor isn't needed. (The atomic engine fix delivers
|
||||
// KeyDown+KeyUp in a single recognizer Began callback, so didPop fires
|
||||
// squarely inside the window where BackKeyPressTracker.isBackKeyDown is
|
||||
// true.)
|
||||
if (PlatformDetector.isAppleTV()) return;
|
||||
if (BackKeyPressTracker.isBackKeyDown) {
|
||||
BackKeyUpSuppressor.suppressBackUntilKeyUp();
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serial",
|
||||
"season": "Sezon",
|
||||
"episode": "Epizod",
|
||||
"artist": "İfaçı",
|
||||
"album": "Albom",
|
||||
"track": "Mahnı",
|
||||
"collection": "Kolleksiya",
|
||||
"playlist": "Pleylist",
|
||||
"clip": "Klip",
|
||||
"photo": "Şəkil",
|
||||
"folder": "Qovluq"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Lisenziyalar",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Oynatma zamanı tətbiqdən çıxdıqda avtomatik PiP rejiminə keç",
|
||||
"matchContentFrameRate": "Kadr tezliyini uyğunlaşdır",
|
||||
"matchContentFrameRateDescription": "Ekran yenilənmə tezliyini video məzmununa uyğunlaşdır",
|
||||
"matchContentResolution": "Məzmunun görüntü keyfiyyətinə uyğunlaş",
|
||||
"matchContentResolutionDescription": "Ekranı videonun öz görüntü keyfiyyətinə keçirir ki, miqyaslandırmanı televizorunuz etsin. Oxutma zamanı menyular və altyazılar da miqyaslandırılır",
|
||||
"matchRefreshRate": "Yenilənmə tezliyini uyğunlaşdır",
|
||||
"matchRefreshRateDescription": "Tam ekranda ekran yenilənmə tezliyini uyğunlaşdır",
|
||||
"matchDynamicRange": "Dinamik diapazonu uyğunlaşdır",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Daxili DV7-ni məcburi et",
|
||||
"dvConversionDv81Description": "Dolby Vision profile 8.1-ə çevrilməni məcburi et",
|
||||
"dvConversionHevcStripDescription": "Dolby Vision təbəqələrini sil və sadə HEVC kimi təqdim et",
|
||||
"demuxer": "Konteyner demukseri",
|
||||
"demuxerDescription": "Birbaşa oxudulan faylları hansı demukserin təhlil edəcəyi. Fayl düzgün işləmirsə, media3-ə keçin.",
|
||||
"demuxerFfmpeg": "FFmpeg (Tövsiyə olunan)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Açılışda profil soruş",
|
||||
"requireProfileSelectionOnOpenDescription": "Tətbiq hər dəfə açıldıqda profil seçimini göstər",
|
||||
"forceTvMode": "TV rejimini məcburi et",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Cihaz PiP rejimini dəstəkləmir",
|
||||
"voSwitchFailed": "PiP üçün video çıxışı dəyişdirilə bilmədi",
|
||||
"failed": "PiP rejimi başladılarkən xəta",
|
||||
"prepareFailed": "PiP rejimi hazırlana bilmədi",
|
||||
"unknown": "Xəta baş verdi: ${error}"
|
||||
},
|
||||
"chapters": "Hissələr",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "${username} (${email}) üçün server tapılmadı",
|
||||
"failedToLoadServers": "Serverlər yüklənə bilmədi: ${error}"
|
||||
"failedToLoadServers": "Serverlər yüklənə bilmədi: ${error}",
|
||||
"noValidServers": "Bu hesabda istifadəyə yararlı server tapılmadı"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Başlıq",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Bələdçi yenilənməsi tələb olundu",
|
||||
"rulesProcessRequested": "Qaydaların yenidən qiymətləndirilməsi tələb olundu",
|
||||
"recordShow": "Şounu yaz",
|
||||
"recordSettings": {
|
||||
"startEarly": "Erkən başla (saniyə)",
|
||||
"endLate": "Gec bitir (saniyə)",
|
||||
"newOnly": "Yalnız yeni epizodlar",
|
||||
"anyChannel": "İstənilən kanalda yaz",
|
||||
"anyTime": "İstənilən vaxt yaz",
|
||||
"skipInLibrary": "Kitabxanada artıq olan epizodları ötür",
|
||||
"keepUpTo": "Saxlanılacaq epizodlar",
|
||||
"keepUpToHint": "0 bütün epizodları saxlayır"
|
||||
},
|
||||
"startingInMinutes": "${minutes} dəq sonra başlayır",
|
||||
"dayAtTime": "${day}, saat ${time}",
|
||||
"invalidPlaybackData": "${product} etibarsız Canlı TV oynatma məlumatı qaytardı",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Sil",
|
||||
"guestSwitchUnavailable": "Keçid etmək olmadı — eyniləşdirmə üçün server əlçatan deyil",
|
||||
"guestSwitchFailed": "Keçid etmək olmadı — məzmun tapılmadı",
|
||||
"defaultDisplayName": "İstifadəçi"
|
||||
"defaultDisplayName": "İstifadəçi",
|
||||
"errors": {
|
||||
"timedOut": "Rele serveri vaxtında cavab vermədi",
|
||||
"connectionLost": "Bağlantı seans hazır olmamış kəsildi",
|
||||
"invalidRelayResponse": "Rele serveri gözlənilməz cavab göndərdi",
|
||||
"sessionEnded": "Təşkilatçı seansı bitirdi"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Yükləmələr",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Bu tətbiqi idarə etmək üçün mobil cihazınızı istifadə edin",
|
||||
"startServer": "Serveri başlat",
|
||||
"stopServer": "Serveri dayandır",
|
||||
"minimize": "Yığ"
|
||||
"minimize": "Yığ",
|
||||
"manualAddressHint": "Əl ilə bağlantı ünvanı:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Eyni Plex hesabına sahib Plezy cihazları burada görünür",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Hissəvi əlçatandır",
|
||||
"statusRequested": "Sorğu göndərildi",
|
||||
"statusProcessing": "Emal edilir",
|
||||
"statusBlocklisted": "Bloklanmış",
|
||||
"couldNotReach": "${url} ünvanına çatmaq olmadı: ${error}",
|
||||
"noInstanceAtUrl": "${url} ünvanında Seerr instansiyası yoxdur (HTTP ${status})",
|
||||
"notInitialized": "Bu Seerr instansiyasının ilkin quraşdırılması tamamlanmayıb",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Başqa profilin qoşulmasını yenidən istifadə edin.",
|
||||
"invalidCredentials": "İstifadəçi adı və ya şifrə yanlışdır",
|
||||
"authResponseNotJson": "Autentifikasiya cavabı etibarlı JSON deyildi",
|
||||
"authResponseIncomplete": "Serverin giriş cavabı natamam idi",
|
||||
"quickConnectRejected": "Quick Connect server tərəfindən rədd edildi",
|
||||
"quickConnectNotJson": "Quick Connect cavabı etibarlı JSON deyildi",
|
||||
"quickConnectMissingFields": "Quick Connect cavabında kod və ya məxfi açar yoxdur",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "Н/Д",
|
||||
"url": "URL",
|
||||
"letterKeys": "АБВ"
|
||||
"letterKeys": "АБВ",
|
||||
"mediaKind": {
|
||||
"movie": "Филм",
|
||||
"show": "Сериал",
|
||||
"season": "Сезон",
|
||||
"episode": "Епизод",
|
||||
"artist": "Изпълнител",
|
||||
"album": "Албум",
|
||||
"track": "Песен",
|
||||
"collection": "Колекция",
|
||||
"playlist": "Плейлист",
|
||||
"clip": "Клип",
|
||||
"photo": "Снимка",
|
||||
"folder": "Папка"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Лицензи",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Автоматично включвай режима картина в картината при излизане от приложението по време на възпроизвеждане",
|
||||
"matchContentFrameRate": "Напасване към кадровата честота на съдържанието",
|
||||
"matchContentFrameRateDescription": "Напасни честотата на опресняване на дисплея към видео съдържанието",
|
||||
"matchContentResolution": "Съобразяване с разделителната способност на съдържанието",
|
||||
"matchContentResolutionDescription": "Превключва дисплея към собствената разделителна способност на видеото, за да се погрижи телевизорът за мащабирането. По време на възпроизвеждане менютата и субтитрите също се мащабират",
|
||||
"matchRefreshRate": "Напасване на честотата на опресняване",
|
||||
"matchRefreshRateDescription": "Напасни честотата на опресняване на дисплея при цял екран",
|
||||
"matchDynamicRange": "Напасване на динамичния диапазон",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Принуждава директно възпроизвеждане на DV7 и изключва повторния опит за преобразуване",
|
||||
"dvConversionDv81Description": "Принуждава директно преобразуване на RPU към Dolby Vision Profile 8.1",
|
||||
"dvConversionHevcStripDescription": "Премахва слоевете Dolby Vision RPU/EL и подава обикновен HEVC поток",
|
||||
"demuxer": "Демултиплексор на контейнера",
|
||||
"demuxerDescription": "Кой демултиплексор анализира файловете при директно възпроизвеждане. Превключете на media3, ако даден файл създава проблеми.",
|
||||
"demuxerFfmpeg": "FFmpeg (препоръчително)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Питай за профил при отваряне на приложението",
|
||||
"requireProfileSelectionOnOpenDescription": "Показвай избор на профил всеки път при отваряне на приложението",
|
||||
"forceTvMode": "Принуди TV режим",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Устройството не поддържа режим картина в картината",
|
||||
"voSwitchFailed": "Неуспешна смяна на видео изхода за режим картина в картината",
|
||||
"failed": "Режимът картина в картината не успя да стартира",
|
||||
"prepareFailed": "Режимът картина в картината не можа да бъде подготвен",
|
||||
"unknown": "Възникна грешка: ${error}"
|
||||
},
|
||||
"chapters": "Глави",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Не са намерени сървъри за ${username} (${email})",
|
||||
"failedToLoadServers": "Неуспешно зареждане на сървъри: ${error}"
|
||||
"failedToLoadServers": "Неуспешно зареждане на сървъри: ${error}",
|
||||
"noValidServers": "Не бяха намерени използваеми сървъри в този акаунт"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Заглавие",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Заявено е опресняване на ТВ програмата",
|
||||
"rulesProcessRequested": "Заявена е преоценка на правилата",
|
||||
"recordShow": "Запиши предаването",
|
||||
"recordSettings": {
|
||||
"startEarly": "Започване по-рано (секунди)",
|
||||
"endLate": "Приключване по-късно (секунди)",
|
||||
"newOnly": "Само нови епизоди",
|
||||
"anyChannel": "Записване от всеки канал",
|
||||
"anyTime": "Записване по всяко време",
|
||||
"skipInLibrary": "Пропускане на епизоди, които вече са в библиотеката",
|
||||
"keepUpTo": "Епизоди за запазване",
|
||||
"keepUpToHint": "0 запазва всички епизоди"
|
||||
},
|
||||
"startingInMinutes": "Започва след ${minutes} мин",
|
||||
"dayAtTime": "${day} в ${time}",
|
||||
"invalidPlaybackData": "${product} върна невалидни данни за възпроизвеждане на телевизия на живо",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Премахни",
|
||||
"guestSwitchUnavailable": "Превключването не е възможно — сървърът е недостъпен за синхронизация",
|
||||
"guestSwitchFailed": "Превключването не е възможно — съдържанието не е намерено на този сървър",
|
||||
"defaultDisplayName": "Потребител"
|
||||
"defaultDisplayName": "Потребител",
|
||||
"errors": {
|
||||
"timedOut": "Релейният сървър не отговори навреме",
|
||||
"connectionLost": "Връзката се затвори, преди сесията да е готова",
|
||||
"invalidRelayResponse": "Релейният сървър изпрати неочакван отговор",
|
||||
"sessionEnded": "Организаторът прекрати сесията"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Изтегляния",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Използвайте мобилното си устройство, за да управлявате това приложение",
|
||||
"startServer": "Стартирай сървър",
|
||||
"stopServer": "Спри сървър",
|
||||
"minimize": "Минимизирай"
|
||||
"minimize": "Минимизирай",
|
||||
"manualAddressHint": "Ръчен адрес за връзка:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Plezy устройства със същия Plex акаунт се показват тук",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Частично налично",
|
||||
"statusRequested": "Заявено",
|
||||
"statusProcessing": "Обработва се",
|
||||
"statusBlocklisted": "В списъка с блокирани",
|
||||
"couldNotReach": "Неуспешна връзка с ${url}: ${error}",
|
||||
"noInstanceAtUrl": "На ${url} няма инстанция на Seerr (HTTP ${status})",
|
||||
"notInitialized": "Тази инстанция на Seerr не е завършила първоначалната настройка",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Използвай връзка от друг профил. PIN-защитените профили изискват PIN.",
|
||||
"invalidCredentials": "Невалидно потребителско име или парола",
|
||||
"authResponseNotJson": "Отговорът при удостоверяване не беше валиден JSON",
|
||||
"authResponseIncomplete": "Отговорът за вход от сървъра беше непълен",
|
||||
"quickConnectRejected": "Quick Connect беше отхвърлен от сървъра",
|
||||
"quickConnectNotJson": "Отговорът на Quick Connect не беше валиден JSON",
|
||||
"quickConnectMissingFields": "В отговора на Quick Connect липсва код или таен ключ",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serie",
|
||||
"season": "Sæson",
|
||||
"episode": "Afsnit",
|
||||
"artist": "Kunstner",
|
||||
"album": "Album",
|
||||
"track": "Nummer",
|
||||
"collection": "Samling",
|
||||
"playlist": "Afspilningsliste",
|
||||
"clip": "Klip",
|
||||
"photo": "Foto",
|
||||
"folder": "Mappe"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licenser",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Skift automatisk til billede-i-billede, når du forlader appen under afspilning",
|
||||
"matchContentFrameRate": "Tilpas billedhastigheden til indholdet",
|
||||
"matchContentFrameRateDescription": "Tilpas skærmens opdateringsfrekvens til videoindhold",
|
||||
"matchContentResolution": "Tilpas til indholdets opløsning",
|
||||
"matchContentResolutionDescription": "Skifter skærmen til videoens oprindelige opløsning, så dit tv står for opskaleringen. Menuer og undertekster opskaleres også under afspilning",
|
||||
"matchRefreshRate": "Tilpas opdateringsfrekvensen",
|
||||
"matchRefreshRateDescription": "Tilpas skærmens opdateringsfrekvens i fuld skærm",
|
||||
"matchDynamicRange": "Tilpas dynamikområdet",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Gennemtving indbygget DV7-understøttelse, og undlad at forsøge DV-konvertering igen",
|
||||
"dvConversionDv81Description": "Tving inline RPU-konvertering til Dolby Vision profil 8.1",
|
||||
"dvConversionHevcStripDescription": "Fjern Dolby Vision RPU/EL-lag og brug almindelig HEVC",
|
||||
"demuxer": "Container-demuxer",
|
||||
"demuxerDescription": "Hvilken demuxer der læser direkte afspillede filer. Skift til media3, hvis en fil driller.",
|
||||
"demuxerFfmpeg": "FFmpeg (anbefalet)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Spørg om profil ved åbning",
|
||||
"requireProfileSelectionOnOpenDescription": "Vis profilvalg hver gang appen åbnes",
|
||||
"forceTvMode": "Gennemtving TV-tilstand",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Enheden understøtter ikke billede-i-billede",
|
||||
"voSwitchFailed": "Kunne ikke skifte videooutput til billede-i-billede",
|
||||
"failed": "Billede-i-billede kunne ikke starte",
|
||||
"prepareFailed": "Billede-i-billede kunne ikke forberedes",
|
||||
"unknown": "Der opstod en fejl: ${error}"
|
||||
},
|
||||
"chapters": "Kapitler",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Ingen servere fundet for ${username} (${email})",
|
||||
"failedToLoadServers": "Kunne ikke indlæse servere: ${error}"
|
||||
"failedToLoadServers": "Kunne ikke indlæse servere: ${error}",
|
||||
"noValidServers": "Der blev ikke fundet nogen brugbare servere på denne konto"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Titel",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Der er anmodet om en opdatering af guiden",
|
||||
"rulesProcessRequested": "Der er anmodet om en ny evaluering af reglerne",
|
||||
"recordShow": "Optag program",
|
||||
"recordSettings": {
|
||||
"startEarly": "Start tidligere (sekunder)",
|
||||
"endLate": "Slut senere (sekunder)",
|
||||
"newOnly": "Kun nye afsnit",
|
||||
"anyChannel": "Optag på alle kanaler",
|
||||
"anyTime": "Optag på alle tidspunkter",
|
||||
"skipInLibrary": "Spring afsnit over, der allerede er i biblioteket",
|
||||
"keepUpTo": "Afsnit der skal beholdes",
|
||||
"keepUpToHint": "0 beholder alle afsnit"
|
||||
},
|
||||
"startingInMinutes": "Starter om ${minutes} min",
|
||||
"dayAtTime": "${day} kl. ${time}",
|
||||
"invalidPlaybackData": "${product} returnerede ugyldige afspilningsdata for Live TV",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Fjern",
|
||||
"guestSwitchUnavailable": "Kunne ikke skifte — server ikke tilgængelig for synkronisering",
|
||||
"guestSwitchFailed": "Kunne ikke skifte — indhold blev ikke fundet på denne server",
|
||||
"defaultDisplayName": "Bruger"
|
||||
"defaultDisplayName": "Bruger",
|
||||
"errors": {
|
||||
"timedOut": "Relayserveren svarede ikke i tide",
|
||||
"connectionLost": "Forbindelsen blev lukket, før sessionen var klar",
|
||||
"invalidRelayResponse": "Relayserveren sendte et uventet svar",
|
||||
"sessionEnded": "Værten afsluttede sessionen"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Downloads",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Brug din mobilenhed til at styre denne app",
|
||||
"startServer": "Start serveren",
|
||||
"stopServer": "Stop serveren",
|
||||
"minimize": "Minimér"
|
||||
"minimize": "Minimér",
|
||||
"manualAddressHint": "Manuel forbindelsesadresse:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Plezy-enheder med samme Plex-konto vises her",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Delvist tilgængelig",
|
||||
"statusRequested": "Anmodet",
|
||||
"statusProcessing": "Behandler",
|
||||
"statusBlocklisted": "På blokeringslisten",
|
||||
"couldNotReach": "Kunne ikke nå ${url}: ${error}",
|
||||
"noInstanceAtUrl": "Ingen Seerr-instans på ${url} (HTTP ${status})",
|
||||
"notInitialized": "Denne Seerr-instans har ikke fuldført førstegangsopsætningen",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Genbrug en anden profils forbindelse. PIN-beskyttede profiler kræver en PIN.",
|
||||
"invalidCredentials": "Ugyldigt brugernavn eller ugyldig adgangskode",
|
||||
"authResponseNotJson": "Godkendelsessvaret var ikke gyldig JSON",
|
||||
"authResponseIncomplete": "Loginsvaret fra serveren var ufuldstændigt",
|
||||
"quickConnectRejected": "Quick Connect blev afvist af serveren",
|
||||
"quickConnectNotJson": "Quick Connect-svaret var ikke gyldig JSON",
|
||||
"quickConnectMissingFields": "Quick Connect-svaret mangler en kode eller hemmelighed",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N. v.",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serie",
|
||||
"season": "Staffel",
|
||||
"episode": "Episode",
|
||||
"artist": "Interpret",
|
||||
"album": "Album",
|
||||
"track": "Titel",
|
||||
"collection": "Sammlung",
|
||||
"playlist": "Wiedergabeliste",
|
||||
"clip": "Clip",
|
||||
"photo": "Foto",
|
||||
"folder": "Ordner"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Lizenzen",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Beim Verlassen der App während der Wiedergabe automatisch Bild-in-Bild starten",
|
||||
"matchContentFrameRate": "Inhalts-Bildrate anpassen",
|
||||
"matchContentFrameRateDescription": "Bildwiederholrate des Displays an Videoinhalt anpassen",
|
||||
"matchContentResolution": "An Auflösung des Inhalts anpassen",
|
||||
"matchContentResolutionDescription": "Wechselt die Anzeige auf die native Auflösung des Videos, damit dein Fernseher das Hochskalieren übernimmt. Menüs und Untertitel werden während der Wiedergabe ebenfalls hochskaliert",
|
||||
"matchRefreshRate": "Bildwiederholrate anpassen",
|
||||
"matchRefreshRateDescription": "Bildwiederholrate im Vollbild anpassen",
|
||||
"matchDynamicRange": "Dynamikumfang anpassen",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Natives DV7 erzwingen und einen erneuten DV-Konvertierungsversuch unterdrücken",
|
||||
"dvConversionDv81Description": "Inline-RPU-Konvertierung in Dolby-Vision-Profil 8.1 erzwingen",
|
||||
"dvConversionHevcStripDescription": "Dolby-Vision-RPU/EL-Schichten entfernen und reines HEVC ausgeben",
|
||||
"demuxer": "Container-Demuxer",
|
||||
"demuxerDescription": "Welcher Demuxer direkt abgespielte Dateien einliest. Wechsle zu media3, wenn eine Datei Probleme macht.",
|
||||
"demuxerFfmpeg": "FFmpeg (empfohlen)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Profil beim Öffnen abfragen",
|
||||
"requireProfileSelectionOnOpenDescription": "Profilauswahl bei jedem Öffnen der App anzeigen",
|
||||
"forceTvMode": "TV-Modus erzwingen",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Dieses Gerät unterstützt den Bild-in-Bild-Modus nicht",
|
||||
"voSwitchFailed": "Videoausgabe für Bild-in-Bild konnte nicht umgeschaltet werden",
|
||||
"failed": "Bild-in-Bild konnte nicht gestartet werden",
|
||||
"prepareFailed": "Bild-in-Bild konnte nicht vorbereitet werden",
|
||||
"unknown": "Ein Fehler ist aufgetreten: ${error}"
|
||||
},
|
||||
"chapters": "Kapitel",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Keine Server gefunden für ${username} (${email})",
|
||||
"failedToLoadServers": "Server konnten nicht geladen werden: ${error}"
|
||||
"failedToLoadServers": "Server konnten nicht geladen werden: ${error}",
|
||||
"noValidServers": "Für dieses Konto wurden keine nutzbaren Server gefunden"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Titel",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Aktualisierung des TV-Programms angefordert",
|
||||
"rulesProcessRequested": "Regelauswertung angefordert",
|
||||
"recordShow": "Sendung aufnehmen",
|
||||
"recordSettings": {
|
||||
"startEarly": "Früher starten (Sekunden)",
|
||||
"endLate": "Später beenden (Sekunden)",
|
||||
"newOnly": "Nur neue Episoden",
|
||||
"anyChannel": "Auf jedem Sender aufnehmen",
|
||||
"anyTime": "Zu jeder Zeit aufnehmen",
|
||||
"skipInLibrary": "Episoden überspringen, die schon in der Bibliothek sind",
|
||||
"keepUpTo": "Zu behaltende Episoden",
|
||||
"keepUpToHint": "0 behält alle Episoden"
|
||||
},
|
||||
"startingInMinutes": "Beginnt in ${minutes} Min.",
|
||||
"dayAtTime": "${day} um ${time}",
|
||||
"invalidPlaybackData": "${product} hat ungültige Live-TV-Wiedergabedaten zurückgegeben",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Entfernen",
|
||||
"guestSwitchUnavailable": "Wechsel fehlgeschlagen — Server nicht für Synchronisierung verfügbar",
|
||||
"guestSwitchFailed": "Wechsel fehlgeschlagen — Inhalt auf diesem Server nicht gefunden",
|
||||
"defaultDisplayName": "Benutzer"
|
||||
"defaultDisplayName": "Benutzer",
|
||||
"errors": {
|
||||
"timedOut": "Der Relay-Server hat nicht rechtzeitig geantwortet",
|
||||
"connectionLost": "Die Verbindung wurde geschlossen, bevor die Sitzung bereit war",
|
||||
"invalidRelayResponse": "Der Relay-Server hat eine unerwartete Antwort gesendet",
|
||||
"sessionEnded": "Der Host hat die Sitzung beendet"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Downloads",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Verwende dein Mobilgerät, um diese App zu steuern",
|
||||
"startServer": "Server starten",
|
||||
"stopServer": "Server stoppen",
|
||||
"minimize": "Minimieren"
|
||||
"minimize": "Minimieren",
|
||||
"manualAddressHint": "Manuelle Verbindungsadresse:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Plezy-Geräte mit demselben Plex-Konto erscheinen hier",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Teilweise verfügbar",
|
||||
"statusRequested": "Angefragt",
|
||||
"statusProcessing": "Wird verarbeitet",
|
||||
"statusBlocklisted": "Auf der Sperrliste",
|
||||
"couldNotReach": "${url} nicht erreichbar: ${error}",
|
||||
"noInstanceAtUrl": "Keine Seerr-Instanz unter ${url} (HTTP ${status})",
|
||||
"notInitialized": "Die Ersteinrichtung dieser Seerr-Instanz wurde noch nicht abgeschlossen",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Verbindung eines anderen Profils wiederverwenden. PIN-geschützte Profile erfordern eine PIN.",
|
||||
"invalidCredentials": "Ungültiger Benutzername oder ungültiges Passwort",
|
||||
"authResponseNotJson": "Die Authentifizierungsantwort war kein gültiges JSON",
|
||||
"authResponseIncomplete": "Die Anmeldeantwort des Servers war unvollständig",
|
||||
"quickConnectRejected": "Quick Connect wurde vom Server abgelehnt",
|
||||
"quickConnectNotJson": "Die Quick Connect-Antwort war kein gültiges JSON",
|
||||
"quickConnectMissingFields": "In der Quick Connect-Antwort fehlt ein Code oder Geheimnis",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Movie",
|
||||
"show": "Show",
|
||||
"season": "Season",
|
||||
"episode": "Episode",
|
||||
"artist": "Artist",
|
||||
"album": "Album",
|
||||
"track": "Track",
|
||||
"collection": "Collection",
|
||||
"playlist": "Playlist",
|
||||
"clip": "Clip",
|
||||
"photo": "Photo",
|
||||
"folder": "Folder"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licenses",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Automatically enter picture-in-picture when you leave the app during playback",
|
||||
"matchContentFrameRate": "Match Content Frame Rate",
|
||||
"matchContentFrameRateDescription": "Match display refresh rate to video content",
|
||||
"matchContentResolution": "Match Content Resolution",
|
||||
"matchContentResolutionDescription": "Switch the display to the video's native resolution so your TV handles upscaling. Menus and subtitles are upscaled too during playback",
|
||||
"matchRefreshRate": "Match Refresh Rate",
|
||||
"matchRefreshRateDescription": "Match display refresh rate in fullscreen",
|
||||
"matchDynamicRange": "Match Dynamic Range",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Force native DV7 and suppress DV conversion retry",
|
||||
"dvConversionDv81Description": "Force inline RPU conversion to Dolby Vision profile 8.1",
|
||||
"dvConversionHevcStripDescription": "Strip Dolby Vision RPU/EL layers and present plain HEVC",
|
||||
"demuxer": "Container Demuxer",
|
||||
"demuxerDescription": "Which demuxer parses direct-played files. Switch to media3 if a file misbehaves.",
|
||||
"demuxerFfmpeg": "FFmpeg (Recommended)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Ask for profile on app open",
|
||||
"requireProfileSelectionOnOpenDescription": "Show profile selection every time the app is opened",
|
||||
"forceTvMode": "Force TV mode",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Device doesn't support picture-in-picture mode",
|
||||
"voSwitchFailed": "Failed to switch video output for picture-in-picture",
|
||||
"failed": "Picture-in-picture failed to start",
|
||||
"prepareFailed": "Picture-in-picture could not be prepared",
|
||||
"unknown": "An error occurred: ${error}"
|
||||
},
|
||||
"chapters": "Chapters",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "No servers found for ${username} (${email})",
|
||||
"failedToLoadServers": "Failed to load servers: ${error}"
|
||||
"failedToLoadServers": "Failed to load servers: ${error}",
|
||||
"noValidServers": "No usable servers were found on this account"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Title",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Guide refresh requested",
|
||||
"rulesProcessRequested": "Rule re-evaluation requested",
|
||||
"recordShow": "Record show",
|
||||
"recordSettings": {
|
||||
"startEarly": "Start early (seconds)",
|
||||
"endLate": "End late (seconds)",
|
||||
"newOnly": "Only new episodes",
|
||||
"anyChannel": "Record on any channel",
|
||||
"anyTime": "Record at any time",
|
||||
"skipInLibrary": "Skip episodes already in the library",
|
||||
"keepUpTo": "Episodes to keep",
|
||||
"keepUpToHint": "0 keeps every episode"
|
||||
},
|
||||
"startingInMinutes": "Starting in ${minutes} min",
|
||||
"dayAtTime": "${day} at ${time}",
|
||||
"invalidPlaybackData": "${product} returned invalid Live TV playback data",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Remove",
|
||||
"guestSwitchUnavailable": "Couldn't switch — server unavailable for sync",
|
||||
"guestSwitchFailed": "Couldn't switch — content not found on this server",
|
||||
"defaultDisplayName": "User"
|
||||
"defaultDisplayName": "User",
|
||||
"errors": {
|
||||
"timedOut": "The relay did not respond in time",
|
||||
"connectionLost": "The connection closed before the session was ready",
|
||||
"invalidRelayResponse": "The relay sent an unexpected response",
|
||||
"sessionEnded": "The host ended the session"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Downloads",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Use your mobile device to control this app",
|
||||
"startServer": "Start Server",
|
||||
"stopServer": "Stop Server",
|
||||
"minimize": "Minimize"
|
||||
"minimize": "Minimize",
|
||||
"manualAddressHint": "Manual connection address:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Plezy devices with the same Plex account appear here",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Partially available",
|
||||
"statusRequested": "Requested",
|
||||
"statusProcessing": "Processing",
|
||||
"statusBlocklisted": "Blocklisted",
|
||||
"couldNotReach": "Could not reach ${url}: ${error}",
|
||||
"noInstanceAtUrl": "No Seerr instance at ${url} (HTTP ${status})",
|
||||
"notInitialized": "This Seerr instance has not completed first-run setup",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Reuse another profile's connection. PIN-protected profiles require a PIN.",
|
||||
"invalidCredentials": "Invalid username or password",
|
||||
"authResponseNotJson": "The authentication response was not valid JSON",
|
||||
"authResponseIncomplete": "The sign-in response from the server was incomplete",
|
||||
"quickConnectRejected": "Quick Connect was rejected by the server",
|
||||
"quickConnectNotJson": "The Quick Connect response was not valid JSON",
|
||||
"quickConnectMissingFields": "The Quick Connect response is missing a code or secret",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/D",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Película",
|
||||
"show": "Serie",
|
||||
"season": "Temporada",
|
||||
"episode": "Episodio",
|
||||
"artist": "Artista",
|
||||
"album": "Álbum",
|
||||
"track": "Pista",
|
||||
"collection": "Colección",
|
||||
"playlist": "Lista de reproducción",
|
||||
"clip": "Clip",
|
||||
"photo": "Foto",
|
||||
"folder": "Carpeta"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licencias",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Activar automáticamente el modo de imagen en imagen al salir de la aplicación durante la reproducción",
|
||||
"matchContentFrameRate": "Ajustar frecuencia de actualización",
|
||||
"matchContentFrameRateDescription": "Ajustar la frecuencia de pantalla al contenido de video",
|
||||
"matchContentResolution": "Ajustar a la resolución del contenido",
|
||||
"matchContentResolutionDescription": "Cambia la pantalla a la resolución nativa del vídeo para que tu televisor se encargue del escalado. Los menús y los subtítulos también se escalan durante la reproducción",
|
||||
"matchRefreshRate": "Ajustar frecuencia de refresco",
|
||||
"matchRefreshRateDescription": "Ajustar la frecuencia de pantalla en pantalla completa",
|
||||
"matchDynamicRange": "Ajustar rango dinámico",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Forzar DV7 nativo y suprimir el reintento de conversión DV",
|
||||
"dvConversionDv81Description": "Forzar la conversión de RPU en línea al perfil 8.1 de Dolby Vision",
|
||||
"dvConversionHevcStripDescription": "Eliminar las capas RPU/EL de Dolby Vision y presentar HEVC convencional",
|
||||
"demuxer": "Demultiplexor de contenedor",
|
||||
"demuxerDescription": "Qué demultiplexor analiza los archivos de reproducción directa. Cambia a media3 si un archivo da problemas.",
|
||||
"demuxerFfmpeg": "FFmpeg (recomendado)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Pedir perfil al abrir la aplicación",
|
||||
"requireProfileSelectionOnOpenDescription": "Mostrar selección de perfil cada vez que se abre la aplicación",
|
||||
"forceTvMode": "Forzar modo TV",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "El dispositivo no admite el modo de imagen en imagen",
|
||||
"voSwitchFailed": "No se pudo cambiar la salida de video para el modo de imagen en imagen",
|
||||
"failed": "No se pudo iniciar el modo de imagen en imagen",
|
||||
"prepareFailed": "No se pudo preparar el modo de imagen en imagen",
|
||||
"unknown": "Ocurrió un error: ${error}"
|
||||
},
|
||||
"chapters": "Capítulos",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "No se encontraron servidores para ${username} (${email})",
|
||||
"failedToLoadServers": "Error al cargar servidores: ${error}"
|
||||
"failedToLoadServers": "Error al cargar servidores: ${error}",
|
||||
"noValidServers": "No se encontraron servidores utilizables en esta cuenta"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Título",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Solicitada actualización de la guía",
|
||||
"rulesProcessRequested": "Solicitada reevaluación de reglas",
|
||||
"recordShow": "Grabar programa",
|
||||
"recordSettings": {
|
||||
"startEarly": "Empezar antes (segundos)",
|
||||
"endLate": "Terminar después (segundos)",
|
||||
"newOnly": "Solo episodios nuevos",
|
||||
"anyChannel": "Grabar en cualquier canal",
|
||||
"anyTime": "Grabar a cualquier hora",
|
||||
"skipInLibrary": "Omitir episodios que ya están en la biblioteca",
|
||||
"keepUpTo": "Episodios que conservar",
|
||||
"keepUpToHint": "0 conserva todos los episodios"
|
||||
},
|
||||
"startingInMinutes": "Empieza en ${minutes} min",
|
||||
"dayAtTime": "${day} a las ${time}",
|
||||
"invalidPlaybackData": "${product} devolvió datos de reproducción de TV en vivo no válidos",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Eliminar",
|
||||
"guestSwitchUnavailable": "No se pudo cambiar — servidor no disponible para sincronización",
|
||||
"guestSwitchFailed": "No se pudo cambiar — contenido no encontrado en este servidor",
|
||||
"defaultDisplayName": "Usuario"
|
||||
"defaultDisplayName": "Usuario",
|
||||
"errors": {
|
||||
"timedOut": "El servidor de retransmisión no respondió a tiempo",
|
||||
"connectionLost": "La conexión se cerró antes de que la sesión estuviera lista",
|
||||
"invalidRelayResponse": "El servidor de retransmisión envió una respuesta inesperada",
|
||||
"sessionEnded": "El anfitrión finalizó la sesión"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Descargas",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Usa tu dispositivo móvil para controlar esta aplicación",
|
||||
"startServer": "Iniciar servidor",
|
||||
"stopServer": "Detener servidor",
|
||||
"minimize": "Minimizar"
|
||||
"minimize": "Minimizar",
|
||||
"manualAddressHint": "Dirección de conexión manual:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Los dispositivos Plezy con la misma cuenta Plex aparecen aquí",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Parcialmente disponible",
|
||||
"statusRequested": "Solicitado",
|
||||
"statusProcessing": "Procesando",
|
||||
"statusBlocklisted": "En la lista de bloqueo",
|
||||
"couldNotReach": "No se pudo conectar con ${url}: ${error}",
|
||||
"noInstanceAtUrl": "No hay ninguna instancia de Seerr en ${url} (HTTP ${status})",
|
||||
"notInitialized": "Esta instancia de Seerr no ha completado la configuración inicial",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Reutiliza la conexión de otro perfil. Los perfiles protegidos con PIN requieren un PIN.",
|
||||
"invalidCredentials": "Usuario o contraseña no válidos",
|
||||
"authResponseNotJson": "La respuesta de autenticación no era un JSON válido",
|
||||
"authResponseIncomplete": "La respuesta de inicio de sesión del servidor estaba incompleta",
|
||||
"quickConnectRejected": "Quick Connect fue rechazado por el servidor",
|
||||
"quickConnectNotJson": "La respuesta de Quick Connect no era un JSON válido",
|
||||
"quickConnectMissingFields": "La respuesta de Quick Connect no incluye el código o el secreto",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Série",
|
||||
"season": "Saison",
|
||||
"episode": "Épisode",
|
||||
"artist": "Artiste",
|
||||
"album": "Album",
|
||||
"track": "Titre",
|
||||
"collection": "Collection",
|
||||
"playlist": "Playlist",
|
||||
"clip": "Clip",
|
||||
"photo": "Photo",
|
||||
"folder": "Dossier"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licences",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Passer en mode image dans l’image si vous quittez l’application pendant la lecture",
|
||||
"matchContentFrameRate": "Adapter la fréquence d’images au contenu",
|
||||
"matchContentFrameRateDescription": "Adapter la fréquence de rafraîchissement de l’écran au contenu vidéo",
|
||||
"matchContentResolution": "Adapter à la résolution du contenu",
|
||||
"matchContentResolutionDescription": "Bascule l’affichage sur la résolution native de la vidéo pour que votre téléviseur gère la mise à l’échelle. Les menus et les sous-titres sont eux aussi mis à l’échelle pendant la lecture",
|
||||
"matchRefreshRate": "Adapter la fréquence de rafraîchissement",
|
||||
"matchRefreshRateDescription": "Adapter la fréquence d'affichage en plein écran",
|
||||
"matchDynamicRange": "Adapter la plage dynamique",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Forcer le DV7 natif et bloquer la nouvelle tentative de conversion DV",
|
||||
"dvConversionDv81Description": "Forcer la conversion RPU intégrée vers le profil 8.1 de Dolby Vision",
|
||||
"dvConversionHevcStripDescription": "Supprimer les couches RPU/EL Dolby Vision et présenter du HEVC simple",
|
||||
"demuxer": "Démultiplexeur de conteneur",
|
||||
"demuxerDescription": "Quel démultiplexeur analyse les fichiers lus en direct. Passez à media3 si un fichier pose problème.",
|
||||
"demuxerFfmpeg": "FFmpeg (recommandé)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Demander le profil à l'ouverture",
|
||||
"requireProfileSelectionOnOpenDescription": "Afficher la sélection de profil à chaque ouverture de l'application",
|
||||
"forceTvMode": "Forcer le mode TV",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Cet appareil ne prend pas en charge le mode image dans l'image",
|
||||
"voSwitchFailed": "Échec du changement de sortie vidéo pour l'image dans l'image",
|
||||
"failed": "Échec du démarrage du mode image dans l'image",
|
||||
"prepareFailed": "Impossible de préparer le mode image dans l'image",
|
||||
"unknown": "Une erreur s'est produite : ${error}"
|
||||
},
|
||||
"chapters": "Chapitres",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Aucun serveur trouvé pour ${username} (${email})",
|
||||
"failedToLoadServers": "Échec du chargement des serveurs : ${error}"
|
||||
"failedToLoadServers": "Échec du chargement des serveurs : ${error}",
|
||||
"noValidServers": "Aucun serveur utilisable n’a été trouvé sur ce compte"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Titre",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Mise à jour du guide demandée",
|
||||
"rulesProcessRequested": "Réévaluation des règles demandée",
|
||||
"recordShow": "Enregistrer l'émission",
|
||||
"recordSettings": {
|
||||
"startEarly": "Démarrer en avance (secondes)",
|
||||
"endLate": "Terminer en retard (secondes)",
|
||||
"newOnly": "Uniquement les nouveaux épisodes",
|
||||
"anyChannel": "Enregistrer sur n’importe quelle chaîne",
|
||||
"anyTime": "Enregistrer à n’importe quelle heure",
|
||||
"skipInLibrary": "Ignorer les épisodes déjà présents dans la bibliothèque",
|
||||
"keepUpTo": "Épisodes à conserver",
|
||||
"keepUpToHint": "0 conserve tous les épisodes"
|
||||
},
|
||||
"startingInMinutes": "Commence dans ${minutes} min",
|
||||
"dayAtTime": "${day} à ${time}",
|
||||
"invalidPlaybackData": "${product} a renvoyé des données de lecture de TV en direct non valides",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Supprimer",
|
||||
"guestSwitchUnavailable": "Impossible de changer — serveur indisponible pour la synchronisation",
|
||||
"guestSwitchFailed": "Impossible de changer — contenu introuvable sur ce serveur",
|
||||
"defaultDisplayName": "Utilisateur"
|
||||
"defaultDisplayName": "Utilisateur",
|
||||
"errors": {
|
||||
"timedOut": "Le serveur relais n’a pas répondu à temps",
|
||||
"connectionLost": "La connexion s’est fermée avant que la session ne soit prête",
|
||||
"invalidRelayResponse": "Le serveur relais a renvoyé une réponse inattendue",
|
||||
"sessionEnded": "L’hôte a mis fin à la session"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Téléchargements",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Utilisez votre appareil mobile pour contrôler cette application",
|
||||
"startServer": "Démarrer le serveur",
|
||||
"stopServer": "Arrêter le serveur",
|
||||
"minimize": "Réduire"
|
||||
"minimize": "Réduire",
|
||||
"manualAddressHint": "Adresse de connexion manuelle :"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Les appareils Plezy avec le même compte Plex apparaissent ici",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Partiellement disponible",
|
||||
"statusRequested": "Demandé",
|
||||
"statusProcessing": "En cours de traitement",
|
||||
"statusBlocklisted": "Sur la liste de blocage",
|
||||
"couldNotReach": "Impossible de joindre ${url} : ${error}",
|
||||
"noInstanceAtUrl": "Aucune instance Seerr à l’adresse ${url} (HTTP ${status})",
|
||||
"notInitialized": "La configuration initiale de cette instance Seerr n’est pas terminée",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Réutiliser la connexion d'un autre profil. Les profils protégés par PIN exigent un PIN.",
|
||||
"invalidCredentials": "Nom d’utilisateur ou mot de passe incorrect",
|
||||
"authResponseNotJson": "La réponse d’authentification n’était pas au format JSON valide",
|
||||
"authResponseIncomplete": "La réponse de connexion du serveur était incomplète",
|
||||
"quickConnectRejected": "Quick Connect a été refusé par le serveur",
|
||||
"quickConnectNotJson": "La réponse de Quick Connect n’était pas au format JSON valide",
|
||||
"quickConnectMissingFields": "Il manque un code ou un secret dans la réponse de Quick Connect",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Sorozat",
|
||||
"season": "Évad",
|
||||
"episode": "Epizód",
|
||||
"artist": "Előadó",
|
||||
"album": "Album",
|
||||
"track": "Szám",
|
||||
"collection": "Gyűjtemény",
|
||||
"playlist": "Lejátszási lista",
|
||||
"clip": "Klip",
|
||||
"photo": "Fénykép",
|
||||
"folder": "Mappa"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licencek",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Lejátszás közben az alkalmazás elhagyásakor automatikusan kép a képben módra vált",
|
||||
"matchContentFrameRate": "Képkockasebesség illesztése a tartalomhoz",
|
||||
"matchContentFrameRateDescription": "A kijelző frissítési frekvenciájának igazítása a videóhoz",
|
||||
"matchContentResolution": "Igazítás a tartalom felbontásához",
|
||||
"matchContentResolutionDescription": "A kijelzőt a videó natív felbontására váltja, hogy a felskálázást a tévé végezze. Lejátszás közben a menük és a feliratok is felskálázódnak",
|
||||
"matchRefreshRate": "Frissítési frekvencia illesztése",
|
||||
"matchRefreshRateDescription": "A kijelző frissítési frekvenciájának igazítása teljes képernyőn",
|
||||
"matchDynamicRange": "Dinamikatartomány illesztése",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "A natív DV7 kényszerítése és a DV-átalakítási újrapróbálkozás letiltása",
|
||||
"dvConversionDv81Description": "A közvetlen RPU-átalakítás kényszerítése Dolby Vision Profile 8.1-re",
|
||||
"dvConversionHevcStripDescription": "A Dolby Vision RPU/EL-rétegek eltávolítása és egyszerű HEVC-ként való megjelenítés",
|
||||
"demuxer": "Konténer-demuxer",
|
||||
"demuxerDescription": "Melyik demuxer dolgozza fel a közvetlenül lejátszott fájlokat. Válts media3-ra, ha egy fájl hibásan viselkedik.",
|
||||
"demuxerFfmpeg": "FFmpeg (ajánlott)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Profil kérése az alkalmazás megnyitásakor",
|
||||
"requireProfileSelectionOnOpenDescription": "Profilválasztó megjelenítése minden alkalommal, amikor az alkalmazást megnyitod",
|
||||
"forceTvMode": "TV-mód kényszerítése",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Az eszköz nem támogatja a kép a képben módot",
|
||||
"voSwitchFailed": "Nem sikerült átváltani a videókimenetet a kép a képben módhoz",
|
||||
"failed": "Nem sikerült elindítani a kép a képben módot",
|
||||
"prepareFailed": "Nem sikerült előkészíteni a kép a képben módot",
|
||||
"unknown": "Hiba történt: ${error}"
|
||||
},
|
||||
"chapters": "Fejezetek",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Nem találhatók szerverek ehhez a fiókhoz: ${username} (${email})",
|
||||
"failedToLoadServers": "Nem sikerült a szerverek betöltése: ${error}"
|
||||
"failedToLoadServers": "Nem sikerült a szerverek betöltése: ${error}",
|
||||
"noValidServers": "Nem található használható szerver ehhez a fiókhoz"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Cím",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Műsorújság frissítése kérve",
|
||||
"rulesProcessRequested": "Szabályok újraértékelése kérve",
|
||||
"recordShow": "Műsor rögzítése",
|
||||
"recordSettings": {
|
||||
"startEarly": "Korábbi kezdés (másodperc)",
|
||||
"endLate": "Későbbi befejezés (másodperc)",
|
||||
"newOnly": "Csak új epizódok",
|
||||
"anyChannel": "Felvétel bármelyik csatornáról",
|
||||
"anyTime": "Felvétel bármikor",
|
||||
"skipInLibrary": "A könyvtárban már meglévő epizódok kihagyása",
|
||||
"keepUpTo": "Megtartandó epizódok",
|
||||
"keepUpToHint": "A 0 minden epizódot megtart"
|
||||
},
|
||||
"startingInMinutes": "${minutes} perc múlva kezdődik",
|
||||
"dayAtTime": "${day}, ${time}",
|
||||
"invalidPlaybackData": "A(z) ${product} érvénytelen Élő TV-lejátszási adatokat adott vissza",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Eltávolítás",
|
||||
"guestSwitchUnavailable": "Nem sikerült a váltás — a szerver nem érhető el szinkronizáláshoz",
|
||||
"guestSwitchFailed": "Nem sikerült a váltás — a tartalom nem található ezen a szerveren",
|
||||
"defaultDisplayName": "Felhasználó"
|
||||
"defaultDisplayName": "Felhasználó",
|
||||
"errors": {
|
||||
"timedOut": "A relészerver nem válaszolt időben",
|
||||
"connectionLost": "A kapcsolat lezárult, mielőtt a munkamenet elkészült volna",
|
||||
"invalidRelayResponse": "A relészerver váratlan választ küldött",
|
||||
"sessionEnded": "A házigazda befejezte a munkamenetet"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Letöltések",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Használd a mobileszközödet az alkalmazás vezérléséhez",
|
||||
"startServer": "Szerver indítása",
|
||||
"stopServer": "Szerver leállítása",
|
||||
"minimize": "Kis méret"
|
||||
"minimize": "Kis méret",
|
||||
"manualAddressHint": "Kézi kapcsolódási cím:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Az azonos Plex-fiókot használó Plezy-eszközök itt jelennek meg",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Részben elérhető",
|
||||
"statusRequested": "Igényelve",
|
||||
"statusProcessing": "Feldolgozás alatt",
|
||||
"statusBlocklisted": "Tiltólistán",
|
||||
"couldNotReach": "Nem sikerült elérni ezt: ${url}: ${error}",
|
||||
"noInstanceAtUrl": "Nem található Seerr-példány ezen a címen: ${url} (HTTP ${status})",
|
||||
"notInitialized": "Ennek a Seerr-példánynak a kezdeti beállítása még nem fejeződött be",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Egy másik profil kapcsolatának használata. A PIN-kóddal védett profilokhoz PIN-kód szükséges.",
|
||||
"invalidCredentials": "Érvénytelen felhasználónév vagy jelszó",
|
||||
"authResponseNotJson": "A hitelesítési válasz nem érvényes JSON",
|
||||
"authResponseIncomplete": "A szerver bejelentkezési válasza hiányos volt",
|
||||
"quickConnectRejected": "A szerver elutasította a Quick Connect-kérést",
|
||||
"quickConnectNotJson": "A Quick Connect válasza nem érvényes JSON",
|
||||
"quickConnectMissingFields": "A Quick Connect válaszából hiányzik a kód vagy a titkos kulcs",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/D",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serie",
|
||||
"season": "Stagione",
|
||||
"episode": "Episodio",
|
||||
"artist": "Artista",
|
||||
"album": "Album",
|
||||
"track": "Traccia",
|
||||
"collection": "Raccolta",
|
||||
"playlist": "Playlist",
|
||||
"clip": "Clip",
|
||||
"photo": "Foto",
|
||||
"folder": "Cartella"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licenze",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Attiva automaticamente la modalità Picture-in-Picture quando esci dall'app durante la riproduzione",
|
||||
"matchContentFrameRate": "Adatta la frequenza dei fotogrammi",
|
||||
"matchContentFrameRateDescription": "Adatta la frequenza di aggiornamento dello schermo al contenuto video",
|
||||
"matchContentResolution": "Adatta alla risoluzione del contenuto",
|
||||
"matchContentResolutionDescription": "Passa lo schermo alla risoluzione nativa del video, così è la TV a occuparsi dell'upscaling. Durante la riproduzione vengono ridimensionati anche menu e sottotitoli",
|
||||
"matchRefreshRate": "Adatta la frequenza di aggiornamento",
|
||||
"matchRefreshRateDescription": "Adatta la frequenza di aggiornamento dello schermo in modalità a schermo intero",
|
||||
"matchDynamicRange": "Adatta la gamma dinamica",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Forza il DV7 nativo e impedisce nuovi tentativi di conversione DV",
|
||||
"dvConversionDv81Description": "Forza la conversione RPU diretta al profilo Dolby Vision 8.1",
|
||||
"dvConversionHevcStripDescription": "Rimuove i livelli RPU/EL di Dolby Vision e riproduce il video come semplice HEVC",
|
||||
"demuxer": "Demuxer del contenitore",
|
||||
"demuxerDescription": "Quale demuxer analizza i file riprodotti in diretta. Passa a media3 se un file dà problemi.",
|
||||
"demuxerFfmpeg": "FFmpeg (consigliato)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Chiedi di scegliere il profilo all'apertura",
|
||||
"requireProfileSelectionOnOpenDescription": "Mostra la selezione del profilo ogni volta che l'app viene aperta",
|
||||
"forceTvMode": "Forza modalità TV",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Questo dispositivo non supporta la modalità Picture-in-Picture",
|
||||
"voSwitchFailed": "Impossibile cambiare l'uscita video per Picture-in-Picture",
|
||||
"failed": "Impossibile avviare la modalità Picture-in-Picture",
|
||||
"prepareFailed": "Impossibile preparare la modalità Picture-in-Picture",
|
||||
"unknown": "Si è verificato un errore: ${error}"
|
||||
},
|
||||
"chapters": "Capitoli",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Nessun server trovato per ${username} (${email})",
|
||||
"failedToLoadServers": "Impossibile caricare i server: ${error}"
|
||||
"failedToLoadServers": "Impossibile caricare i server: ${error}",
|
||||
"noValidServers": "Nessun server utilizzabile trovato per questo account"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Titolo",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Aggiornamento della guida richiesto",
|
||||
"rulesProcessRequested": "Rielaborazione delle regole richiesta",
|
||||
"recordShow": "Registra programma",
|
||||
"recordSettings": {
|
||||
"startEarly": "Inizia in anticipo (secondi)",
|
||||
"endLate": "Termina in ritardo (secondi)",
|
||||
"newOnly": "Solo nuovi episodi",
|
||||
"anyChannel": "Registra su qualsiasi canale",
|
||||
"anyTime": "Registra a qualsiasi ora",
|
||||
"skipInLibrary": "Salta gli episodi già presenti nella libreria",
|
||||
"keepUpTo": "Episodi da conservare",
|
||||
"keepUpToHint": "0 conserva tutti gli episodi"
|
||||
},
|
||||
"startingInMinutes": "Inizia tra ${minutes} min",
|
||||
"dayAtTime": "${day} alle ${time}",
|
||||
"invalidPlaybackData": "${product} ha restituito dati di riproduzione della TV in diretta non validi",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Rimuovi",
|
||||
"guestSwitchUnavailable": "Impossibile cambiare — server non disponibile per la sincronizzazione",
|
||||
"guestSwitchFailed": "Impossibile cambiare — contenuto non trovato su questo server",
|
||||
"defaultDisplayName": "Utente"
|
||||
"defaultDisplayName": "Utente",
|
||||
"errors": {
|
||||
"timedOut": "Il server relay non ha risposto in tempo",
|
||||
"connectionLost": "La connessione si è chiusa prima che la sessione fosse pronta",
|
||||
"invalidRelayResponse": "Il server relay ha inviato una risposta imprevista",
|
||||
"sessionEnded": "L’host ha terminato la sessione"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Download",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Usa il tuo dispositivo mobile per controllare questa app",
|
||||
"startServer": "Avvia server",
|
||||
"stopServer": "Arresta server",
|
||||
"minimize": "Riduci"
|
||||
"minimize": "Riduci",
|
||||
"manualAddressHint": "Indirizzo di connessione manuale:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "I dispositivi Plezy con lo stesso account Plex appaiono qui",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Disponibile in parte",
|
||||
"statusRequested": "Richiesto",
|
||||
"statusProcessing": "In elaborazione",
|
||||
"statusBlocklisted": "Nella lista di blocco",
|
||||
"couldNotReach": "Impossibile raggiungere ${url}: ${error}",
|
||||
"noInstanceAtUrl": "Nessuna istanza Seerr all'indirizzo ${url} (HTTP ${status})",
|
||||
"notInitialized": "Questa istanza Seerr non ha completato la configurazione iniziale",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Riutilizza la connessione di un altro profilo. I profili protetti da PIN richiedono un PIN.",
|
||||
"invalidCredentials": "Nome utente o password non validi",
|
||||
"authResponseNotJson": "La risposta di autenticazione non era un JSON valido",
|
||||
"authResponseIncomplete": "La risposta di accesso del server era incompleta",
|
||||
"quickConnectRejected": "Quick Connect è stato rifiutato dal server",
|
||||
"quickConnectNotJson": "La risposta di Quick Connect non era un JSON valido",
|
||||
"quickConnectMissingFields": "Nella risposta di Quick Connect manca un codice o un segreto",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "映画",
|
||||
"show": "テレビ番組",
|
||||
"season": "シーズン",
|
||||
"episode": "エピソード",
|
||||
"artist": "アーティスト",
|
||||
"album": "アルバム",
|
||||
"track": "曲",
|
||||
"collection": "コレクション",
|
||||
"playlist": "プレイリスト",
|
||||
"clip": "クリップ",
|
||||
"photo": "写真",
|
||||
"folder": "フォルダ"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "ライセンス",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "再生中にアプリを離れると、自動的にピクチャーインピクチャーに切り替えます",
|
||||
"matchContentFrameRate": "コンテンツのフレームレートに合わせる",
|
||||
"matchContentFrameRateDescription": "表示のリフレッシュレートを動画コンテンツに合わせます",
|
||||
"matchContentResolution": "コンテンツの解像度に合わせる",
|
||||
"matchContentResolutionDescription": "テレビ側でアップスケーリングを処理できるよう、ディスプレイを映像本来の解像度に切り替えます。再生中はメニューや字幕もアップスケールされます",
|
||||
"matchRefreshRate": "リフレッシュレートを合わせる",
|
||||
"matchRefreshRateDescription": "全画面時に表示のリフレッシュレートを合わせます",
|
||||
"matchDynamicRange": "ダイナミックレンジを合わせる",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "ネイティブ DV7 を強制し、DV 変換の再試行を抑制します",
|
||||
"dvConversionDv81Description": "Dolby Vision プロファイル 8.1 へのインライン RPU 変換を強制します",
|
||||
"dvConversionHevcStripDescription": "Dolby Vision の RPU/EL レイヤーを削除し、通常の HEVC として扱います",
|
||||
"demuxer": "コンテナデマルチプレクサ",
|
||||
"demuxerDescription": "ダイレクト再生のファイルを解析するデマルチプレクサ。ファイルの再生に問題がある場合は media3 に切り替えてください。",
|
||||
"demuxerFfmpeg": "FFmpeg(推奨)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "アプリ起動時にプロフィールを確認",
|
||||
"requireProfileSelectionOnOpenDescription": "アプリを開くたびにプロフィール選択を表示",
|
||||
"forceTvMode": "TVモードを強制",
|
||||
@@ -672,6 +692,7 @@
|
||||
"notSupported": "デバイスはピクチャーインピクチャーモードをサポートしていません",
|
||||
"voSwitchFailed": "ピクチャーインピクチャーの映像出力切替に失敗しました",
|
||||
"failed": "ピクチャーインピクチャーの開始に失敗しました",
|
||||
"prepareFailed": "ピクチャーインピクチャーを準備できませんでした",
|
||||
"unknown": "エラーが発生しました: ${error}"
|
||||
},
|
||||
"chapters": "チャプター",
|
||||
@@ -1027,7 +1048,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "${username} (${email})のサーバーが見つかりません",
|
||||
"failedToLoadServers": "サーバーの読み込みに失敗しました: ${error}"
|
||||
"failedToLoadServers": "サーバーの読み込みに失敗しました: ${error}",
|
||||
"noValidServers": "このアカウントで利用可能なサーバーが見つかりませんでした"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "タイトル",
|
||||
@@ -1328,6 +1350,16 @@
|
||||
"guideReloadRequested": "番組表の更新をリクエストしました",
|
||||
"rulesProcessRequested": "録画ルールの再評価をリクエストしました",
|
||||
"recordShow": "番組を録画",
|
||||
"recordSettings": {
|
||||
"startEarly": "早めに開始(秒)",
|
||||
"endLate": "遅めに終了(秒)",
|
||||
"newOnly": "新しいエピソードのみ",
|
||||
"anyChannel": "すべてのチャンネルで録画",
|
||||
"anyTime": "すべての時間帯で録画",
|
||||
"skipInLibrary": "ライブラリにあるエピソードをスキップ",
|
||||
"keepUpTo": "保持するエピソード数",
|
||||
"keepUpToHint": "0 ですべてのエピソードを保持"
|
||||
},
|
||||
"startingInMinutes": "${minutes}分後に開始",
|
||||
"dayAtTime": "${day} ${time}",
|
||||
"invalidPlaybackData": "${product}から無効なライブTV再生データが返されました",
|
||||
@@ -1483,7 +1515,13 @@
|
||||
"removeRoom": "削除",
|
||||
"guestSwitchUnavailable": "切り替えられません — 同期に必要なサーバーを利用できません",
|
||||
"guestSwitchFailed": "切り替えられません — このサーバーにコンテンツが見つかりません",
|
||||
"defaultDisplayName": "ユーザー"
|
||||
"defaultDisplayName": "ユーザー",
|
||||
"errors": {
|
||||
"timedOut": "リレーサーバーが時間内に応答しませんでした",
|
||||
"connectionLost": "セッションの準備が整う前に接続が閉じられました",
|
||||
"invalidRelayResponse": "リレーサーバーから予期しない応答が返されました",
|
||||
"sessionEnded": "ホストがセッションを終了しました"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "ダウンロード",
|
||||
@@ -1631,7 +1669,8 @@
|
||||
"usePhoneToControl": "モバイルデバイスでこのアプリを操作できます",
|
||||
"startServer": "サーバーを起動",
|
||||
"stopServer": "サーバーを停止",
|
||||
"minimize": "最小化"
|
||||
"minimize": "最小化",
|
||||
"manualAddressHint": "手動接続アドレス:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "同じPlexアカウントを使用しているPlezyデバイスがここに表示されます",
|
||||
@@ -1920,6 +1959,7 @@
|
||||
"statusPartiallyAvailable": "一部利用可能",
|
||||
"statusRequested": "リクエスト済み",
|
||||
"statusProcessing": "処理中",
|
||||
"statusBlocklisted": "ブロックリスト登録済み",
|
||||
"couldNotReach": "${url}に接続できませんでした: ${error}",
|
||||
"noInstanceAtUrl": "${url}にSeerrインスタンスがありません(HTTP ${status})",
|
||||
"notInitialized": "このSeerrインスタンスでは初回セットアップが完了していません",
|
||||
@@ -2011,6 +2051,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "別のプロフィールの接続を再利用します。PINで保護されたプロフィールにはPINが必要です。",
|
||||
"invalidCredentials": "ユーザー名またはパスワードが正しくありません",
|
||||
"authResponseNotJson": "認証レスポンスが有効なJSONではありません",
|
||||
"authResponseIncomplete": "サーバーからのサインイン応答が不完全です",
|
||||
"quickConnectRejected": "Quick Connectがサーバーに拒否されました",
|
||||
"quickConnectNotJson": "Quick Connectのレスポンスが有効なJSONではありません",
|
||||
"quickConnectMissingFields": "Quick Connectのレスポンスにコードまたはシークレットがありません",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Фильм",
|
||||
"show": "Сериал",
|
||||
"season": "Маусым",
|
||||
"episode": "Эпизод",
|
||||
"artist": "Орындаушы",
|
||||
"album": "Альбом",
|
||||
"track": "Трек",
|
||||
"collection": "Жинақ",
|
||||
"playlist": "Ойнату тізімі",
|
||||
"clip": "Клип",
|
||||
"photo": "Фото",
|
||||
"folder": "Қалта"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Лицензиялар",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Видео ойнап жатқанда қолданбадан шыққанда авто-PiP режиміне өту",
|
||||
"matchContentFrameRate": "Кадр жиілігін сәйкестендіру",
|
||||
"matchContentFrameRateDescription": "Экран жиілігін видео мазмұнына сәйкестендіру",
|
||||
"matchContentResolution": "Мазмұнның ажыратымдылығына бейімдеу",
|
||||
"matchContentResolutionDescription": "Масштабтауды теледидар орындауы үшін экранды бейненің өз ажыратымдылығына ауыстырады. Ойнату кезінде мәзірлер мен субтитрлер де масштабталады",
|
||||
"matchRefreshRate": "Жаңарту жиілігін сәйкестендіру",
|
||||
"matchRefreshRateDescription": "Толық экранда экран жаңарту жиілігін сәйкестендіру",
|
||||
"matchDynamicRange": "Динамикалық диапазонды сәйкестендіру",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Ішкі DV7 режимін мәжбүрлеу",
|
||||
"dvConversionDv81Description": "Dolby Vision profile 8.1 форматына түрлендіру",
|
||||
"dvConversionHevcStripDescription": "Dolby Vision қабаттарын алып тастап, HEVC ретінде көрсету",
|
||||
"demuxer": "Контейнер демультиплексоры",
|
||||
"demuxerDescription": "Тікелей ойнатылатын файлдарды қай демультиплексор талдайды. Файл дұрыс ойнатылмаса, media3-ке ауысыңыз.",
|
||||
"demuxerFfmpeg": "FFmpeg (ұсынылады)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Ашқанда профильді сұрау",
|
||||
"requireProfileSelectionOnOpenDescription": "Қолданба ашылған сайын профильді таңдауды көрсету",
|
||||
"forceTvMode": "TV режимін мәжбүрлеу",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Құрылғы PiP режимін қолдамайды",
|
||||
"voSwitchFailed": "PiP үшін видео шығысын ауыстыру мүмкін болмады",
|
||||
"failed": "PiP режимін іске қосу қатесі",
|
||||
"prepareFailed": "PiP режимін дайындау мүмкін болмады",
|
||||
"unknown": "Қате орын алды: ${error}"
|
||||
},
|
||||
"chapters": "Бөлімдер",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "${username} (${email}) үшін серверлер табылмады",
|
||||
"failedToLoadServers": "Серверлерді жүктеу қатесі: ${error}"
|
||||
"failedToLoadServers": "Серверлерді жүктеу қатесі: ${error}",
|
||||
"noValidServers": "Бұл тіркелгіде жарамды сервер табылмады"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Атауы",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Бағдарламаны жаңарту сұралды",
|
||||
"rulesProcessRequested": "Ережелерді қайта бағалау сұралды",
|
||||
"recordShow": "Шоуды жазу",
|
||||
"recordSettings": {
|
||||
"startEarly": "Ертерек бастау (секунд)",
|
||||
"endLate": "Кешірек аяқтау (секунд)",
|
||||
"newOnly": "Тек жаңа эпизодтар",
|
||||
"anyChannel": "Кез келген арнадан жазу",
|
||||
"anyTime": "Кез келген уақытта жазу",
|
||||
"skipInLibrary": "Кітапханада бар эпизодтарды өткізіп жіберу",
|
||||
"keepUpTo": "Сақталатын эпизодтар",
|
||||
"keepUpToHint": "0 барлық эпизодты сақтайды"
|
||||
},
|
||||
"startingInMinutes": "${minutes} мин кейін басталады",
|
||||
"dayAtTime": "${day}, ${time}",
|
||||
"invalidPlaybackData": "${product} жарамсыз тікелей TV ойнату деректерін қайтарды",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Өшіру",
|
||||
"guestSwitchUnavailable": "Ауысу мүмкін болмады",
|
||||
"guestSwitchFailed": "Ауысу мүмкін болмады — мазмұн табылмады",
|
||||
"defaultDisplayName": "Пайдаланушы"
|
||||
"defaultDisplayName": "Пайдаланушы",
|
||||
"errors": {
|
||||
"timedOut": "Реле сервері уақытында жауап бермеді",
|
||||
"connectionLost": "Сеанс дайын болмай тұрып байланыс үзілді",
|
||||
"invalidRelayResponse": "Реле сервері күтпеген жауап жіберді",
|
||||
"sessionEnded": "Ұйымдастырушы сеансты аяқтады"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Жүктеулер",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Осы қолданбаны басқару үшін телефоныңызды пайдаланыңыз",
|
||||
"startServer": "Серверді іске қосу",
|
||||
"stopServer": "Серверді тоқтату",
|
||||
"minimize": "Жию"
|
||||
"minimize": "Жию",
|
||||
"manualAddressHint": "Қолмен қосылу мекенжайы:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Бірдей Plex тіркелгісіндегі Plezy құрылғылары мұнда көрінеді",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Жартылай қолжетімді",
|
||||
"statusRequested": "Сұралды",
|
||||
"statusProcessing": "Өңделуде",
|
||||
"statusBlocklisted": "Бұғаттау тізімінде",
|
||||
"couldNotReach": "${url} мекенжайына қосылу мүмкін болмады: ${error}",
|
||||
"noInstanceAtUrl": "${url} мекенжайында Seerr данасы жоқ (HTTP ${status})",
|
||||
"notInitialized": "Бұл Seerr данасының бастапқы баптауы аяқталмаған",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Басқа профильдің қосылымын қайта пайдалану.",
|
||||
"invalidCredentials": "Пайдаланушы аты немесе құпия сөз қате",
|
||||
"authResponseNotJson": "Аутентификация жауабы жарамды JSON болмады",
|
||||
"authResponseIncomplete": "Сервердің кіру жауабы толық емес",
|
||||
"quickConnectRejected": "Сервер Quick Connect сұрауын қабылдамады",
|
||||
"quickConnectNotJson": "Quick Connect жауабы жарамды JSON болмады",
|
||||
"quickConnectMissingFields": "Quick Connect жауабында код немесе құпия кілт жоқ",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "영화",
|
||||
"show": "시리즈",
|
||||
"season": "시즌",
|
||||
"episode": "에피소드",
|
||||
"artist": "아티스트",
|
||||
"album": "앨범",
|
||||
"track": "트랙",
|
||||
"collection": "컬렉션",
|
||||
"playlist": "재생목록",
|
||||
"clip": "클립",
|
||||
"photo": "사진",
|
||||
"folder": "폴더"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "라이선스",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "재생 중 앱을 떠나면 자동으로 화면 속 화면 모드로 전환합니다",
|
||||
"matchContentFrameRate": "콘텐츠 프레임 레이트 맞춤",
|
||||
"matchContentFrameRateDescription": "디스플레이 새로 고침 빈도를 동영상 콘텐츠에 맞춤",
|
||||
"matchContentResolution": "콘텐츠 해상도에 맞추기",
|
||||
"matchContentResolutionDescription": "TV가 업스케일링을 처리하도록 디스플레이를 영상 본래 해상도로 전환합니다. 재생 중에는 메뉴와 자막도 함께 업스케일됩니다",
|
||||
"matchRefreshRate": "주사율 맞춤",
|
||||
"matchRefreshRateDescription": "전체 화면에서 디스플레이 새로 고침 빈도 맞춤",
|
||||
"matchDynamicRange": "다이나믹 레인지 맞춤",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "네이티브 DV7을 강제하고 DV 변환 재시도를 억제합니다",
|
||||
"dvConversionDv81Description": "Dolby Vision 프로필 8.1로 인라인 RPU 변환을 강제합니다",
|
||||
"dvConversionHevcStripDescription": "Dolby Vision RPU/EL 레이어를 제거하고 일반 HEVC로 제공합니다",
|
||||
"demuxer": "컨테이너 디먹서",
|
||||
"demuxerDescription": "다이렉트 재생 파일을 분석할 디먹서입니다. 파일이 제대로 재생되지 않으면 media3으로 전환하세요.",
|
||||
"demuxerFfmpeg": "FFmpeg (권장)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "앱 실행 시 프로필 선택",
|
||||
"requireProfileSelectionOnOpenDescription": "앱을 열 때마다 프로필 선택 화면을 표시합니다",
|
||||
"forceTvMode": "TV 모드 강제 사용",
|
||||
@@ -672,6 +692,7 @@
|
||||
"notSupported": "이 기기는 화면 속 화면 모드를 지원하지 않습니다",
|
||||
"voSwitchFailed": "화면 속 화면을 위한 비디오 출력 전환에 실패했습니다",
|
||||
"failed": "화면 속 화면 모드를 시작할 수 없습니다",
|
||||
"prepareFailed": "화면 속 화면을 준비할 수 없습니다",
|
||||
"unknown": "오류가 발생했습니다: ${error}"
|
||||
},
|
||||
"chapters": "챕터",
|
||||
@@ -1027,7 +1048,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "${username} (${email})의 서버를 찾을 수 없습니다.",
|
||||
"failedToLoadServers": "서버를 로드할 수 없습니다: ${error}"
|
||||
"failedToLoadServers": "서버를 로드할 수 없습니다: ${error}",
|
||||
"noValidServers": "이 계정에서 사용할 수 있는 서버를 찾지 못했습니다"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "제목",
|
||||
@@ -1328,6 +1350,16 @@
|
||||
"guideReloadRequested": "가이드 새로고침 요청됨",
|
||||
"rulesProcessRequested": "규칙 재평가 요청됨",
|
||||
"recordShow": "프로그램 녹화",
|
||||
"recordSettings": {
|
||||
"startEarly": "일찍 시작 (초)",
|
||||
"endLate": "늦게 종료 (초)",
|
||||
"newOnly": "새 에피소드만",
|
||||
"anyChannel": "모든 채널에서 녹화",
|
||||
"anyTime": "모든 시간대에 녹화",
|
||||
"skipInLibrary": "라이브러리에 이미 있는 에피소드 건너뛰기",
|
||||
"keepUpTo": "보관할 에피소드 수",
|
||||
"keepUpToHint": "0이면 모든 에피소드 보관"
|
||||
},
|
||||
"startingInMinutes": "${minutes}분 후 시작",
|
||||
"dayAtTime": "${day} ${time}",
|
||||
"invalidPlaybackData": "${product}에서 잘못된 실시간 TV 재생 데이터를 반환했습니다",
|
||||
@@ -1483,7 +1515,13 @@
|
||||
"removeRoom": "제거",
|
||||
"guestSwitchUnavailable": "전환할 수 없음 — 동기화 서버를 사용할 수 없습니다",
|
||||
"guestSwitchFailed": "전환할 수 없음 — 이 서버에서 콘텐츠를 찾을 수 없습니다",
|
||||
"defaultDisplayName": "사용자"
|
||||
"defaultDisplayName": "사용자",
|
||||
"errors": {
|
||||
"timedOut": "릴레이 서버가 제시간에 응답하지 않았습니다",
|
||||
"connectionLost": "세션이 준비되기 전에 연결이 종료되었습니다",
|
||||
"invalidRelayResponse": "릴레이 서버가 예기치 않은 응답을 보냈습니다",
|
||||
"sessionEnded": "호스트가 세션을 종료했습니다"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "다운로드",
|
||||
@@ -1631,7 +1669,8 @@
|
||||
"usePhoneToControl": "모바일 기기로 이 앱을 제어하세요",
|
||||
"startServer": "서버 시작",
|
||||
"stopServer": "서버 중지",
|
||||
"minimize": "최소화"
|
||||
"minimize": "최소화",
|
||||
"manualAddressHint": "수동 연결 주소:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "같은 Plex 계정의 Plezy 기기가 여기에 표시됩니다",
|
||||
@@ -1920,6 +1959,7 @@
|
||||
"statusPartiallyAvailable": "일부 사용 가능",
|
||||
"statusRequested": "요청됨",
|
||||
"statusProcessing": "처리 중",
|
||||
"statusBlocklisted": "차단 목록에 있음",
|
||||
"couldNotReach": "${url}에 연결할 수 없습니다: ${error}",
|
||||
"noInstanceAtUrl": "${url}에 Seerr 인스턴스가 없습니다(HTTP ${status})",
|
||||
"notInitialized": "이 Seerr 인스턴스는 최초 실행 설정을 완료하지 않았습니다",
|
||||
@@ -2011,6 +2051,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "다른 프로필의 연결을 재사용합니다. PIN으로 보호된 프로필에는 PIN이 필요합니다.",
|
||||
"invalidCredentials": "사용자 이름 또는 비밀번호가 올바르지 않습니다",
|
||||
"authResponseNotJson": "인증 응답이 유효한 JSON이 아닙니다",
|
||||
"authResponseIncomplete": "서버의 로그인 응답이 불완전합니다",
|
||||
"quickConnectRejected": "서버에서 Quick Connect를 거부했습니다",
|
||||
"quickConnectNotJson": "Quick Connect 응답이 유효한 JSON이 아닙니다",
|
||||
"quickConnectMissingFields": "Quick Connect 응답에 코드 또는 비밀 키가 없습니다",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "I/T",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serie",
|
||||
"season": "Sesong",
|
||||
"episode": "Episode",
|
||||
"artist": "Artist",
|
||||
"album": "Album",
|
||||
"track": "Spor",
|
||||
"collection": "Samling",
|
||||
"playlist": "Spilleliste",
|
||||
"clip": "Klipp",
|
||||
"photo": "Bilde",
|
||||
"folder": "Mappe"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Lisenser",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Åpne bilde-i-bilde når du forlater appen under avspilling",
|
||||
"matchContentFrameRate": "Tilpass innholdets bildefrekvens",
|
||||
"matchContentFrameRateDescription": "Tilpass skjermens oppdateringsfrekvens til videoinnhold",
|
||||
"matchContentResolution": "Tilpass til innholdets oppløsning",
|
||||
"matchContentResolutionDescription": "Bytter skjermen til videoens opprinnelige oppløsning, slik at TV-en tar seg av oppskaleringen. Menyer og undertekster skaleres også opp under avspilling",
|
||||
"matchRefreshRate": "Tilpass oppdateringsfrekvens",
|
||||
"matchRefreshRateDescription": "Tilpass skjermens oppdateringsfrekvens i fullskjerm",
|
||||
"matchDynamicRange": "Tilpass dynamikkområde",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Tving opprinnelig DV7-avspilling og ikke prøv DV-konvertering på nytt",
|
||||
"dvConversionDv81Description": "Tving direkte RPU-konvertering til Dolby Vision-profil 8.1",
|
||||
"dvConversionHevcStripDescription": "Fjern Dolby Vision RPU/EL-lag og lever som vanlig HEVC",
|
||||
"demuxer": "Container-demukser",
|
||||
"demuxerDescription": "Hvilken demukser som leser direkteavspilte filer. Bytt til media3 hvis en fil oppfører seg rart.",
|
||||
"demuxerFfmpeg": "FFmpeg (anbefalt)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Spør om profil ved appåpning",
|
||||
"requireProfileSelectionOnOpenDescription": "Vis profilvalg hver gang appen åpnes",
|
||||
"forceTvMode": "Tving TV-modus",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Enheten støtter ikke bilde-i-bilde-modus",
|
||||
"voSwitchFailed": "Kunne ikke bytte videoutgang for bilde-i-bilde",
|
||||
"failed": "Bilde-i-bilde kunne ikke starte",
|
||||
"prepareFailed": "Bilde-i-bilde kunne ikke forberedes",
|
||||
"unknown": "En feil oppstod: ${error}"
|
||||
},
|
||||
"chapters": "Kapitler",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Ingen servere funnet for ${username} (${email})",
|
||||
"failedToLoadServers": "Kunne ikke laste servere: ${error}"
|
||||
"failedToLoadServers": "Kunne ikke laste servere: ${error}",
|
||||
"noValidServers": "Fant ingen brukbare servere på denne kontoen"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Tittel",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Oppdatering av programguiden er forespurt",
|
||||
"rulesProcessRequested": "Ny vurdering av reglene er forespurt",
|
||||
"recordShow": "Ta opp program",
|
||||
"recordSettings": {
|
||||
"startEarly": "Start tidligere (sekunder)",
|
||||
"endLate": "Slutt senere (sekunder)",
|
||||
"newOnly": "Bare nye episoder",
|
||||
"anyChannel": "Ta opp på alle kanaler",
|
||||
"anyTime": "Ta opp når som helst",
|
||||
"skipInLibrary": "Hopp over episoder som allerede finnes i biblioteket",
|
||||
"keepUpTo": "Episoder som skal beholdes",
|
||||
"keepUpToHint": "0 beholder alle episoder"
|
||||
},
|
||||
"startingInMinutes": "Starter om ${minutes} min",
|
||||
"dayAtTime": "${day} kl. ${time}",
|
||||
"invalidPlaybackData": "${product} returnerte ugyldige avspillingsdata for direkte-TV",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Fjern",
|
||||
"guestSwitchUnavailable": "Kunne ikke bytte — server ikke tilgjengelig for synkronisering",
|
||||
"guestSwitchFailed": "Kunne ikke bytte — innhold ble ikke funnet på denne serveren",
|
||||
"defaultDisplayName": "Bruker"
|
||||
"defaultDisplayName": "Bruker",
|
||||
"errors": {
|
||||
"timedOut": "Reléserveren svarte ikke i tide",
|
||||
"connectionLost": "Tilkoblingen ble lukket før økten var klar",
|
||||
"invalidRelayResponse": "Reléserveren sendte et uventet svar",
|
||||
"sessionEnded": "Verten avsluttet økten"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Nedlastinger",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Bruk mobilenheten din til å styre denne appen",
|
||||
"startServer": "Start server",
|
||||
"stopServer": "Stopp server",
|
||||
"minimize": "Minimer"
|
||||
"minimize": "Minimer",
|
||||
"manualAddressHint": "Manuell tilkoblingsadresse:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Plezy-enheter med samme Plex-konto vises her",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Delvis tilgjengelig",
|
||||
"statusRequested": "Forespurt",
|
||||
"statusProcessing": "Behandler",
|
||||
"statusBlocklisted": "På blokkeringslisten",
|
||||
"couldNotReach": "Kunne ikke nå ${url}: ${error}",
|
||||
"noInstanceAtUrl": "Ingen Seerr-instans på ${url} (HTTP ${status})",
|
||||
"notInitialized": "Denne Seerr-instansen har ikke fullført førstegangsoppsettet",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Gjenbruk en annen profils tilkobling. PIN-beskyttede profiler krever PIN.",
|
||||
"invalidCredentials": "Ugyldig brukernavn eller passord",
|
||||
"authResponseNotJson": "Autentiseringssvaret var ikke gyldig JSON",
|
||||
"authResponseIncomplete": "Påloggingssvaret fra serveren var ufullstendig",
|
||||
"quickConnectRejected": "Quick Connect ble avvist av serveren",
|
||||
"quickConnectNotJson": "Quick Connect-svaret var ikke gyldig JSON",
|
||||
"quickConnectMissingFields": "Quick Connect-svaret mangler en kode eller hemmelighet",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/A",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serie",
|
||||
"season": "Seizoen",
|
||||
"episode": "Aflevering",
|
||||
"artist": "Artiest",
|
||||
"album": "Album",
|
||||
"track": "Nummer",
|
||||
"collection": "Collectie",
|
||||
"playlist": "Afspeellijst",
|
||||
"clip": "Clip",
|
||||
"photo": "Foto",
|
||||
"folder": "Map"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licenties",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Schakel over naar beeld-in-beeld als je tijdens het afspelen de app verlaat",
|
||||
"matchContentFrameRate": "Inhoudsframesnelheid afstemmen",
|
||||
"matchContentFrameRateDescription": "Stem schermverversing af op videocontent",
|
||||
"matchContentResolution": "Aanpassen aan resolutie van content",
|
||||
"matchContentResolutionDescription": "Schakelt het beeldscherm naar de eigen resolutie van de video, zodat je tv het opschalen doet. Menu's en ondertitels worden tijdens het afspelen ook opgeschaald",
|
||||
"matchRefreshRate": "Verversingssnelheid afstemmen",
|
||||
"matchRefreshRateDescription": "Stem schermverversing af in volledig scherm",
|
||||
"matchDynamicRange": "Dynamisch bereik afstemmen",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Dwing native DV7 af en voorkom een nieuwe poging met DV-conversie",
|
||||
"dvConversionDv81Description": "Dwing directe RPU-conversie naar Dolby Vision-profiel 8.1 af",
|
||||
"dvConversionHevcStripDescription": "Verwijder Dolby Vision RPU/EL-lagen en bied gewone HEVC aan",
|
||||
"demuxer": "Container-demuxer",
|
||||
"demuxerDescription": "Welke demuxer direct afgespeelde bestanden inleest. Schakel over naar media3 als een bestand zich vreemd gedraagt.",
|
||||
"demuxerFfmpeg": "FFmpeg (aanbevolen)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Vraag om profiel bij openen",
|
||||
"requireProfileSelectionOnOpenDescription": "Toon profielselectie telkens wanneer de app wordt geopend",
|
||||
"forceTvMode": "Tv-modus afdwingen",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "Dit apparaat ondersteunt de beeld-in-beeldmodus niet",
|
||||
"voSwitchFailed": "Omschakelen van de video-uitvoer voor beeld-in-beeld is mislukt",
|
||||
"failed": "Beeld-in-beeld kon niet worden gestart",
|
||||
"prepareFailed": "Beeld-in-beeld kon niet worden voorbereid",
|
||||
"unknown": "Er is een fout opgetreden: ${error}"
|
||||
},
|
||||
"chapters": "Hoofdstukken",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Geen servers gevonden voor ${username} (${email})",
|
||||
"failedToLoadServers": "Kon servers niet laden: ${error}"
|
||||
"failedToLoadServers": "Kon servers niet laden: ${error}",
|
||||
"noValidServers": "Er zijn geen bruikbare servers gevonden voor dit account"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Titel",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Vernieuwing van de gids aangevraagd",
|
||||
"rulesProcessRequested": "Nieuwe evaluatie van regels aangevraagd",
|
||||
"recordShow": "Programma opnemen",
|
||||
"recordSettings": {
|
||||
"startEarly": "Eerder beginnen (seconden)",
|
||||
"endLate": "Later stoppen (seconden)",
|
||||
"newOnly": "Alleen nieuwe afleveringen",
|
||||
"anyChannel": "Op elke zender opnemen",
|
||||
"anyTime": "Op elk tijdstip opnemen",
|
||||
"skipInLibrary": "Afleveringen overslaan die al in de bibliotheek staan",
|
||||
"keepUpTo": "Te bewaren afleveringen",
|
||||
"keepUpToHint": "0 bewaart alle afleveringen"
|
||||
},
|
||||
"startingInMinutes": "Begint over ${minutes} min",
|
||||
"dayAtTime": "${day} om ${time}",
|
||||
"invalidPlaybackData": "${product} heeft ongeldige afspeelgegevens voor Live-tv geretourneerd",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Verwijderen",
|
||||
"guestSwitchUnavailable": "Kon niet schakelen — server niet beschikbaar voor synchronisatie",
|
||||
"guestSwitchFailed": "Kon niet schakelen — inhoud niet gevonden op deze server",
|
||||
"defaultDisplayName": "Gebruiker"
|
||||
"defaultDisplayName": "Gebruiker",
|
||||
"errors": {
|
||||
"timedOut": "De relayserver heeft niet op tijd gereageerd",
|
||||
"connectionLost": "De verbinding is verbroken voordat de sessie gereed was",
|
||||
"invalidRelayResponse": "De relayserver heeft een onverwacht antwoord verzonden",
|
||||
"sessionEnded": "De host heeft de sessie beëindigd"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Downloads",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Gebruik je mobiele apparaat om deze app te bedienen",
|
||||
"startServer": "Server starten",
|
||||
"stopServer": "Server stoppen",
|
||||
"minimize": "Minimaliseren"
|
||||
"minimize": "Minimaliseren",
|
||||
"manualAddressHint": "Handmatig verbindingsadres:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Plezy-apparaten met hetzelfde Plex-account verschijnen hier",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Gedeeltelijk beschikbaar",
|
||||
"statusRequested": "Aangevraagd",
|
||||
"statusProcessing": "Verwerken",
|
||||
"statusBlocklisted": "Op de blokkeerlijst",
|
||||
"couldNotReach": "Kon ${url} niet bereiken: ${error}",
|
||||
"noInstanceAtUrl": "Geen Seerr-instantie op ${url} (HTTP ${status})",
|
||||
"notInitialized": "De eerste configuratie van deze Seerr-instantie is niet voltooid",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Hergebruik de verbinding van een ander profiel. Voor profielen met pincodebeveiliging is een pincode vereist.",
|
||||
"invalidCredentials": "Ongeldige gebruikersnaam of ongeldig wachtwoord",
|
||||
"authResponseNotJson": "Het authenticatieantwoord was geen geldige JSON",
|
||||
"authResponseIncomplete": "Het aanmeldingsantwoord van de server was onvolledig",
|
||||
"quickConnectRejected": "Quick Connect is door de server geweigerd",
|
||||
"quickConnectNotJson": "Het Quick Connect-antwoord was geen geldige JSON",
|
||||
"quickConnectMissingFields": "In het Quick Connect-antwoord ontbreekt een code of geheim",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/D",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Film",
|
||||
"show": "Serial",
|
||||
"season": "Sezon",
|
||||
"episode": "Odcinek",
|
||||
"artist": "Wykonawca",
|
||||
"album": "Album",
|
||||
"track": "Utwór",
|
||||
"collection": "Kolekcja",
|
||||
"playlist": "Playlista",
|
||||
"clip": "Klip",
|
||||
"photo": "Zdjęcie",
|
||||
"folder": "Folder"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licencje",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Automatycznie włączaj tryb obrazu w obrazie po opuszczeniu aplikacji podczas odtwarzania",
|
||||
"matchContentFrameRate": "Dopasuj częstotliwość klatek do treści",
|
||||
"matchContentFrameRateDescription": "Dopasuj częstotliwość odświeżania ekranu do wideo",
|
||||
"matchContentResolution": "Dopasuj do rozdzielczości materiału",
|
||||
"matchContentResolutionDescription": "Przełącza ekran na natywną rozdzielczość wideo, aby skalowaniem zajął się telewizor. Menu i napisy są podczas odtwarzania również skalowane",
|
||||
"matchRefreshRate": "Dopasuj częstotliwość odświeżania",
|
||||
"matchRefreshRateDescription": "Dopasuj częstotliwość odświeżania w trybie pełnoekranowym",
|
||||
"matchDynamicRange": "Dopasuj zakres dynamiki",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Wymuś natywne DV7 i wyłącz ponowną próbę konwersji DV",
|
||||
"dvConversionDv81Description": "Wymuś wbudowaną konwersję RPU do profilu Dolby Vision 8.1",
|
||||
"dvConversionHevcStripDescription": "Usuń warstwy Dolby Vision RPU/EL i przedstaw zwykłe HEVC",
|
||||
"demuxer": "Demukser kontenera",
|
||||
"demuxerDescription": "Który demukser analizuje pliki odtwarzane bezpośrednio. Przełącz na media3, jeśli plik sprawia problemy.",
|
||||
"demuxerFfmpeg": "FFmpeg (zalecany)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Pytaj o profil przy otwarciu aplikacji",
|
||||
"requireProfileSelectionOnOpenDescription": "Pokaż wybór profilu za każdym razem, gdy aplikacja jest otwierana",
|
||||
"forceTvMode": "Wymuś tryb TV",
|
||||
@@ -681,6 +701,7 @@
|
||||
"notSupported": "Urządzenie nie obsługuje trybu obraz w obrazie",
|
||||
"voSwitchFailed": "Nie udało się przełączyć wyjścia wideo dla trybu obraz w obrazie",
|
||||
"failed": "Nie udało się uruchomić trybu obraz w obrazie",
|
||||
"prepareFailed": "Nie udało się przygotować trybu obraz w obrazie",
|
||||
"unknown": "Wystąpił błąd: ${error}"
|
||||
},
|
||||
"chapters": "Rozdziały",
|
||||
@@ -1042,7 +1063,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Nie znaleziono serwerów dla ${username} (${email})",
|
||||
"failedToLoadServers": "Nie udało się załadować serwerów: ${error}"
|
||||
"failedToLoadServers": "Nie udało się załadować serwerów: ${error}",
|
||||
"noValidServers": "Nie znaleziono żadnych zdatnych serwerów na tym koncie"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Tytuł",
|
||||
@@ -1355,6 +1377,16 @@
|
||||
"guideReloadRequested": "Zażądano odświeżenia przewodnika",
|
||||
"rulesProcessRequested": "Zażądano ponownej oceny reguł",
|
||||
"recordShow": "Nagraj program",
|
||||
"recordSettings": {
|
||||
"startEarly": "Zacznij wcześniej (sekundy)",
|
||||
"endLate": "Zakończ później (sekundy)",
|
||||
"newOnly": "Tylko nowe odcinki",
|
||||
"anyChannel": "Nagrywaj na dowolnym kanale",
|
||||
"anyTime": "Nagrywaj o dowolnej porze",
|
||||
"skipInLibrary": "Pomijaj odcinki już obecne w bibliotece",
|
||||
"keepUpTo": "Odcinki do zachowania",
|
||||
"keepUpToHint": "0 zachowuje wszystkie odcinki"
|
||||
},
|
||||
"startingInMinutes": "Rozpocznie się za ${minutes} min",
|
||||
"dayAtTime": "${day} o ${time}",
|
||||
"invalidPlaybackData": "${product} zwrócił nieprawidłowe dane odtwarzania TV na żywo",
|
||||
@@ -1513,7 +1545,13 @@
|
||||
"removeRoom": "Usuń",
|
||||
"guestSwitchUnavailable": "Nie można przełączyć — serwer niedostępny do synchronizacji",
|
||||
"guestSwitchFailed": "Nie można przełączyć — nie znaleziono treści na tym serwerze",
|
||||
"defaultDisplayName": "Użytkownik"
|
||||
"defaultDisplayName": "Użytkownik",
|
||||
"errors": {
|
||||
"timedOut": "Serwer pośredniczący nie odpowiedział w wymaganym czasie",
|
||||
"connectionLost": "Połączenie zostało zamknięte, zanim sesja była gotowa",
|
||||
"invalidRelayResponse": "Serwer pośredniczący wysłał nieoczekiwaną odpowiedź",
|
||||
"sessionEnded": "Gospodarz zakończył sesję"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Pobrania",
|
||||
@@ -1661,7 +1699,8 @@
|
||||
"usePhoneToControl": "Użyj urządzenia mobilnego, aby sterować tą aplikacją",
|
||||
"startServer": "Uruchom serwer",
|
||||
"stopServer": "Zatrzymaj serwer",
|
||||
"minimize": "Minimalizuj"
|
||||
"minimize": "Minimalizuj",
|
||||
"manualAddressHint": "Ręczny adres połączenia:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Urządzenia Plezy z tym samym kontem Plex pojawią się tutaj",
|
||||
@@ -1950,6 +1989,7 @@
|
||||
"statusPartiallyAvailable": "Częściowo dostępne",
|
||||
"statusRequested": "Zamówione",
|
||||
"statusProcessing": "Przetwarzanie",
|
||||
"statusBlocklisted": "Na liście blokowanych",
|
||||
"couldNotReach": "Nie udało się połączyć z ${url}: ${error}",
|
||||
"noInstanceAtUrl": "Pod adresem ${url} nie ma instancji Seerr (HTTP ${status})",
|
||||
"notInitialized": "Ta instancja Seerr nie ukończyła konfiguracji początkowej",
|
||||
@@ -2041,6 +2081,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Użyj połączenia innego profilu. Profile chronione PIN-em wymagają podania PIN-u.",
|
||||
"invalidCredentials": "Nieprawidłowa nazwa użytkownika lub hasło",
|
||||
"authResponseNotJson": "Odpowiedź uwierzytelniania ma nieprawidłowy format JSON",
|
||||
"authResponseIncomplete": "Odpowiedź logowania z serwera była niekompletna",
|
||||
"quickConnectRejected": "Quick Connect został odrzucony przez serwer",
|
||||
"quickConnectNotJson": "Odpowiedź Quick Connect ma nieprawidłowy format JSON",
|
||||
"quickConnectMissingFields": "W odpowiedzi Quick Connect brakuje kodu lub sekretu",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "N/D",
|
||||
"url": "URL",
|
||||
"letterKeys": "ABC"
|
||||
"letterKeys": "ABC",
|
||||
"mediaKind": {
|
||||
"movie": "Filme",
|
||||
"show": "Série",
|
||||
"season": "Temporada",
|
||||
"episode": "Episódio",
|
||||
"artist": "Artista",
|
||||
"album": "Álbum",
|
||||
"track": "Faixa",
|
||||
"collection": "Coleção",
|
||||
"playlist": "Playlist",
|
||||
"clip": "Clipe",
|
||||
"photo": "Foto",
|
||||
"folder": "Pasta"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Licenças",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Entrar automaticamente no modo picture-in-picture ao sair do app durante a reprodução",
|
||||
"matchContentFrameRate": "Ajustar à taxa de quadros do conteúdo",
|
||||
"matchContentFrameRateDescription": "Ajustar a taxa de atualização da tela ao conteúdo de vídeo",
|
||||
"matchContentResolution": "Ajustar à resolução do conteúdo",
|
||||
"matchContentResolutionDescription": "Muda a tela para a resolução nativa do vídeo para que a TV cuide do upscaling. Menus e legendas também são ampliados durante a reprodução",
|
||||
"matchRefreshRate": "Ajustar à taxa de atualização",
|
||||
"matchRefreshRateDescription": "Ajustar a taxa de atualização da tela em tela cheia",
|
||||
"matchDynamicRange": "Ajustar à faixa dinâmica",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Forçar DV7 nativo e impedir uma nova tentativa de conversão de DV",
|
||||
"dvConversionDv81Description": "Forçar a conversão RPU integrada para Dolby Vision perfil 8.1",
|
||||
"dvConversionHevcStripDescription": "Remover as camadas RPU/EL do Dolby Vision e apresentar HEVC sem Dolby Vision",
|
||||
"demuxer": "Demuxer de contêiner",
|
||||
"demuxerDescription": "Qual demuxer processa os arquivos reproduzidos diretamente. Mude para media3 se algum arquivo apresentar problemas.",
|
||||
"demuxerFfmpeg": "FFmpeg (recomendado)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Pedir perfil ao abrir o app",
|
||||
"requireProfileSelectionOnOpenDescription": "Mostrar a seleção de perfil sempre que o app for aberto",
|
||||
"forceTvMode": "Forçar modo TV",
|
||||
@@ -675,6 +695,7 @@
|
||||
"notSupported": "O dispositivo não suporta modo picture-in-picture",
|
||||
"voSwitchFailed": "Falha ao trocar saída de vídeo para picture-in-picture",
|
||||
"failed": "Falha ao iniciar picture-in-picture",
|
||||
"prepareFailed": "Não foi possível preparar o picture-in-picture",
|
||||
"unknown": "Ocorreu um erro: ${error}"
|
||||
},
|
||||
"chapters": "Capítulos",
|
||||
@@ -1032,7 +1053,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Nenhum servidor encontrado para ${username} (${email})",
|
||||
"failedToLoadServers": "Falha ao carregar servidores: ${error}"
|
||||
"failedToLoadServers": "Falha ao carregar servidores: ${error}",
|
||||
"noValidServers": "Nenhum servidor utilizável foi encontrado nesta conta"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Título",
|
||||
@@ -1337,6 +1359,16 @@
|
||||
"guideReloadRequested": "Atualização do guia solicitada",
|
||||
"rulesProcessRequested": "Reavaliação de regras solicitada",
|
||||
"recordShow": "Gravar programa",
|
||||
"recordSettings": {
|
||||
"startEarly": "Começar antes (segundos)",
|
||||
"endLate": "Terminar depois (segundos)",
|
||||
"newOnly": "Apenas episódios novos",
|
||||
"anyChannel": "Gravar em qualquer canal",
|
||||
"anyTime": "Gravar a qualquer hora",
|
||||
"skipInLibrary": "Ignorar episódios que já estão na biblioteca",
|
||||
"keepUpTo": "Episódios a manter",
|
||||
"keepUpToHint": "0 mantém todos os episódios"
|
||||
},
|
||||
"startingInMinutes": "Começa em ${minutes} min",
|
||||
"dayAtTime": "${day} às ${time}",
|
||||
"invalidPlaybackData": "${product} retornou dados inválidos de reprodução de TV ao Vivo",
|
||||
@@ -1493,7 +1525,13 @@
|
||||
"removeRoom": "Remover",
|
||||
"guestSwitchUnavailable": "Não foi possível trocar — servidor indisponível para sincronização",
|
||||
"guestSwitchFailed": "Não foi possível trocar — conteúdo não encontrado neste servidor",
|
||||
"defaultDisplayName": "Usuário"
|
||||
"defaultDisplayName": "Usuário",
|
||||
"errors": {
|
||||
"timedOut": "O servidor de retransmissão não respondeu a tempo",
|
||||
"connectionLost": "A conexão foi encerrada antes de a sessão ficar pronta",
|
||||
"invalidRelayResponse": "O servidor de retransmissão enviou uma resposta inesperada",
|
||||
"sessionEnded": "O anfitrião encerrou a sessão"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Downloads",
|
||||
@@ -1641,7 +1679,8 @@
|
||||
"usePhoneToControl": "Use seu dispositivo móvel para controlar este app",
|
||||
"startServer": "Iniciar servidor",
|
||||
"stopServer": "Parar servidor",
|
||||
"minimize": "Minimizar"
|
||||
"minimize": "Minimizar",
|
||||
"manualAddressHint": "Endereço de conexão manual:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Dispositivos Plezy com a mesma conta Plex aparecem aqui",
|
||||
@@ -1930,6 +1969,7 @@
|
||||
"statusPartiallyAvailable": "Parcialmente disponível",
|
||||
"statusRequested": "Solicitado",
|
||||
"statusProcessing": "Processando",
|
||||
"statusBlocklisted": "Na lista de bloqueio",
|
||||
"couldNotReach": "Não foi possível acessar ${url}: ${error}",
|
||||
"noInstanceAtUrl": "Nenhuma instância do Seerr em ${url} (HTTP ${status})",
|
||||
"notInitialized": "Esta instância do Seerr não concluiu a configuração inicial",
|
||||
@@ -2021,6 +2061,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Reutilize a conexão de outro perfil. Perfis protegidos por PIN exigem PIN.",
|
||||
"invalidCredentials": "Usuário ou senha inválidos",
|
||||
"authResponseNotJson": "A resposta de autenticação não era um JSON válido",
|
||||
"authResponseIncomplete": "A resposta de login do servidor estava incompleta",
|
||||
"quickConnectRejected": "O Quick Connect foi rejeitado pelo servidor",
|
||||
"quickConnectNotJson": "A resposta do Quick Connect não era um JSON válido",
|
||||
"quickConnectMissingFields": "A resposta do Quick Connect não contém um código ou segredo",
|
||||
|
||||
+45
-4
@@ -81,7 +81,21 @@
|
||||
},
|
||||
"notAvailable": "Н/Д",
|
||||
"url": "URL",
|
||||
"letterKeys": "АБВ"
|
||||
"letterKeys": "АБВ",
|
||||
"mediaKind": {
|
||||
"movie": "Фильм",
|
||||
"show": "Сериал",
|
||||
"season": "Сезон",
|
||||
"episode": "Эпизод",
|
||||
"artist": "Исполнитель",
|
||||
"album": "Альбом",
|
||||
"track": "Трек",
|
||||
"collection": "Коллекция",
|
||||
"playlist": "Плейлист",
|
||||
"clip": "Клип",
|
||||
"photo": "Фото",
|
||||
"folder": "Папка"
|
||||
}
|
||||
},
|
||||
"screens": {
|
||||
"licenses": "Лицензии",
|
||||
@@ -291,6 +305,8 @@
|
||||
"autoPipDescription": "Автоматически включать режим «картинка в картинке» при выходе из приложения во время воспроизведения",
|
||||
"matchContentFrameRate": "Соответствие частоты кадров контента",
|
||||
"matchContentFrameRateDescription": "Подстраивать частоту обновления экрана под видео",
|
||||
"matchContentResolution": "Подстраивать под разрешение контента",
|
||||
"matchContentResolutionDescription": "Переключает экран на исходное разрешение видео, чтобы масштабированием занимался телевизор. Во время воспроизведения меню и субтитры тоже масштабируются",
|
||||
"matchRefreshRate": "Соответствие частоты обновления",
|
||||
"matchRefreshRateDescription": "Подстраивать частоту обновления в полноэкранном режиме",
|
||||
"matchDynamicRange": "Соответствие динамического диапазона",
|
||||
@@ -319,6 +335,10 @@
|
||||
"dvConversionNativeDescription": "Принудительно использовать нативный DV7 и не повторять DV-конвертацию",
|
||||
"dvConversionDv81Description": "Принудительно выполнять inline-конвертацию RPU в Dolby Vision профиль 8.1",
|
||||
"dvConversionHevcStripDescription": "Удалять слои Dolby Vision RPU/EL и передавать обычный HEVC",
|
||||
"demuxer": "Демультиплексор контейнера",
|
||||
"demuxerDescription": "Какой демультиплексор разбирает файлы при прямом воспроизведении. Переключитесь на media3, если файл воспроизводится неправильно.",
|
||||
"demuxerFfmpeg": "FFmpeg (рекомендуется)",
|
||||
"demuxerMedia3": "media3",
|
||||
"requireProfileSelectionOnOpen": "Запрашивать профиль при запуске",
|
||||
"requireProfileSelectionOnOpenDescription": "Показывать выбор профиля при каждом открытии приложения",
|
||||
"forceTvMode": "Принудительный режим ТВ",
|
||||
@@ -681,6 +701,7 @@
|
||||
"notSupported": "Устройство не поддерживает режим «картинка в картинке»",
|
||||
"voSwitchFailed": "Не удалось переключить видеовыход для «картинки в картинке»",
|
||||
"failed": "Не удалось запустить режим «картинка в картинке»",
|
||||
"prepareFailed": "Не удалось подготовить режим «картинка в картинке»",
|
||||
"unknown": "Произошла ошибка: ${error}"
|
||||
},
|
||||
"chapters": "Главы",
|
||||
@@ -1042,7 +1063,8 @@
|
||||
},
|
||||
"serverSelection": {
|
||||
"noServersFoundForAccount": "Серверы не найдены для ${username} (${email})",
|
||||
"failedToLoadServers": "Не удалось загрузить серверы: ${error}"
|
||||
"failedToLoadServers": "Не удалось загрузить серверы: ${error}",
|
||||
"noValidServers": "В этой учётной записи не найдено пригодных серверов"
|
||||
},
|
||||
"hubDetail": {
|
||||
"title": "Название",
|
||||
@@ -1355,6 +1377,16 @@
|
||||
"guideReloadRequested": "Запрошено обновление гайда",
|
||||
"rulesProcessRequested": "Запрошен пересчёт правил",
|
||||
"recordShow": "Записать передачу",
|
||||
"recordSettings": {
|
||||
"startEarly": "Начинать раньше (секунды)",
|
||||
"endLate": "Заканчивать позже (секунды)",
|
||||
"newOnly": "Только новые эпизоды",
|
||||
"anyChannel": "Записывать на любом канале",
|
||||
"anyTime": "Записывать в любое время",
|
||||
"skipInLibrary": "Пропускать эпизоды, уже имеющиеся в библиотеке",
|
||||
"keepUpTo": "Сколько эпизодов хранить",
|
||||
"keepUpToHint": "0 — хранить все эпизоды"
|
||||
},
|
||||
"startingInMinutes": "Начало через ${minutes} мин",
|
||||
"dayAtTime": "${day} в ${time}",
|
||||
"invalidPlaybackData": "${product} вернул некорректные данные для воспроизведения ТВ в прямом эфире",
|
||||
@@ -1513,7 +1545,13 @@
|
||||
"removeRoom": "Удалить",
|
||||
"guestSwitchUnavailable": "Не удалось переключиться — сервер недоступен для синхронизации",
|
||||
"guestSwitchFailed": "Не удалось переключиться — содержимое не найдено на этом сервере",
|
||||
"defaultDisplayName": "Пользователь"
|
||||
"defaultDisplayName": "Пользователь",
|
||||
"errors": {
|
||||
"timedOut": "Сервер ретрансляции не ответил вовремя",
|
||||
"connectionLost": "Соединение закрылось до того, как сессия была готова",
|
||||
"invalidRelayResponse": "Сервер ретрансляции прислал неожиданный ответ",
|
||||
"sessionEnded": "Организатор завершил сессию"
|
||||
}
|
||||
},
|
||||
"downloads": {
|
||||
"title": "Загрузки",
|
||||
@@ -1661,7 +1699,8 @@
|
||||
"usePhoneToControl": "Используйте мобильное устройство для управления этим приложением",
|
||||
"startServer": "Запустить сервер",
|
||||
"stopServer": "Остановить сервер",
|
||||
"minimize": "Свернуть"
|
||||
"minimize": "Свернуть",
|
||||
"manualAddressHint": "Адрес для подключения вручную:"
|
||||
},
|
||||
"pairing": {
|
||||
"discoveryDescription": "Устройства Plezy с тем же аккаунтом Plex появятся здесь",
|
||||
@@ -1950,6 +1989,7 @@
|
||||
"statusPartiallyAvailable": "Частично доступно",
|
||||
"statusRequested": "Запрошено",
|
||||
"statusProcessing": "Обработка",
|
||||
"statusBlocklisted": "В списке блокировки",
|
||||
"couldNotReach": "Не удалось связаться с ${url}: ${error}",
|
||||
"noInstanceAtUrl": "По адресу ${url} нет экземпляра Seerr (HTTP ${status})",
|
||||
"notInitialized": "Первоначальная настройка этого экземпляра Seerr не завершена",
|
||||
@@ -2041,6 +2081,7 @@
|
||||
"borrowFromAnotherProfileSubtitle": "Повторно используйте подключение другого профиля. Для защищённых профилей потребуется PIN.",
|
||||
"invalidCredentials": "Неверное имя пользователя или пароль",
|
||||
"authResponseNotJson": "Ответ аутентификации не является допустимым JSON",
|
||||
"authResponseIncomplete": "Ответ сервера при входе оказался неполным",
|
||||
"quickConnectRejected": "Quick Connect был отклонён сервером",
|
||||
"quickConnectNotJson": "Ответ Quick Connect не является допустимым JSON",
|
||||
"quickConnectMissingFields": "В ответе Quick Connect отсутствует код или секрет",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// To regenerate, run: `dart run slang`
|
||||
///
|
||||
/// Locales: 22
|
||||
/// Strings: 40964 (1862 per locale)
|
||||
/// Strings: 41734 (1897 per locale)
|
||||
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint, unused_import
|
||||
|
||||
+106
-6
@@ -182,6 +182,7 @@ class _Translations$common$az extends Translations$common$en {
|
||||
@override String get notAvailable => 'N/A';
|
||||
@override String get url => 'URL';
|
||||
@override String get letterKeys => 'ABC';
|
||||
@override late final _Translations$common$mediaKind$az mediaKind = _Translations$common$mediaKind$az._(_root);
|
||||
}
|
||||
|
||||
// Path: screens
|
||||
@@ -412,6 +413,8 @@ class _Translations$settings$az extends Translations$settings$en {
|
||||
@override String get autoPipDescription => 'Oynatma zamanı tətbiqdən çıxdıqda avtomatik PiP rejiminə keç';
|
||||
@override String get matchContentFrameRate => 'Kadr tezliyini uyğunlaşdır';
|
||||
@override String get matchContentFrameRateDescription => 'Ekran yenilənmə tezliyini video məzmununa uyğunlaşdır';
|
||||
@override String get matchContentResolution => 'Məzmunun görüntü keyfiyyətinə uyğunlaş';
|
||||
@override String get matchContentResolutionDescription => 'Ekranı videonun öz görüntü keyfiyyətinə keçirir ki, miqyaslandırmanı televizorunuz etsin. Oxutma zamanı menyular və altyazılar da miqyaslandırılır';
|
||||
@override String get matchRefreshRate => 'Yenilənmə tezliyini uyğunlaşdır';
|
||||
@override String get matchRefreshRateDescription => 'Tam ekranda ekran yenilənmə tezliyini uyğunlaşdır';
|
||||
@override String get matchDynamicRange => 'Dinamik diapazonu uyğunlaşdır';
|
||||
@@ -440,6 +443,10 @@ class _Translations$settings$az extends Translations$settings$en {
|
||||
@override String get dvConversionNativeDescription => 'Daxili DV7-ni məcburi et';
|
||||
@override String get dvConversionDv81Description => 'Dolby Vision profile 8.1-ə çevrilməni məcburi et';
|
||||
@override String get dvConversionHevcStripDescription => 'Dolby Vision təbəqələrini sil və sadə HEVC kimi təqdim et';
|
||||
@override String get demuxer => 'Konteyner demukseri';
|
||||
@override String get demuxerDescription => 'Birbaşa oxudulan faylları hansı demukserin təhlil edəcəyi. Fayl düzgün işləmirsə, media3-ə keçin.';
|
||||
@override String get demuxerFfmpeg => 'FFmpeg (Tövsiyə olunan)';
|
||||
@override String get demuxerMedia3 => 'media3';
|
||||
@override String get requireProfileSelectionOnOpen => 'Açılışda profil soruş';
|
||||
@override String get requireProfileSelectionOnOpenDescription => 'Tətbiq hər dəfə açıldıqda profil seçimini göstər';
|
||||
@override String get forceTvMode => 'TV rejimini məcburi et';
|
||||
@@ -1214,6 +1221,7 @@ class _Translations$serverSelection$az extends Translations$serverSelection$en {
|
||||
// Translations
|
||||
@override String noServersFoundForAccount({required Object username, required Object email}) => '${username} (${email}) üçün server tapılmadı';
|
||||
@override String failedToLoadServers({required Object error}) => 'Serverlər yüklənə bilmədi: ${error}';
|
||||
@override String get noValidServers => 'Bu hesabda istifadəyə yararlı server tapılmadı';
|
||||
}
|
||||
|
||||
// Path: hubDetail
|
||||
@@ -1432,6 +1440,7 @@ class _Translations$liveTv$az extends Translations$liveTv$en {
|
||||
@override String get guideReloadRequested => 'Bələdçi yenilənməsi tələb olundu';
|
||||
@override String get rulesProcessRequested => 'Qaydaların yenidən qiymətləndirilməsi tələb olundu';
|
||||
@override String get recordShow => 'Şounu yaz';
|
||||
@override late final _Translations$liveTv$recordSettings$az recordSettings = _Translations$liveTv$recordSettings$az._(_root);
|
||||
@override String startingInMinutes({required Object minutes}) => '${minutes} dəq sonra başlayır';
|
||||
@override String dayAtTime({required Object day, required Object time}) => '${day}, saat ${time}';
|
||||
@override String invalidPlaybackData({required Object product}) => '${product} etibarsız Canlı TV oynatma məlumatı qaytardı';
|
||||
@@ -1613,6 +1622,7 @@ class _Translations$watchTogether$az extends Translations$watchTogether$en {
|
||||
@override String get guestSwitchUnavailable => 'Keçid etmək olmadı — eyniləşdirmə üçün server əlçatan deyil';
|
||||
@override String get guestSwitchFailed => 'Keçid etmək olmadı — məzmun tapılmadı';
|
||||
@override String get defaultDisplayName => 'İstifadəçi';
|
||||
@override late final _Translations$watchTogether$errors$az errors = _Translations$watchTogether$errors$az._(_root);
|
||||
}
|
||||
|
||||
// Path: downloads
|
||||
@@ -2034,6 +2044,7 @@ class _Translations$seerr$az extends Translations$seerr$en {
|
||||
@override String get statusPartiallyAvailable => 'Hissəvi əlçatandır';
|
||||
@override String get statusRequested => 'Sorğu göndərildi';
|
||||
@override String get statusProcessing => 'Emal edilir';
|
||||
@override String get statusBlocklisted => 'Bloklanmış';
|
||||
@override String couldNotReach({required Object url, required Object error}) => '${url} ünvanına çatmaq olmadı: ${error}';
|
||||
@override String noInstanceAtUrl({required Object url, required Object status}) => '${url} ünvanında Seerr instansiyası yoxdur (HTTP ${status})';
|
||||
@override String get notInitialized => 'Bu Seerr instansiyasının ilkin quraşdırılması tamamlanmayıb';
|
||||
@@ -2106,6 +2117,7 @@ class _Translations$addServer$az extends Translations$addServer$en {
|
||||
@override String get borrowFromAnotherProfileSubtitle => 'Başqa profilin qoşulmasını yenidən istifadə edin.';
|
||||
@override String get invalidCredentials => 'İstifadəçi adı və ya şifrə yanlışdır';
|
||||
@override String get authResponseNotJson => 'Autentifikasiya cavabı etibarlı JSON deyildi';
|
||||
@override String get authResponseIncomplete => 'Serverin giriş cavabı natamam idi';
|
||||
@override String get quickConnectRejected => 'Quick Connect server tərəfindən rədd edildi';
|
||||
@override String get quickConnectNotJson => 'Quick Connect cavabı etibarlı JSON deyildi';
|
||||
@override String get quickConnectMissingFields => 'Quick Connect cavabında kod və ya məxfi açar yoxdur';
|
||||
@@ -2144,6 +2156,27 @@ class _Translations$common$ratingSource$az extends Translations$common$ratingSou
|
||||
@override String get rottenTomatoesAudience => 'Rotten Tomatoes tamaşaçıları';
|
||||
}
|
||||
|
||||
// Path: common.mediaKind
|
||||
class _Translations$common$mediaKind$az extends Translations$common$mediaKind$en {
|
||||
_Translations$common$mediaKind$az._(TranslationsAz root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsAz _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get movie => 'Film';
|
||||
@override String get show => 'Serial';
|
||||
@override String get season => 'Sezon';
|
||||
@override String get episode => 'Epizod';
|
||||
@override String get artist => 'İfaçı';
|
||||
@override String get album => 'Albom';
|
||||
@override String get track => 'Mahnı';
|
||||
@override String get collection => 'Kolleksiya';
|
||||
@override String get playlist => 'Pleylist';
|
||||
@override String get clip => 'Klip';
|
||||
@override String get photo => 'Şəkil';
|
||||
@override String get folder => 'Qovluq';
|
||||
}
|
||||
|
||||
// Path: hotkeys.actions
|
||||
class _Translations$hotkeys$actions$az extends Translations$hotkeys$actions$en {
|
||||
_Translations$hotkeys$actions$az._(TranslationsAz root) : this._root = root, super.internal(root);
|
||||
@@ -2191,6 +2224,7 @@ class _Translations$videoControls$pipErrors$az extends Translations$videoControl
|
||||
@override String get notSupported => 'Cihaz PiP rejimini dəstəkləmir';
|
||||
@override String get voSwitchFailed => 'PiP üçün video çıxışı dəyişdirilə bilmədi';
|
||||
@override String get failed => 'PiP rejimi başladılarkən xəta';
|
||||
@override String get prepareFailed => 'PiP rejimi hazırlana bilmədi';
|
||||
@override String unknown({required Object error}) => 'Xəta baş verdi: ${error}';
|
||||
}
|
||||
|
||||
@@ -2486,6 +2520,23 @@ class _Translations$explore$detail$az extends Translations$explore$detail$en {
|
||||
@override String get background => 'Arxa fon';
|
||||
}
|
||||
|
||||
// Path: liveTv.recordSettings
|
||||
class _Translations$liveTv$recordSettings$az extends Translations$liveTv$recordSettings$en {
|
||||
_Translations$liveTv$recordSettings$az._(TranslationsAz root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsAz _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get startEarly => 'Erkən başla (saniyə)';
|
||||
@override String get endLate => 'Gec bitir (saniyə)';
|
||||
@override String get newOnly => 'Yalnız yeni epizodlar';
|
||||
@override String get anyChannel => 'İstənilən kanalda yaz';
|
||||
@override String get anyTime => 'İstənilən vaxt yaz';
|
||||
@override String get skipInLibrary => 'Kitabxanada artıq olan epizodları ötür';
|
||||
@override String get keepUpTo => 'Saxlanılacaq epizodlar';
|
||||
@override String get keepUpToHint => '0 bütün epizodları saxlayır';
|
||||
}
|
||||
|
||||
// Path: music.discography
|
||||
class _Translations$music$discography$az extends Translations$music$discography$en {
|
||||
_Translations$music$discography$az._(TranslationsAz root) : this._root = root, super.internal(root);
|
||||
@@ -2498,6 +2549,19 @@ class _Translations$music$discography$az extends Translations$music$discography$
|
||||
@override String get compilations => 'Kompilyasiyalar';
|
||||
}
|
||||
|
||||
// Path: watchTogether.errors
|
||||
class _Translations$watchTogether$errors$az extends Translations$watchTogether$errors$en {
|
||||
_Translations$watchTogether$errors$az._(TranslationsAz root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsAz _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get timedOut => 'Rele serveri vaxtında cavab vermədi';
|
||||
@override String get connectionLost => 'Bağlantı seans hazır olmamış kəsildi';
|
||||
@override String get invalidRelayResponse => 'Rele serveri gözlənilməz cavab göndərdi';
|
||||
@override String get sessionEnded => 'Təşkilatçı seansı bitirdi';
|
||||
}
|
||||
|
||||
// Path: downloads.backgroundWarning
|
||||
class _Translations$downloads$backgroundWarning$az extends Translations$downloads$backgroundWarning$en {
|
||||
_Translations$downloads$backgroundWarning$az._(TranslationsAz root) : this._root = root, super.internal(root);
|
||||
@@ -2551,6 +2615,7 @@ class _Translations$companionRemote$session$az extends Translations$companionRem
|
||||
@override String get startServer => 'Serveri başlat';
|
||||
@override String get stopServer => 'Serveri dayandır';
|
||||
@override String get minimize => 'Yığ';
|
||||
@override String get manualAddressHint => 'Əl ilə bağlantı ünvanı:';
|
||||
}
|
||||
|
||||
// Path: companionRemote.pairing
|
||||
@@ -2787,6 +2852,18 @@ extension on TranslationsAz {
|
||||
'common.notAvailable' => 'N/A',
|
||||
'common.url' => 'URL',
|
||||
'common.letterKeys' => 'ABC',
|
||||
'common.mediaKind.movie' => 'Film',
|
||||
'common.mediaKind.show' => 'Serial',
|
||||
'common.mediaKind.season' => 'Sezon',
|
||||
'common.mediaKind.episode' => 'Epizod',
|
||||
'common.mediaKind.artist' => 'İfaçı',
|
||||
'common.mediaKind.album' => 'Albom',
|
||||
'common.mediaKind.track' => 'Mahnı',
|
||||
'common.mediaKind.collection' => 'Kolleksiya',
|
||||
'common.mediaKind.playlist' => 'Pleylist',
|
||||
'common.mediaKind.clip' => 'Klip',
|
||||
'common.mediaKind.photo' => 'Şəkil',
|
||||
'common.mediaKind.folder' => 'Qovluq',
|
||||
'screens.licenses' => 'Lisenziyalar',
|
||||
'screens.switchProfile' => 'Profili dəyiş',
|
||||
'screens.subtitleStyling' => 'Altyazı tənzimləmələri',
|
||||
@@ -2990,6 +3067,8 @@ extension on TranslationsAz {
|
||||
'settings.autoPipDescription' => 'Oynatma zamanı tətbiqdən çıxdıqda avtomatik PiP rejiminə keç',
|
||||
'settings.matchContentFrameRate' => 'Kadr tezliyini uyğunlaşdır',
|
||||
'settings.matchContentFrameRateDescription' => 'Ekran yenilənmə tezliyini video məzmununa uyğunlaşdır',
|
||||
'settings.matchContentResolution' => 'Məzmunun görüntü keyfiyyətinə uyğunlaş',
|
||||
'settings.matchContentResolutionDescription' => 'Ekranı videonun öz görüntü keyfiyyətinə keçirir ki, miqyaslandırmanı televizorunuz etsin. Oxutma zamanı menyular və altyazılar da miqyaslandırılır',
|
||||
'settings.matchRefreshRate' => 'Yenilənmə tezliyini uyğunlaşdır',
|
||||
'settings.matchRefreshRateDescription' => 'Tam ekranda ekran yenilənmə tezliyini uyğunlaşdır',
|
||||
'settings.matchDynamicRange' => 'Dinamik diapazonu uyğunlaşdır',
|
||||
@@ -3018,6 +3097,10 @@ extension on TranslationsAz {
|
||||
'settings.dvConversionNativeDescription' => 'Daxili DV7-ni məcburi et',
|
||||
'settings.dvConversionDv81Description' => 'Dolby Vision profile 8.1-ə çevrilməni məcburi et',
|
||||
'settings.dvConversionHevcStripDescription' => 'Dolby Vision təbəqələrini sil və sadə HEVC kimi təqdim et',
|
||||
'settings.demuxer' => 'Konteyner demukseri',
|
||||
'settings.demuxerDescription' => 'Birbaşa oxudulan faylları hansı demukserin təhlil edəcəyi. Fayl düzgün işləmirsə, media3-ə keçin.',
|
||||
'settings.demuxerFfmpeg' => 'FFmpeg (Tövsiyə olunan)',
|
||||
'settings.demuxerMedia3' => 'media3',
|
||||
'settings.requireProfileSelectionOnOpen' => 'Açılışda profil soruş',
|
||||
'settings.requireProfileSelectionOnOpenDescription' => 'Tətbiq hər dəfə açıldıqda profil seçimini göstər',
|
||||
'settings.forceTvMode' => 'TV rejimini məcburi et',
|
||||
@@ -3205,6 +3288,8 @@ extension on TranslationsAz {
|
||||
'fileInfo.flagOriginal' => 'Orijinal',
|
||||
'fileInfo.channelsMono' => 'Mono',
|
||||
'fileInfo.dolbyVisionProfile' => ({required Object profile}) => 'Profil ${profile}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.markAsWatched' => 'Baxıldı olaraq işarələ',
|
||||
'mediaMenu.markAsUnwatched' => 'Baxılmadı olaraq işarələ',
|
||||
'mediaMenu.removeFromContinueWatching' => 'İzləməyə davam et-dən sil',
|
||||
@@ -3223,8 +3308,6 @@ extension on TranslationsAz {
|
||||
'mediaMenu.deleteMovieTitle' => 'Bu kino silinsin?',
|
||||
'mediaMenu.deleteEpisodeConfirm' => 'Seriyanı sil',
|
||||
'mediaMenu.deleteSeasonConfirm' => 'Mövsümü sil',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.deleteShowConfirm' => 'Serialı sil',
|
||||
'mediaMenu.deleteMovieConfirm' => 'Kinonu sil',
|
||||
'mediaMenu.deleteAnyway' => 'Yenə də sil',
|
||||
@@ -3346,6 +3429,7 @@ extension on TranslationsAz {
|
||||
'videoControls.pipErrors.notSupported' => 'Cihaz PiP rejimini dəstəkləmir',
|
||||
'videoControls.pipErrors.voSwitchFailed' => 'PiP üçün video çıxışı dəyişdirilə bilmədi',
|
||||
'videoControls.pipErrors.failed' => 'PiP rejimi başladılarkən xəta',
|
||||
'videoControls.pipErrors.prepareFailed' => 'PiP rejimi hazırlana bilmədi',
|
||||
'videoControls.pipErrors.unknown' => ({required Object error}) => 'Xəta baş verdi: ${error}',
|
||||
'videoControls.chapters' => 'Hissələr',
|
||||
'videoControls.noChaptersAvailable' => 'Hissələr əlçatan deyil',
|
||||
@@ -3666,6 +3750,7 @@ extension on TranslationsAz {
|
||||
'about.viewLicensesDescription' => 'Üçüncü tərəf kitabxanalarının lisenziyalarına baxın',
|
||||
'serverSelection.noServersFoundForAccount' => ({required Object username, required Object email}) => '${username} (${email}) üçün server tapılmadı',
|
||||
'serverSelection.failedToLoadServers' => ({required Object error}) => 'Serverlər yüklənə bilmədi: ${error}',
|
||||
'serverSelection.noValidServers' => 'Bu hesabda istifadəyə yararlı server tapılmadı',
|
||||
'hubDetail.title' => 'Başlıq',
|
||||
'hubDetail.releaseYear' => 'Buraxılış ili',
|
||||
'hubDetail.dateAdded' => 'Əlavə olunma tarixi',
|
||||
@@ -3717,6 +3802,8 @@ extension on TranslationsAz {
|
||||
'explore.rows.watchlist' => 'İzləmə siyahısı',
|
||||
'explore.rows.recommendedMovies' => 'Tövsiyə olunan kinolar',
|
||||
'explore.rows.recommendedShows' => 'Tövsiyə olunan seriallar',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.rows.trendingMovies' => 'Trend kinolar',
|
||||
'explore.rows.trendingShows' => 'Trend seriallar',
|
||||
'explore.rows.popularMovies' => 'Məşhur kinolar',
|
||||
@@ -3737,8 +3824,6 @@ extension on TranslationsAz {
|
||||
'explore.characters' => 'Personajlar',
|
||||
'explore.addToWatchlist' => 'İzləmə siyahısına əlavə et',
|
||||
'explore.removeFromWatchlist' => 'İzləmə siyahısından sil',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.addedToWatchlist' => 'Baxış siyahısına əlavə edildi',
|
||||
'explore.removedFromWatchlist' => 'Baxış siyahısından silindi',
|
||||
'explore.watchlistUpdateFailed' => 'İzləmə siyahısı yenilənə bilmədi',
|
||||
@@ -3926,6 +4011,14 @@ extension on TranslationsAz {
|
||||
'liveTv.guideReloadRequested' => 'Bələdçi yenilənməsi tələb olundu',
|
||||
'liveTv.rulesProcessRequested' => 'Qaydaların yenidən qiymətləndirilməsi tələb olundu',
|
||||
'liveTv.recordShow' => 'Şounu yaz',
|
||||
'liveTv.recordSettings.startEarly' => 'Erkən başla (saniyə)',
|
||||
'liveTv.recordSettings.endLate' => 'Gec bitir (saniyə)',
|
||||
'liveTv.recordSettings.newOnly' => 'Yalnız yeni epizodlar',
|
||||
'liveTv.recordSettings.anyChannel' => 'İstənilən kanalda yaz',
|
||||
'liveTv.recordSettings.anyTime' => 'İstənilən vaxt yaz',
|
||||
'liveTv.recordSettings.skipInLibrary' => 'Kitabxanada artıq olan epizodları ötür',
|
||||
'liveTv.recordSettings.keepUpTo' => 'Saxlanılacaq epizodlar',
|
||||
'liveTv.recordSettings.keepUpToHint' => '0 bütün epizodları saxlayır',
|
||||
'liveTv.startingInMinutes' => ({required Object minutes}) => '${minutes} dəq sonra başlayır',
|
||||
'liveTv.dayAtTime' => ({required Object day, required Object time}) => '${day}, saat ${time}',
|
||||
'liveTv.invalidPlaybackData' => ({required Object product}) => '${product} etibarsız Canlı TV oynatma məlumatı qaytardı',
|
||||
@@ -4070,6 +4163,10 @@ extension on TranslationsAz {
|
||||
'watchTogether.guestSwitchUnavailable' => 'Keçid etmək olmadı — eyniləşdirmə üçün server əlçatan deyil',
|
||||
'watchTogether.guestSwitchFailed' => 'Keçid etmək olmadı — məzmun tapılmadı',
|
||||
'watchTogether.defaultDisplayName' => 'İstifadəçi',
|
||||
'watchTogether.errors.timedOut' => 'Rele serveri vaxtında cavab vermədi',
|
||||
'watchTogether.errors.connectionLost' => 'Bağlantı seans hazır olmamış kəsildi',
|
||||
'watchTogether.errors.invalidRelayResponse' => 'Rele serveri gözlənilməz cavab göndərdi',
|
||||
'watchTogether.errors.sessionEnded' => 'Təşkilatçı seansı bitirdi',
|
||||
'downloads.title' => 'Yükləmələr',
|
||||
'downloads.manage' => 'İdarə et',
|
||||
'downloads.tvShows' => 'TV Şoular',
|
||||
@@ -4209,6 +4306,7 @@ extension on TranslationsAz {
|
||||
'companionRemote.session.startServer' => 'Serveri başlat',
|
||||
'companionRemote.session.stopServer' => 'Serveri dayandır',
|
||||
'companionRemote.session.minimize' => 'Yığ',
|
||||
'companionRemote.session.manualAddressHint' => 'Əl ilə bağlantı ünvanı:',
|
||||
'companionRemote.pairing.discoveryDescription' => 'Eyni Plex hesabına sahib Plezy cihazları burada görünür',
|
||||
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
|
||||
'companionRemote.pairing.connecting' => 'Qoşulunur...',
|
||||
@@ -4218,6 +4316,8 @@ extension on TranslationsAz {
|
||||
'companionRemote.pairing.availableDevices' => 'Əlçatan cihazlar',
|
||||
'companionRemote.pairing.manualConnection' => 'Əl ilə qoşulma',
|
||||
'companionRemote.pairing.cryptoInitFailed' => 'Təhlükəsiz qoşulma başladılarkən xəta. Əvvəlcə Plex-ə daxil olun.',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.pairing.validationHostRequired' => 'Lütfən əsas cihaz ünvanını daxil edin',
|
||||
'companionRemote.pairing.validationHostFormat' => 'Format IP:port şəklində olmalıdır',
|
||||
'companionRemote.pairing.connectionTimedOut' => 'Qoşulma vaxtı bitdi.',
|
||||
@@ -4251,8 +4351,6 @@ extension on TranslationsAz {
|
||||
'companionRemote.remote.subtitles' => 'Altyazılar',
|
||||
'companionRemote.remote.audio' => 'Səs',
|
||||
'companionRemote.remote.searchHint' => 'Masaüstündə axtar...',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.errors.noNetworkInterface' => 'Şəbəkə interfeysi tapılmadı',
|
||||
'companionRemote.errors.authenticationFailed' => 'Kimlik doğrulanması uğursuz oldu',
|
||||
'companionRemote.errors.serverStartFailed' => ({required Object error}) => 'Pult serveri başladıla bilmədi: ${error}',
|
||||
@@ -4476,6 +4574,7 @@ extension on TranslationsAz {
|
||||
'seerr.statusPartiallyAvailable' => 'Hissəvi əlçatandır',
|
||||
'seerr.statusRequested' => 'Sorğu göndərildi',
|
||||
'seerr.statusProcessing' => 'Emal edilir',
|
||||
'seerr.statusBlocklisted' => 'Bloklanmış',
|
||||
'seerr.couldNotReach' => ({required Object url, required Object error}) => '${url} ünvanına çatmaq olmadı: ${error}',
|
||||
'seerr.noInstanceAtUrl' => ({required Object url, required Object status}) => '${url} ünvanında Seerr instansiyası yoxdur (HTTP ${status})',
|
||||
'seerr.notInitialized' => 'Bu Seerr instansiyasının ilkin quraşdırılması tamamlanmayıb',
|
||||
@@ -4553,6 +4652,7 @@ extension on TranslationsAz {
|
||||
'addServer.borrowFromAnotherProfileSubtitle' => 'Başqa profilin qoşulmasını yenidən istifadə edin.',
|
||||
'addServer.invalidCredentials' => 'İstifadəçi adı və ya şifrə yanlışdır',
|
||||
'addServer.authResponseNotJson' => 'Autentifikasiya cavabı etibarlı JSON deyildi',
|
||||
'addServer.authResponseIncomplete' => 'Serverin giriş cavabı natamam idi',
|
||||
'addServer.quickConnectRejected' => 'Quick Connect server tərəfindən rədd edildi',
|
||||
'addServer.quickConnectNotJson' => 'Quick Connect cavabı etibarlı JSON deyildi',
|
||||
'addServer.quickConnectMissingFields' => 'Quick Connect cavabında kod və ya məxfi açar yoxdur',
|
||||
|
||||
+106
-6
@@ -182,6 +182,7 @@ class _Translations$common$bg extends Translations$common$en {
|
||||
@override String get notAvailable => 'Н/Д';
|
||||
@override String get url => 'URL';
|
||||
@override String get letterKeys => 'АБВ';
|
||||
@override late final _Translations$common$mediaKind$bg mediaKind = _Translations$common$mediaKind$bg._(_root);
|
||||
}
|
||||
|
||||
// Path: screens
|
||||
@@ -412,6 +413,8 @@ class _Translations$settings$bg extends Translations$settings$en {
|
||||
@override String get autoPipDescription => 'Автоматично включвай режима картина в картината при излизане от приложението по време на възпроизвеждане';
|
||||
@override String get matchContentFrameRate => 'Напасване към кадровата честота на съдържанието';
|
||||
@override String get matchContentFrameRateDescription => 'Напасни честотата на опресняване на дисплея към видео съдържанието';
|
||||
@override String get matchContentResolution => 'Съобразяване с разделителната способност на съдържанието';
|
||||
@override String get matchContentResolutionDescription => 'Превключва дисплея към собствената разделителна способност на видеото, за да се погрижи телевизорът за мащабирането. По време на възпроизвеждане менютата и субтитрите също се мащабират';
|
||||
@override String get matchRefreshRate => 'Напасване на честотата на опресняване';
|
||||
@override String get matchRefreshRateDescription => 'Напасни честотата на опресняване на дисплея при цял екран';
|
||||
@override String get matchDynamicRange => 'Напасване на динамичния диапазон';
|
||||
@@ -440,6 +443,10 @@ class _Translations$settings$bg extends Translations$settings$en {
|
||||
@override String get dvConversionNativeDescription => 'Принуждава директно възпроизвеждане на DV7 и изключва повторния опит за преобразуване';
|
||||
@override String get dvConversionDv81Description => 'Принуждава директно преобразуване на RPU към Dolby Vision Profile 8.1';
|
||||
@override String get dvConversionHevcStripDescription => 'Премахва слоевете Dolby Vision RPU/EL и подава обикновен HEVC поток';
|
||||
@override String get demuxer => 'Демултиплексор на контейнера';
|
||||
@override String get demuxerDescription => 'Кой демултиплексор анализира файловете при директно възпроизвеждане. Превключете на media3, ако даден файл създава проблеми.';
|
||||
@override String get demuxerFfmpeg => 'FFmpeg (препоръчително)';
|
||||
@override String get demuxerMedia3 => 'media3';
|
||||
@override String get requireProfileSelectionOnOpen => 'Питай за профил при отваряне на приложението';
|
||||
@override String get requireProfileSelectionOnOpenDescription => 'Показвай избор на профил всеки път при отваряне на приложението';
|
||||
@override String get forceTvMode => 'Принуди TV режим';
|
||||
@@ -1214,6 +1221,7 @@ class _Translations$serverSelection$bg extends Translations$serverSelection$en {
|
||||
// Translations
|
||||
@override String noServersFoundForAccount({required Object username, required Object email}) => 'Не са намерени сървъри за ${username} (${email})';
|
||||
@override String failedToLoadServers({required Object error}) => 'Неуспешно зареждане на сървъри: ${error}';
|
||||
@override String get noValidServers => 'Не бяха намерени използваеми сървъри в този акаунт';
|
||||
}
|
||||
|
||||
// Path: hubDetail
|
||||
@@ -1432,6 +1440,7 @@ class _Translations$liveTv$bg extends Translations$liveTv$en {
|
||||
@override String get guideReloadRequested => 'Заявено е опресняване на ТВ програмата';
|
||||
@override String get rulesProcessRequested => 'Заявена е преоценка на правилата';
|
||||
@override String get recordShow => 'Запиши предаването';
|
||||
@override late final _Translations$liveTv$recordSettings$bg recordSettings = _Translations$liveTv$recordSettings$bg._(_root);
|
||||
@override String startingInMinutes({required Object minutes}) => 'Започва след ${minutes} мин';
|
||||
@override String dayAtTime({required Object day, required Object time}) => '${day} в ${time}';
|
||||
@override String invalidPlaybackData({required Object product}) => '${product} върна невалидни данни за възпроизвеждане на телевизия на живо';
|
||||
@@ -1613,6 +1622,7 @@ class _Translations$watchTogether$bg extends Translations$watchTogether$en {
|
||||
@override String get guestSwitchUnavailable => 'Превключването не е възможно — сървърът е недостъпен за синхронизация';
|
||||
@override String get guestSwitchFailed => 'Превключването не е възможно — съдържанието не е намерено на този сървър';
|
||||
@override String get defaultDisplayName => 'Потребител';
|
||||
@override late final _Translations$watchTogether$errors$bg errors = _Translations$watchTogether$errors$bg._(_root);
|
||||
}
|
||||
|
||||
// Path: downloads
|
||||
@@ -2034,6 +2044,7 @@ class _Translations$seerr$bg extends Translations$seerr$en {
|
||||
@override String get statusPartiallyAvailable => 'Частично налично';
|
||||
@override String get statusRequested => 'Заявено';
|
||||
@override String get statusProcessing => 'Обработва се';
|
||||
@override String get statusBlocklisted => 'В списъка с блокирани';
|
||||
@override String couldNotReach({required Object url, required Object error}) => 'Неуспешна връзка с ${url}: ${error}';
|
||||
@override String noInstanceAtUrl({required Object url, required Object status}) => 'На ${url} няма инстанция на Seerr (HTTP ${status})';
|
||||
@override String get notInitialized => 'Тази инстанция на Seerr не е завършила първоначалната настройка';
|
||||
@@ -2106,6 +2117,7 @@ class _Translations$addServer$bg extends Translations$addServer$en {
|
||||
@override String get borrowFromAnotherProfileSubtitle => 'Използвай връзка от друг профил. PIN-защитените профили изискват PIN.';
|
||||
@override String get invalidCredentials => 'Невалидно потребителско име или парола';
|
||||
@override String get authResponseNotJson => 'Отговорът при удостоверяване не беше валиден JSON';
|
||||
@override String get authResponseIncomplete => 'Отговорът за вход от сървъра беше непълен';
|
||||
@override String get quickConnectRejected => 'Quick Connect беше отхвърлен от сървъра';
|
||||
@override String get quickConnectNotJson => 'Отговорът на Quick Connect не беше валиден JSON';
|
||||
@override String get quickConnectMissingFields => 'В отговора на Quick Connect липсва код или таен ключ';
|
||||
@@ -2144,6 +2156,27 @@ class _Translations$common$ratingSource$bg extends Translations$common$ratingSou
|
||||
@override String get rottenTomatoesAudience => 'Публиката на Rotten Tomatoes';
|
||||
}
|
||||
|
||||
// Path: common.mediaKind
|
||||
class _Translations$common$mediaKind$bg extends Translations$common$mediaKind$en {
|
||||
_Translations$common$mediaKind$bg._(TranslationsBg root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsBg _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get movie => 'Филм';
|
||||
@override String get show => 'Сериал';
|
||||
@override String get season => 'Сезон';
|
||||
@override String get episode => 'Епизод';
|
||||
@override String get artist => 'Изпълнител';
|
||||
@override String get album => 'Албум';
|
||||
@override String get track => 'Песен';
|
||||
@override String get collection => 'Колекция';
|
||||
@override String get playlist => 'Плейлист';
|
||||
@override String get clip => 'Клип';
|
||||
@override String get photo => 'Снимка';
|
||||
@override String get folder => 'Папка';
|
||||
}
|
||||
|
||||
// Path: hotkeys.actions
|
||||
class _Translations$hotkeys$actions$bg extends Translations$hotkeys$actions$en {
|
||||
_Translations$hotkeys$actions$bg._(TranslationsBg root) : this._root = root, super.internal(root);
|
||||
@@ -2191,6 +2224,7 @@ class _Translations$videoControls$pipErrors$bg extends Translations$videoControl
|
||||
@override String get notSupported => 'Устройството не поддържа режим картина в картината';
|
||||
@override String get voSwitchFailed => 'Неуспешна смяна на видео изхода за режим картина в картината';
|
||||
@override String get failed => 'Режимът картина в картината не успя да стартира';
|
||||
@override String get prepareFailed => 'Режимът картина в картината не можа да бъде подготвен';
|
||||
@override String unknown({required Object error}) => 'Възникна грешка: ${error}';
|
||||
}
|
||||
|
||||
@@ -2486,6 +2520,23 @@ class _Translations$explore$detail$bg extends Translations$explore$detail$en {
|
||||
@override String get background => 'Фон';
|
||||
}
|
||||
|
||||
// Path: liveTv.recordSettings
|
||||
class _Translations$liveTv$recordSettings$bg extends Translations$liveTv$recordSettings$en {
|
||||
_Translations$liveTv$recordSettings$bg._(TranslationsBg root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsBg _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get startEarly => 'Започване по-рано (секунди)';
|
||||
@override String get endLate => 'Приключване по-късно (секунди)';
|
||||
@override String get newOnly => 'Само нови епизоди';
|
||||
@override String get anyChannel => 'Записване от всеки канал';
|
||||
@override String get anyTime => 'Записване по всяко време';
|
||||
@override String get skipInLibrary => 'Пропускане на епизоди, които вече са в библиотеката';
|
||||
@override String get keepUpTo => 'Епизоди за запазване';
|
||||
@override String get keepUpToHint => '0 запазва всички епизоди';
|
||||
}
|
||||
|
||||
// Path: music.discography
|
||||
class _Translations$music$discography$bg extends Translations$music$discography$en {
|
||||
_Translations$music$discography$bg._(TranslationsBg root) : this._root = root, super.internal(root);
|
||||
@@ -2498,6 +2549,19 @@ class _Translations$music$discography$bg extends Translations$music$discography$
|
||||
@override String get compilations => 'Компилации';
|
||||
}
|
||||
|
||||
// Path: watchTogether.errors
|
||||
class _Translations$watchTogether$errors$bg extends Translations$watchTogether$errors$en {
|
||||
_Translations$watchTogether$errors$bg._(TranslationsBg root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsBg _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get timedOut => 'Релейният сървър не отговори навреме';
|
||||
@override String get connectionLost => 'Връзката се затвори, преди сесията да е готова';
|
||||
@override String get invalidRelayResponse => 'Релейният сървър изпрати неочакван отговор';
|
||||
@override String get sessionEnded => 'Организаторът прекрати сесията';
|
||||
}
|
||||
|
||||
// Path: downloads.backgroundWarning
|
||||
class _Translations$downloads$backgroundWarning$bg extends Translations$downloads$backgroundWarning$en {
|
||||
_Translations$downloads$backgroundWarning$bg._(TranslationsBg root) : this._root = root, super.internal(root);
|
||||
@@ -2551,6 +2615,7 @@ class _Translations$companionRemote$session$bg extends Translations$companionRem
|
||||
@override String get startServer => 'Стартирай сървър';
|
||||
@override String get stopServer => 'Спри сървър';
|
||||
@override String get minimize => 'Минимизирай';
|
||||
@override String get manualAddressHint => 'Ръчен адрес за връзка:';
|
||||
}
|
||||
|
||||
// Path: companionRemote.pairing
|
||||
@@ -2787,6 +2852,18 @@ extension on TranslationsBg {
|
||||
'common.notAvailable' => 'Н/Д',
|
||||
'common.url' => 'URL',
|
||||
'common.letterKeys' => 'АБВ',
|
||||
'common.mediaKind.movie' => 'Филм',
|
||||
'common.mediaKind.show' => 'Сериал',
|
||||
'common.mediaKind.season' => 'Сезон',
|
||||
'common.mediaKind.episode' => 'Епизод',
|
||||
'common.mediaKind.artist' => 'Изпълнител',
|
||||
'common.mediaKind.album' => 'Албум',
|
||||
'common.mediaKind.track' => 'Песен',
|
||||
'common.mediaKind.collection' => 'Колекция',
|
||||
'common.mediaKind.playlist' => 'Плейлист',
|
||||
'common.mediaKind.clip' => 'Клип',
|
||||
'common.mediaKind.photo' => 'Снимка',
|
||||
'common.mediaKind.folder' => 'Папка',
|
||||
'screens.licenses' => 'Лицензи',
|
||||
'screens.switchProfile' => 'Смяна на профил',
|
||||
'screens.subtitleStyling' => 'Стил на субтитрите',
|
||||
@@ -2990,6 +3067,8 @@ extension on TranslationsBg {
|
||||
'settings.autoPipDescription' => 'Автоматично включвай режима картина в картината при излизане от приложението по време на възпроизвеждане',
|
||||
'settings.matchContentFrameRate' => 'Напасване към кадровата честота на съдържанието',
|
||||
'settings.matchContentFrameRateDescription' => 'Напасни честотата на опресняване на дисплея към видео съдържанието',
|
||||
'settings.matchContentResolution' => 'Съобразяване с разделителната способност на съдържанието',
|
||||
'settings.matchContentResolutionDescription' => 'Превключва дисплея към собствената разделителна способност на видеото, за да се погрижи телевизорът за мащабирането. По време на възпроизвеждане менютата и субтитрите също се мащабират',
|
||||
'settings.matchRefreshRate' => 'Напасване на честотата на опресняване',
|
||||
'settings.matchRefreshRateDescription' => 'Напасни честотата на опресняване на дисплея при цял екран',
|
||||
'settings.matchDynamicRange' => 'Напасване на динамичния диапазон',
|
||||
@@ -3018,6 +3097,10 @@ extension on TranslationsBg {
|
||||
'settings.dvConversionNativeDescription' => 'Принуждава директно възпроизвеждане на DV7 и изключва повторния опит за преобразуване',
|
||||
'settings.dvConversionDv81Description' => 'Принуждава директно преобразуване на RPU към Dolby Vision Profile 8.1',
|
||||
'settings.dvConversionHevcStripDescription' => 'Премахва слоевете Dolby Vision RPU/EL и подава обикновен HEVC поток',
|
||||
'settings.demuxer' => 'Демултиплексор на контейнера',
|
||||
'settings.demuxerDescription' => 'Кой демултиплексор анализира файловете при директно възпроизвеждане. Превключете на media3, ако даден файл създава проблеми.',
|
||||
'settings.demuxerFfmpeg' => 'FFmpeg (препоръчително)',
|
||||
'settings.demuxerMedia3' => 'media3',
|
||||
'settings.requireProfileSelectionOnOpen' => 'Питай за профил при отваряне на приложението',
|
||||
'settings.requireProfileSelectionOnOpenDescription' => 'Показвай избор на профил всеки път при отваряне на приложението',
|
||||
'settings.forceTvMode' => 'Принуди TV режим',
|
||||
@@ -3205,6 +3288,8 @@ extension on TranslationsBg {
|
||||
'fileInfo.flagOriginal' => 'Оригинал',
|
||||
'fileInfo.channelsMono' => 'Моно',
|
||||
'fileInfo.dolbyVisionProfile' => ({required Object profile}) => 'Профил ${profile}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.markAsWatched' => 'Маркирай като гледано',
|
||||
'mediaMenu.markAsUnwatched' => 'Маркирай като негледано',
|
||||
'mediaMenu.removeFromContinueWatching' => 'Премахни от продължаване на гледането',
|
||||
@@ -3223,8 +3308,6 @@ extension on TranslationsBg {
|
||||
'mediaMenu.deleteMovieTitle' => 'Да изтрия ли този филм?',
|
||||
'mediaMenu.deleteEpisodeConfirm' => 'Изтрий епизода',
|
||||
'mediaMenu.deleteSeasonConfirm' => 'Изтрий сезона',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.deleteShowConfirm' => 'Изтрий сериала',
|
||||
'mediaMenu.deleteMovieConfirm' => 'Изтрий филма',
|
||||
'mediaMenu.deleteAnyway' => 'Изтрий въпреки това',
|
||||
@@ -3346,6 +3429,7 @@ extension on TranslationsBg {
|
||||
'videoControls.pipErrors.notSupported' => 'Устройството не поддържа режим картина в картината',
|
||||
'videoControls.pipErrors.voSwitchFailed' => 'Неуспешна смяна на видео изхода за режим картина в картината',
|
||||
'videoControls.pipErrors.failed' => 'Режимът картина в картината не успя да стартира',
|
||||
'videoControls.pipErrors.prepareFailed' => 'Режимът картина в картината не можа да бъде подготвен',
|
||||
'videoControls.pipErrors.unknown' => ({required Object error}) => 'Възникна грешка: ${error}',
|
||||
'videoControls.chapters' => 'Глави',
|
||||
'videoControls.noChaptersAvailable' => 'Няма налични глави',
|
||||
@@ -3666,6 +3750,7 @@ extension on TranslationsBg {
|
||||
'about.viewLicensesDescription' => 'Виж лицензите на библиотеки на трети страни',
|
||||
'serverSelection.noServersFoundForAccount' => ({required Object username, required Object email}) => 'Не са намерени сървъри за ${username} (${email})',
|
||||
'serverSelection.failedToLoadServers' => ({required Object error}) => 'Неуспешно зареждане на сървъри: ${error}',
|
||||
'serverSelection.noValidServers' => 'Не бяха намерени използваеми сървъри в този акаунт',
|
||||
'hubDetail.title' => 'Заглавие',
|
||||
'hubDetail.releaseYear' => 'Година на излизане',
|
||||
'hubDetail.dateAdded' => 'Дата на добавяне',
|
||||
@@ -3717,6 +3802,8 @@ extension on TranslationsBg {
|
||||
'explore.rows.watchlist' => 'Списък за гледане',
|
||||
'explore.rows.recommendedMovies' => 'Препоръчани филми',
|
||||
'explore.rows.recommendedShows' => 'Препоръчани сериали',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.rows.trendingMovies' => 'Набиращи популярност филми',
|
||||
'explore.rows.trendingShows' => 'Набиращи популярност сериали',
|
||||
'explore.rows.popularMovies' => 'Популярни филми',
|
||||
@@ -3737,8 +3824,6 @@ extension on TranslationsBg {
|
||||
'explore.characters' => 'Герои',
|
||||
'explore.addToWatchlist' => 'Добави в списъка за гледане',
|
||||
'explore.removeFromWatchlist' => 'Премахни от списъка за гледане',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.addedToWatchlist' => 'Добавено към списъка за гледане',
|
||||
'explore.removedFromWatchlist' => 'Премахнато от списъка за гледане',
|
||||
'explore.watchlistUpdateFailed' => 'Неуспешно обновяване на списъка за гледане',
|
||||
@@ -3926,6 +4011,14 @@ extension on TranslationsBg {
|
||||
'liveTv.guideReloadRequested' => 'Заявено е опресняване на ТВ програмата',
|
||||
'liveTv.rulesProcessRequested' => 'Заявена е преоценка на правилата',
|
||||
'liveTv.recordShow' => 'Запиши предаването',
|
||||
'liveTv.recordSettings.startEarly' => 'Започване по-рано (секунди)',
|
||||
'liveTv.recordSettings.endLate' => 'Приключване по-късно (секунди)',
|
||||
'liveTv.recordSettings.newOnly' => 'Само нови епизоди',
|
||||
'liveTv.recordSettings.anyChannel' => 'Записване от всеки канал',
|
||||
'liveTv.recordSettings.anyTime' => 'Записване по всяко време',
|
||||
'liveTv.recordSettings.skipInLibrary' => 'Пропускане на епизоди, които вече са в библиотеката',
|
||||
'liveTv.recordSettings.keepUpTo' => 'Епизоди за запазване',
|
||||
'liveTv.recordSettings.keepUpToHint' => '0 запазва всички епизоди',
|
||||
'liveTv.startingInMinutes' => ({required Object minutes}) => 'Започва след ${minutes} мин',
|
||||
'liveTv.dayAtTime' => ({required Object day, required Object time}) => '${day} в ${time}',
|
||||
'liveTv.invalidPlaybackData' => ({required Object product}) => '${product} върна невалидни данни за възпроизвеждане на телевизия на живо',
|
||||
@@ -4070,6 +4163,10 @@ extension on TranslationsBg {
|
||||
'watchTogether.guestSwitchUnavailable' => 'Превключването не е възможно — сървърът е недостъпен за синхронизация',
|
||||
'watchTogether.guestSwitchFailed' => 'Превключването не е възможно — съдържанието не е намерено на този сървър',
|
||||
'watchTogether.defaultDisplayName' => 'Потребител',
|
||||
'watchTogether.errors.timedOut' => 'Релейният сървър не отговори навреме',
|
||||
'watchTogether.errors.connectionLost' => 'Връзката се затвори, преди сесията да е готова',
|
||||
'watchTogether.errors.invalidRelayResponse' => 'Релейният сървър изпрати неочакван отговор',
|
||||
'watchTogether.errors.sessionEnded' => 'Организаторът прекрати сесията',
|
||||
'downloads.title' => 'Изтегляния',
|
||||
'downloads.manage' => 'Управление',
|
||||
'downloads.tvShows' => 'ТВ сериали',
|
||||
@@ -4209,6 +4306,7 @@ extension on TranslationsBg {
|
||||
'companionRemote.session.startServer' => 'Стартирай сървър',
|
||||
'companionRemote.session.stopServer' => 'Спри сървър',
|
||||
'companionRemote.session.minimize' => 'Минимизирай',
|
||||
'companionRemote.session.manualAddressHint' => 'Ръчен адрес за връзка:',
|
||||
'companionRemote.pairing.discoveryDescription' => 'Plezy устройства със същия Plex акаунт се показват тук',
|
||||
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
|
||||
'companionRemote.pairing.connecting' => 'Свързване...',
|
||||
@@ -4218,6 +4316,8 @@ extension on TranslationsBg {
|
||||
'companionRemote.pairing.availableDevices' => 'Налични устройства',
|
||||
'companionRemote.pairing.manualConnection' => 'Ръчно свързване',
|
||||
'companionRemote.pairing.cryptoInitFailed' => 'Не може да се стартира защитена връзка. Първо влезте в Plex.',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.pairing.validationHostRequired' => 'Моля, въведете адрес на хоста',
|
||||
'companionRemote.pairing.validationHostFormat' => 'Форматът трябва да е IP:port (напр. 192.168.1.100:48632)',
|
||||
'companionRemote.pairing.connectionTimedOut' => 'Връзката изтече. Използвайте една и съща мрежа на двете устройства.',
|
||||
@@ -4251,8 +4351,6 @@ extension on TranslationsBg {
|
||||
'companionRemote.remote.subtitles' => 'Субтитри',
|
||||
'companionRemote.remote.audio' => 'Аудио',
|
||||
'companionRemote.remote.searchHint' => 'Търсене на настолен компютър...',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.errors.noNetworkInterface' => 'Не е намерен мрежов интерфейс',
|
||||
'companionRemote.errors.authenticationFailed' => 'Неуспешно удостоверяване',
|
||||
'companionRemote.errors.serverStartFailed' => ({required Object error}) => 'Неуспешно стартиране на сървъра за дистанционно управление: ${error}',
|
||||
@@ -4476,6 +4574,7 @@ extension on TranslationsBg {
|
||||
'seerr.statusPartiallyAvailable' => 'Частично налично',
|
||||
'seerr.statusRequested' => 'Заявено',
|
||||
'seerr.statusProcessing' => 'Обработва се',
|
||||
'seerr.statusBlocklisted' => 'В списъка с блокирани',
|
||||
'seerr.couldNotReach' => ({required Object url, required Object error}) => 'Неуспешна връзка с ${url}: ${error}',
|
||||
'seerr.noInstanceAtUrl' => ({required Object url, required Object status}) => 'На ${url} няма инстанция на Seerr (HTTP ${status})',
|
||||
'seerr.notInitialized' => 'Тази инстанция на Seerr не е завършила първоначалната настройка',
|
||||
@@ -4553,6 +4652,7 @@ extension on TranslationsBg {
|
||||
'addServer.borrowFromAnotherProfileSubtitle' => 'Използвай връзка от друг профил. PIN-защитените профили изискват PIN.',
|
||||
'addServer.invalidCredentials' => 'Невалидно потребителско име или парола',
|
||||
'addServer.authResponseNotJson' => 'Отговорът при удостоверяване не беше валиден JSON',
|
||||
'addServer.authResponseIncomplete' => 'Отговорът за вход от сървъра беше непълен',
|
||||
'addServer.quickConnectRejected' => 'Quick Connect беше отхвърлен от сървъра',
|
||||
'addServer.quickConnectNotJson' => 'Отговорът на Quick Connect не беше валиден JSON',
|
||||
'addServer.quickConnectMissingFields' => 'В отговора на Quick Connect липсва код или таен ключ',
|
||||
|
||||
+106
-6
@@ -182,6 +182,7 @@ class _Translations$common$da extends Translations$common$en {
|
||||
@override String get notAvailable => 'N/A';
|
||||
@override String get url => 'URL';
|
||||
@override String get letterKeys => 'ABC';
|
||||
@override late final _Translations$common$mediaKind$da mediaKind = _Translations$common$mediaKind$da._(_root);
|
||||
}
|
||||
|
||||
// Path: screens
|
||||
@@ -412,6 +413,8 @@ class _Translations$settings$da extends Translations$settings$en {
|
||||
@override String get autoPipDescription => 'Skift automatisk til billede-i-billede, når du forlader appen under afspilning';
|
||||
@override String get matchContentFrameRate => 'Tilpas billedhastigheden til indholdet';
|
||||
@override String get matchContentFrameRateDescription => 'Tilpas skærmens opdateringsfrekvens til videoindhold';
|
||||
@override String get matchContentResolution => 'Tilpas til indholdets opløsning';
|
||||
@override String get matchContentResolutionDescription => 'Skifter skærmen til videoens oprindelige opløsning, så dit tv står for opskaleringen. Menuer og undertekster opskaleres også under afspilning';
|
||||
@override String get matchRefreshRate => 'Tilpas opdateringsfrekvensen';
|
||||
@override String get matchRefreshRateDescription => 'Tilpas skærmens opdateringsfrekvens i fuld skærm';
|
||||
@override String get matchDynamicRange => 'Tilpas dynamikområdet';
|
||||
@@ -440,6 +443,10 @@ class _Translations$settings$da extends Translations$settings$en {
|
||||
@override String get dvConversionNativeDescription => 'Gennemtving indbygget DV7-understøttelse, og undlad at forsøge DV-konvertering igen';
|
||||
@override String get dvConversionDv81Description => 'Tving inline RPU-konvertering til Dolby Vision profil 8.1';
|
||||
@override String get dvConversionHevcStripDescription => 'Fjern Dolby Vision RPU/EL-lag og brug almindelig HEVC';
|
||||
@override String get demuxer => 'Container-demuxer';
|
||||
@override String get demuxerDescription => 'Hvilken demuxer der læser direkte afspillede filer. Skift til media3, hvis en fil driller.';
|
||||
@override String get demuxerFfmpeg => 'FFmpeg (anbefalet)';
|
||||
@override String get demuxerMedia3 => 'media3';
|
||||
@override String get requireProfileSelectionOnOpen => 'Spørg om profil ved åbning';
|
||||
@override String get requireProfileSelectionOnOpenDescription => 'Vis profilvalg hver gang appen åbnes';
|
||||
@override String get forceTvMode => 'Gennemtving TV-tilstand';
|
||||
@@ -1214,6 +1221,7 @@ class _Translations$serverSelection$da extends Translations$serverSelection$en {
|
||||
// Translations
|
||||
@override String noServersFoundForAccount({required Object username, required Object email}) => 'Ingen servere fundet for ${username} (${email})';
|
||||
@override String failedToLoadServers({required Object error}) => 'Kunne ikke indlæse servere: ${error}';
|
||||
@override String get noValidServers => 'Der blev ikke fundet nogen brugbare servere på denne konto';
|
||||
}
|
||||
|
||||
// Path: hubDetail
|
||||
@@ -1432,6 +1440,7 @@ class _Translations$liveTv$da extends Translations$liveTv$en {
|
||||
@override String get guideReloadRequested => 'Der er anmodet om en opdatering af guiden';
|
||||
@override String get rulesProcessRequested => 'Der er anmodet om en ny evaluering af reglerne';
|
||||
@override String get recordShow => 'Optag program';
|
||||
@override late final _Translations$liveTv$recordSettings$da recordSettings = _Translations$liveTv$recordSettings$da._(_root);
|
||||
@override String startingInMinutes({required Object minutes}) => 'Starter om ${minutes} min';
|
||||
@override String dayAtTime({required Object day, required Object time}) => '${day} kl. ${time}';
|
||||
@override String invalidPlaybackData({required Object product}) => '${product} returnerede ugyldige afspilningsdata for Live TV';
|
||||
@@ -1613,6 +1622,7 @@ class _Translations$watchTogether$da extends Translations$watchTogether$en {
|
||||
@override String get guestSwitchUnavailable => 'Kunne ikke skifte — server ikke tilgængelig for synkronisering';
|
||||
@override String get guestSwitchFailed => 'Kunne ikke skifte — indhold blev ikke fundet på denne server';
|
||||
@override String get defaultDisplayName => 'Bruger';
|
||||
@override late final _Translations$watchTogether$errors$da errors = _Translations$watchTogether$errors$da._(_root);
|
||||
}
|
||||
|
||||
// Path: downloads
|
||||
@@ -2034,6 +2044,7 @@ class _Translations$seerr$da extends Translations$seerr$en {
|
||||
@override String get statusPartiallyAvailable => 'Delvist tilgængelig';
|
||||
@override String get statusRequested => 'Anmodet';
|
||||
@override String get statusProcessing => 'Behandler';
|
||||
@override String get statusBlocklisted => 'På blokeringslisten';
|
||||
@override String couldNotReach({required Object url, required Object error}) => 'Kunne ikke nå ${url}: ${error}';
|
||||
@override String noInstanceAtUrl({required Object url, required Object status}) => 'Ingen Seerr-instans på ${url} (HTTP ${status})';
|
||||
@override String get notInitialized => 'Denne Seerr-instans har ikke fuldført førstegangsopsætningen';
|
||||
@@ -2106,6 +2117,7 @@ class _Translations$addServer$da extends Translations$addServer$en {
|
||||
@override String get borrowFromAnotherProfileSubtitle => 'Genbrug en anden profils forbindelse. PIN-beskyttede profiler kræver en PIN.';
|
||||
@override String get invalidCredentials => 'Ugyldigt brugernavn eller ugyldig adgangskode';
|
||||
@override String get authResponseNotJson => 'Godkendelsessvaret var ikke gyldig JSON';
|
||||
@override String get authResponseIncomplete => 'Loginsvaret fra serveren var ufuldstændigt';
|
||||
@override String get quickConnectRejected => 'Quick Connect blev afvist af serveren';
|
||||
@override String get quickConnectNotJson => 'Quick Connect-svaret var ikke gyldig JSON';
|
||||
@override String get quickConnectMissingFields => 'Quick Connect-svaret mangler en kode eller hemmelighed';
|
||||
@@ -2144,6 +2156,27 @@ class _Translations$common$ratingSource$da extends Translations$common$ratingSou
|
||||
@override String get rottenTomatoesAudience => 'Rotten Tomatoes-publikum';
|
||||
}
|
||||
|
||||
// Path: common.mediaKind
|
||||
class _Translations$common$mediaKind$da extends Translations$common$mediaKind$en {
|
||||
_Translations$common$mediaKind$da._(TranslationsDa root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsDa _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get movie => 'Film';
|
||||
@override String get show => 'Serie';
|
||||
@override String get season => 'Sæson';
|
||||
@override String get episode => 'Afsnit';
|
||||
@override String get artist => 'Kunstner';
|
||||
@override String get album => 'Album';
|
||||
@override String get track => 'Nummer';
|
||||
@override String get collection => 'Samling';
|
||||
@override String get playlist => 'Afspilningsliste';
|
||||
@override String get clip => 'Klip';
|
||||
@override String get photo => 'Foto';
|
||||
@override String get folder => 'Mappe';
|
||||
}
|
||||
|
||||
// Path: hotkeys.actions
|
||||
class _Translations$hotkeys$actions$da extends Translations$hotkeys$actions$en {
|
||||
_Translations$hotkeys$actions$da._(TranslationsDa root) : this._root = root, super.internal(root);
|
||||
@@ -2191,6 +2224,7 @@ class _Translations$videoControls$pipErrors$da extends Translations$videoControl
|
||||
@override String get notSupported => 'Enheden understøtter ikke billede-i-billede';
|
||||
@override String get voSwitchFailed => 'Kunne ikke skifte videooutput til billede-i-billede';
|
||||
@override String get failed => 'Billede-i-billede kunne ikke starte';
|
||||
@override String get prepareFailed => 'Billede-i-billede kunne ikke forberedes';
|
||||
@override String unknown({required Object error}) => 'Der opstod en fejl: ${error}';
|
||||
}
|
||||
|
||||
@@ -2486,6 +2520,23 @@ class _Translations$explore$detail$da extends Translations$explore$detail$en {
|
||||
@override String get background => 'Baggrund';
|
||||
}
|
||||
|
||||
// Path: liveTv.recordSettings
|
||||
class _Translations$liveTv$recordSettings$da extends Translations$liveTv$recordSettings$en {
|
||||
_Translations$liveTv$recordSettings$da._(TranslationsDa root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsDa _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get startEarly => 'Start tidligere (sekunder)';
|
||||
@override String get endLate => 'Slut senere (sekunder)';
|
||||
@override String get newOnly => 'Kun nye afsnit';
|
||||
@override String get anyChannel => 'Optag på alle kanaler';
|
||||
@override String get anyTime => 'Optag på alle tidspunkter';
|
||||
@override String get skipInLibrary => 'Spring afsnit over, der allerede er i biblioteket';
|
||||
@override String get keepUpTo => 'Afsnit der skal beholdes';
|
||||
@override String get keepUpToHint => '0 beholder alle afsnit';
|
||||
}
|
||||
|
||||
// Path: music.discography
|
||||
class _Translations$music$discography$da extends Translations$music$discography$en {
|
||||
_Translations$music$discography$da._(TranslationsDa root) : this._root = root, super.internal(root);
|
||||
@@ -2498,6 +2549,19 @@ class _Translations$music$discography$da extends Translations$music$discography$
|
||||
@override String get compilations => 'Opsamlinger';
|
||||
}
|
||||
|
||||
// Path: watchTogether.errors
|
||||
class _Translations$watchTogether$errors$da extends Translations$watchTogether$errors$en {
|
||||
_Translations$watchTogether$errors$da._(TranslationsDa root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsDa _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get timedOut => 'Relayserveren svarede ikke i tide';
|
||||
@override String get connectionLost => 'Forbindelsen blev lukket, før sessionen var klar';
|
||||
@override String get invalidRelayResponse => 'Relayserveren sendte et uventet svar';
|
||||
@override String get sessionEnded => 'Værten afsluttede sessionen';
|
||||
}
|
||||
|
||||
// Path: downloads.backgroundWarning
|
||||
class _Translations$downloads$backgroundWarning$da extends Translations$downloads$backgroundWarning$en {
|
||||
_Translations$downloads$backgroundWarning$da._(TranslationsDa root) : this._root = root, super.internal(root);
|
||||
@@ -2551,6 +2615,7 @@ class _Translations$companionRemote$session$da extends Translations$companionRem
|
||||
@override String get startServer => 'Start serveren';
|
||||
@override String get stopServer => 'Stop serveren';
|
||||
@override String get minimize => 'Minimér';
|
||||
@override String get manualAddressHint => 'Manuel forbindelsesadresse:';
|
||||
}
|
||||
|
||||
// Path: companionRemote.pairing
|
||||
@@ -2787,6 +2852,18 @@ extension on TranslationsDa {
|
||||
'common.notAvailable' => 'N/A',
|
||||
'common.url' => 'URL',
|
||||
'common.letterKeys' => 'ABC',
|
||||
'common.mediaKind.movie' => 'Film',
|
||||
'common.mediaKind.show' => 'Serie',
|
||||
'common.mediaKind.season' => 'Sæson',
|
||||
'common.mediaKind.episode' => 'Afsnit',
|
||||
'common.mediaKind.artist' => 'Kunstner',
|
||||
'common.mediaKind.album' => 'Album',
|
||||
'common.mediaKind.track' => 'Nummer',
|
||||
'common.mediaKind.collection' => 'Samling',
|
||||
'common.mediaKind.playlist' => 'Afspilningsliste',
|
||||
'common.mediaKind.clip' => 'Klip',
|
||||
'common.mediaKind.photo' => 'Foto',
|
||||
'common.mediaKind.folder' => 'Mappe',
|
||||
'screens.licenses' => 'Licenser',
|
||||
'screens.switchProfile' => 'Skift profil',
|
||||
'screens.subtitleStyling' => 'Undertekststil',
|
||||
@@ -2990,6 +3067,8 @@ extension on TranslationsDa {
|
||||
'settings.autoPipDescription' => 'Skift automatisk til billede-i-billede, når du forlader appen under afspilning',
|
||||
'settings.matchContentFrameRate' => 'Tilpas billedhastigheden til indholdet',
|
||||
'settings.matchContentFrameRateDescription' => 'Tilpas skærmens opdateringsfrekvens til videoindhold',
|
||||
'settings.matchContentResolution' => 'Tilpas til indholdets opløsning',
|
||||
'settings.matchContentResolutionDescription' => 'Skifter skærmen til videoens oprindelige opløsning, så dit tv står for opskaleringen. Menuer og undertekster opskaleres også under afspilning',
|
||||
'settings.matchRefreshRate' => 'Tilpas opdateringsfrekvensen',
|
||||
'settings.matchRefreshRateDescription' => 'Tilpas skærmens opdateringsfrekvens i fuld skærm',
|
||||
'settings.matchDynamicRange' => 'Tilpas dynamikområdet',
|
||||
@@ -3018,6 +3097,10 @@ extension on TranslationsDa {
|
||||
'settings.dvConversionNativeDescription' => 'Gennemtving indbygget DV7-understøttelse, og undlad at forsøge DV-konvertering igen',
|
||||
'settings.dvConversionDv81Description' => 'Tving inline RPU-konvertering til Dolby Vision profil 8.1',
|
||||
'settings.dvConversionHevcStripDescription' => 'Fjern Dolby Vision RPU/EL-lag og brug almindelig HEVC',
|
||||
'settings.demuxer' => 'Container-demuxer',
|
||||
'settings.demuxerDescription' => 'Hvilken demuxer der læser direkte afspillede filer. Skift til media3, hvis en fil driller.',
|
||||
'settings.demuxerFfmpeg' => 'FFmpeg (anbefalet)',
|
||||
'settings.demuxerMedia3' => 'media3',
|
||||
'settings.requireProfileSelectionOnOpen' => 'Spørg om profil ved åbning',
|
||||
'settings.requireProfileSelectionOnOpenDescription' => 'Vis profilvalg hver gang appen åbnes',
|
||||
'settings.forceTvMode' => 'Gennemtving TV-tilstand',
|
||||
@@ -3205,6 +3288,8 @@ extension on TranslationsDa {
|
||||
'fileInfo.flagOriginal' => 'Original',
|
||||
'fileInfo.channelsMono' => 'Mono',
|
||||
'fileInfo.dolbyVisionProfile' => ({required Object profile}) => 'Profil ${profile}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.markAsWatched' => 'Markér som set',
|
||||
'mediaMenu.markAsUnwatched' => 'Markér som uset',
|
||||
'mediaMenu.removeFromContinueWatching' => 'Fjern fra Fortsæt med at se',
|
||||
@@ -3223,8 +3308,6 @@ extension on TranslationsDa {
|
||||
'mediaMenu.deleteMovieTitle' => 'Slet denne film?',
|
||||
'mediaMenu.deleteEpisodeConfirm' => 'Slet episode',
|
||||
'mediaMenu.deleteSeasonConfirm' => 'Slet sæson',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.deleteShowConfirm' => 'Slet TV-serie',
|
||||
'mediaMenu.deleteMovieConfirm' => 'Slet film',
|
||||
'mediaMenu.deleteAnyway' => 'Slet alligevel',
|
||||
@@ -3346,6 +3429,7 @@ extension on TranslationsDa {
|
||||
'videoControls.pipErrors.notSupported' => 'Enheden understøtter ikke billede-i-billede',
|
||||
'videoControls.pipErrors.voSwitchFailed' => 'Kunne ikke skifte videooutput til billede-i-billede',
|
||||
'videoControls.pipErrors.failed' => 'Billede-i-billede kunne ikke starte',
|
||||
'videoControls.pipErrors.prepareFailed' => 'Billede-i-billede kunne ikke forberedes',
|
||||
'videoControls.pipErrors.unknown' => ({required Object error}) => 'Der opstod en fejl: ${error}',
|
||||
'videoControls.chapters' => 'Kapitler',
|
||||
'videoControls.noChaptersAvailable' => 'Ingen kapitler tilgængelige',
|
||||
@@ -3666,6 +3750,7 @@ extension on TranslationsDa {
|
||||
'about.viewLicensesDescription' => 'Se licenser for tredjepartsbiblioteker',
|
||||
'serverSelection.noServersFoundForAccount' => ({required Object username, required Object email}) => 'Ingen servere fundet for ${username} (${email})',
|
||||
'serverSelection.failedToLoadServers' => ({required Object error}) => 'Kunne ikke indlæse servere: ${error}',
|
||||
'serverSelection.noValidServers' => 'Der blev ikke fundet nogen brugbare servere på denne konto',
|
||||
'hubDetail.title' => 'Titel',
|
||||
'hubDetail.releaseYear' => 'Udgivelsesår',
|
||||
'hubDetail.dateAdded' => 'Tilføjelsesdato',
|
||||
@@ -3717,6 +3802,8 @@ extension on TranslationsDa {
|
||||
'explore.rows.watchlist' => 'Ønskeliste',
|
||||
'explore.rows.recommendedMovies' => 'Anbefalede film',
|
||||
'explore.rows.recommendedShows' => 'Anbefalede serier',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.rows.trendingMovies' => 'Populære film lige nu',
|
||||
'explore.rows.trendingShows' => 'Populære serier lige nu',
|
||||
'explore.rows.popularMovies' => 'Populære film',
|
||||
@@ -3737,8 +3824,6 @@ extension on TranslationsDa {
|
||||
'explore.characters' => 'Figurer',
|
||||
'explore.addToWatchlist' => 'Føj til ønskeliste',
|
||||
'explore.removeFromWatchlist' => 'Fjern fra ønskeliste',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.addedToWatchlist' => 'Føjet til overvågningslisten',
|
||||
'explore.removedFromWatchlist' => 'Fjernet fra overvågningslisten',
|
||||
'explore.watchlistUpdateFailed' => 'Kunne ikke opdatere ønskelisten',
|
||||
@@ -3926,6 +4011,14 @@ extension on TranslationsDa {
|
||||
'liveTv.guideReloadRequested' => 'Der er anmodet om en opdatering af guiden',
|
||||
'liveTv.rulesProcessRequested' => 'Der er anmodet om en ny evaluering af reglerne',
|
||||
'liveTv.recordShow' => 'Optag program',
|
||||
'liveTv.recordSettings.startEarly' => 'Start tidligere (sekunder)',
|
||||
'liveTv.recordSettings.endLate' => 'Slut senere (sekunder)',
|
||||
'liveTv.recordSettings.newOnly' => 'Kun nye afsnit',
|
||||
'liveTv.recordSettings.anyChannel' => 'Optag på alle kanaler',
|
||||
'liveTv.recordSettings.anyTime' => 'Optag på alle tidspunkter',
|
||||
'liveTv.recordSettings.skipInLibrary' => 'Spring afsnit over, der allerede er i biblioteket',
|
||||
'liveTv.recordSettings.keepUpTo' => 'Afsnit der skal beholdes',
|
||||
'liveTv.recordSettings.keepUpToHint' => '0 beholder alle afsnit',
|
||||
'liveTv.startingInMinutes' => ({required Object minutes}) => 'Starter om ${minutes} min',
|
||||
'liveTv.dayAtTime' => ({required Object day, required Object time}) => '${day} kl. ${time}',
|
||||
'liveTv.invalidPlaybackData' => ({required Object product}) => '${product} returnerede ugyldige afspilningsdata for Live TV',
|
||||
@@ -4070,6 +4163,10 @@ extension on TranslationsDa {
|
||||
'watchTogether.guestSwitchUnavailable' => 'Kunne ikke skifte — server ikke tilgængelig for synkronisering',
|
||||
'watchTogether.guestSwitchFailed' => 'Kunne ikke skifte — indhold blev ikke fundet på denne server',
|
||||
'watchTogether.defaultDisplayName' => 'Bruger',
|
||||
'watchTogether.errors.timedOut' => 'Relayserveren svarede ikke i tide',
|
||||
'watchTogether.errors.connectionLost' => 'Forbindelsen blev lukket, før sessionen var klar',
|
||||
'watchTogether.errors.invalidRelayResponse' => 'Relayserveren sendte et uventet svar',
|
||||
'watchTogether.errors.sessionEnded' => 'Værten afsluttede sessionen',
|
||||
'downloads.title' => 'Downloads',
|
||||
'downloads.manage' => 'Administrer',
|
||||
'downloads.tvShows' => 'TV-serier',
|
||||
@@ -4209,6 +4306,7 @@ extension on TranslationsDa {
|
||||
'companionRemote.session.startServer' => 'Start serveren',
|
||||
'companionRemote.session.stopServer' => 'Stop serveren',
|
||||
'companionRemote.session.minimize' => 'Minimér',
|
||||
'companionRemote.session.manualAddressHint' => 'Manuel forbindelsesadresse:',
|
||||
'companionRemote.pairing.discoveryDescription' => 'Plezy-enheder med samme Plex-konto vises her',
|
||||
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
|
||||
'companionRemote.pairing.connecting' => 'Opretter forbindelse...',
|
||||
@@ -4218,6 +4316,8 @@ extension on TranslationsDa {
|
||||
'companionRemote.pairing.availableDevices' => 'Tilgængelige enheder',
|
||||
'companionRemote.pairing.manualConnection' => 'Manuel forbindelse',
|
||||
'companionRemote.pairing.cryptoInitFailed' => 'Kunne ikke starte sikker forbindelse. Log ind på Plex først.',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.pairing.validationHostRequired' => 'Angiv en værtsadresse',
|
||||
'companionRemote.pairing.validationHostFormat' => 'Format skal være IP:port (f.eks. 192.168.1.100:48632)',
|
||||
'companionRemote.pairing.connectionTimedOut' => 'Forbindelsen fik timeout. Brug samme netværk på begge enheder.',
|
||||
@@ -4251,8 +4351,6 @@ extension on TranslationsDa {
|
||||
'companionRemote.remote.subtitles' => 'Undertekster',
|
||||
'companionRemote.remote.audio' => 'Lyd',
|
||||
'companionRemote.remote.searchHint' => 'Søg på desktop...',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.errors.noNetworkInterface' => 'Ingen netværksgrænseflade fundet',
|
||||
'companionRemote.errors.authenticationFailed' => 'Godkendelse mislykkedes',
|
||||
'companionRemote.errors.serverStartFailed' => ({required Object error}) => 'Fjernbetjeningsserveren kunne ikke startes: ${error}',
|
||||
@@ -4476,6 +4574,7 @@ extension on TranslationsDa {
|
||||
'seerr.statusPartiallyAvailable' => 'Delvist tilgængelig',
|
||||
'seerr.statusRequested' => 'Anmodet',
|
||||
'seerr.statusProcessing' => 'Behandler',
|
||||
'seerr.statusBlocklisted' => 'På blokeringslisten',
|
||||
'seerr.couldNotReach' => ({required Object url, required Object error}) => 'Kunne ikke nå ${url}: ${error}',
|
||||
'seerr.noInstanceAtUrl' => ({required Object url, required Object status}) => 'Ingen Seerr-instans på ${url} (HTTP ${status})',
|
||||
'seerr.notInitialized' => 'Denne Seerr-instans har ikke fuldført førstegangsopsætningen',
|
||||
@@ -4553,6 +4652,7 @@ extension on TranslationsDa {
|
||||
'addServer.borrowFromAnotherProfileSubtitle' => 'Genbrug en anden profils forbindelse. PIN-beskyttede profiler kræver en PIN.',
|
||||
'addServer.invalidCredentials' => 'Ugyldigt brugernavn eller ugyldig adgangskode',
|
||||
'addServer.authResponseNotJson' => 'Godkendelsessvaret var ikke gyldig JSON',
|
||||
'addServer.authResponseIncomplete' => 'Loginsvaret fra serveren var ufuldstændigt',
|
||||
'addServer.quickConnectRejected' => 'Quick Connect blev afvist af serveren',
|
||||
'addServer.quickConnectNotJson' => 'Quick Connect-svaret var ikke gyldig JSON',
|
||||
'addServer.quickConnectMissingFields' => 'Quick Connect-svaret mangler en kode eller hemmelighed',
|
||||
|
||||
+106
-6
@@ -182,6 +182,7 @@ class _Translations$common$de extends Translations$common$en {
|
||||
@override String get notAvailable => 'N. v.';
|
||||
@override String get url => 'URL';
|
||||
@override String get letterKeys => 'ABC';
|
||||
@override late final _Translations$common$mediaKind$de mediaKind = _Translations$common$mediaKind$de._(_root);
|
||||
}
|
||||
|
||||
// Path: screens
|
||||
@@ -412,6 +413,8 @@ class _Translations$settings$de extends Translations$settings$en {
|
||||
@override String get autoPipDescription => 'Beim Verlassen der App während der Wiedergabe automatisch Bild-in-Bild starten';
|
||||
@override String get matchContentFrameRate => 'Inhalts-Bildrate anpassen';
|
||||
@override String get matchContentFrameRateDescription => 'Bildwiederholrate des Displays an Videoinhalt anpassen';
|
||||
@override String get matchContentResolution => 'An Auflösung des Inhalts anpassen';
|
||||
@override String get matchContentResolutionDescription => 'Wechselt die Anzeige auf die native Auflösung des Videos, damit dein Fernseher das Hochskalieren übernimmt. Menüs und Untertitel werden während der Wiedergabe ebenfalls hochskaliert';
|
||||
@override String get matchRefreshRate => 'Bildwiederholrate anpassen';
|
||||
@override String get matchRefreshRateDescription => 'Bildwiederholrate im Vollbild anpassen';
|
||||
@override String get matchDynamicRange => 'Dynamikumfang anpassen';
|
||||
@@ -440,6 +443,10 @@ class _Translations$settings$de extends Translations$settings$en {
|
||||
@override String get dvConversionNativeDescription => 'Natives DV7 erzwingen und einen erneuten DV-Konvertierungsversuch unterdrücken';
|
||||
@override String get dvConversionDv81Description => 'Inline-RPU-Konvertierung in Dolby-Vision-Profil 8.1 erzwingen';
|
||||
@override String get dvConversionHevcStripDescription => 'Dolby-Vision-RPU/EL-Schichten entfernen und reines HEVC ausgeben';
|
||||
@override String get demuxer => 'Container-Demuxer';
|
||||
@override String get demuxerDescription => 'Welcher Demuxer direkt abgespielte Dateien einliest. Wechsle zu media3, wenn eine Datei Probleme macht.';
|
||||
@override String get demuxerFfmpeg => 'FFmpeg (empfohlen)';
|
||||
@override String get demuxerMedia3 => 'media3';
|
||||
@override String get requireProfileSelectionOnOpen => 'Profil beim Öffnen abfragen';
|
||||
@override String get requireProfileSelectionOnOpenDescription => 'Profilauswahl bei jedem Öffnen der App anzeigen';
|
||||
@override String get forceTvMode => 'TV-Modus erzwingen';
|
||||
@@ -1214,6 +1221,7 @@ class _Translations$serverSelection$de extends Translations$serverSelection$en {
|
||||
// Translations
|
||||
@override String noServersFoundForAccount({required Object username, required Object email}) => 'Keine Server gefunden für ${username} (${email})';
|
||||
@override String failedToLoadServers({required Object error}) => 'Server konnten nicht geladen werden: ${error}';
|
||||
@override String get noValidServers => 'Für dieses Konto wurden keine nutzbaren Server gefunden';
|
||||
}
|
||||
|
||||
// Path: hubDetail
|
||||
@@ -1432,6 +1440,7 @@ class _Translations$liveTv$de extends Translations$liveTv$en {
|
||||
@override String get guideReloadRequested => 'Aktualisierung des TV-Programms angefordert';
|
||||
@override String get rulesProcessRequested => 'Regelauswertung angefordert';
|
||||
@override String get recordShow => 'Sendung aufnehmen';
|
||||
@override late final _Translations$liveTv$recordSettings$de recordSettings = _Translations$liveTv$recordSettings$de._(_root);
|
||||
@override String startingInMinutes({required Object minutes}) => 'Beginnt in ${minutes} Min.';
|
||||
@override String dayAtTime({required Object day, required Object time}) => '${day} um ${time}';
|
||||
@override String invalidPlaybackData({required Object product}) => '${product} hat ungültige Live-TV-Wiedergabedaten zurückgegeben';
|
||||
@@ -1613,6 +1622,7 @@ class _Translations$watchTogether$de extends Translations$watchTogether$en {
|
||||
@override String get guestSwitchUnavailable => 'Wechsel fehlgeschlagen — Server nicht für Synchronisierung verfügbar';
|
||||
@override String get guestSwitchFailed => 'Wechsel fehlgeschlagen — Inhalt auf diesem Server nicht gefunden';
|
||||
@override String get defaultDisplayName => 'Benutzer';
|
||||
@override late final _Translations$watchTogether$errors$de errors = _Translations$watchTogether$errors$de._(_root);
|
||||
}
|
||||
|
||||
// Path: downloads
|
||||
@@ -2034,6 +2044,7 @@ class _Translations$seerr$de extends Translations$seerr$en {
|
||||
@override String get statusPartiallyAvailable => 'Teilweise verfügbar';
|
||||
@override String get statusRequested => 'Angefragt';
|
||||
@override String get statusProcessing => 'Wird verarbeitet';
|
||||
@override String get statusBlocklisted => 'Auf der Sperrliste';
|
||||
@override String couldNotReach({required Object url, required Object error}) => '${url} nicht erreichbar: ${error}';
|
||||
@override String noInstanceAtUrl({required Object url, required Object status}) => 'Keine Seerr-Instanz unter ${url} (HTTP ${status})';
|
||||
@override String get notInitialized => 'Die Ersteinrichtung dieser Seerr-Instanz wurde noch nicht abgeschlossen';
|
||||
@@ -2106,6 +2117,7 @@ class _Translations$addServer$de extends Translations$addServer$en {
|
||||
@override String get borrowFromAnotherProfileSubtitle => 'Verbindung eines anderen Profils wiederverwenden. PIN-geschützte Profile erfordern eine PIN.';
|
||||
@override String get invalidCredentials => 'Ungültiger Benutzername oder ungültiges Passwort';
|
||||
@override String get authResponseNotJson => 'Die Authentifizierungsantwort war kein gültiges JSON';
|
||||
@override String get authResponseIncomplete => 'Die Anmeldeantwort des Servers war unvollständig';
|
||||
@override String get quickConnectRejected => 'Quick Connect wurde vom Server abgelehnt';
|
||||
@override String get quickConnectNotJson => 'Die Quick Connect-Antwort war kein gültiges JSON';
|
||||
@override String get quickConnectMissingFields => 'In der Quick Connect-Antwort fehlt ein Code oder Geheimnis';
|
||||
@@ -2144,6 +2156,27 @@ class _Translations$common$ratingSource$de extends Translations$common$ratingSou
|
||||
@override String get rottenTomatoesAudience => 'Rotten-Tomatoes-Publikum';
|
||||
}
|
||||
|
||||
// Path: common.mediaKind
|
||||
class _Translations$common$mediaKind$de extends Translations$common$mediaKind$en {
|
||||
_Translations$common$mediaKind$de._(TranslationsDe root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsDe _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get movie => 'Film';
|
||||
@override String get show => 'Serie';
|
||||
@override String get season => 'Staffel';
|
||||
@override String get episode => 'Episode';
|
||||
@override String get artist => 'Interpret';
|
||||
@override String get album => 'Album';
|
||||
@override String get track => 'Titel';
|
||||
@override String get collection => 'Sammlung';
|
||||
@override String get playlist => 'Wiedergabeliste';
|
||||
@override String get clip => 'Clip';
|
||||
@override String get photo => 'Foto';
|
||||
@override String get folder => 'Ordner';
|
||||
}
|
||||
|
||||
// Path: hotkeys.actions
|
||||
class _Translations$hotkeys$actions$de extends Translations$hotkeys$actions$en {
|
||||
_Translations$hotkeys$actions$de._(TranslationsDe root) : this._root = root, super.internal(root);
|
||||
@@ -2191,6 +2224,7 @@ class _Translations$videoControls$pipErrors$de extends Translations$videoControl
|
||||
@override String get notSupported => 'Dieses Gerät unterstützt den Bild-in-Bild-Modus nicht';
|
||||
@override String get voSwitchFailed => 'Videoausgabe für Bild-in-Bild konnte nicht umgeschaltet werden';
|
||||
@override String get failed => 'Bild-in-Bild konnte nicht gestartet werden';
|
||||
@override String get prepareFailed => 'Bild-in-Bild konnte nicht vorbereitet werden';
|
||||
@override String unknown({required Object error}) => 'Ein Fehler ist aufgetreten: ${error}';
|
||||
}
|
||||
|
||||
@@ -2486,6 +2520,23 @@ class _Translations$explore$detail$de extends Translations$explore$detail$en {
|
||||
@override String get background => 'Hintergrund';
|
||||
}
|
||||
|
||||
// Path: liveTv.recordSettings
|
||||
class _Translations$liveTv$recordSettings$de extends Translations$liveTv$recordSettings$en {
|
||||
_Translations$liveTv$recordSettings$de._(TranslationsDe root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsDe _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get startEarly => 'Früher starten (Sekunden)';
|
||||
@override String get endLate => 'Später beenden (Sekunden)';
|
||||
@override String get newOnly => 'Nur neue Episoden';
|
||||
@override String get anyChannel => 'Auf jedem Sender aufnehmen';
|
||||
@override String get anyTime => 'Zu jeder Zeit aufnehmen';
|
||||
@override String get skipInLibrary => 'Episoden überspringen, die schon in der Bibliothek sind';
|
||||
@override String get keepUpTo => 'Zu behaltende Episoden';
|
||||
@override String get keepUpToHint => '0 behält alle Episoden';
|
||||
}
|
||||
|
||||
// Path: music.discography
|
||||
class _Translations$music$discography$de extends Translations$music$discography$en {
|
||||
_Translations$music$discography$de._(TranslationsDe root) : this._root = root, super.internal(root);
|
||||
@@ -2498,6 +2549,19 @@ class _Translations$music$discography$de extends Translations$music$discography$
|
||||
@override String get compilations => 'Kompilationen';
|
||||
}
|
||||
|
||||
// Path: watchTogether.errors
|
||||
class _Translations$watchTogether$errors$de extends Translations$watchTogether$errors$en {
|
||||
_Translations$watchTogether$errors$de._(TranslationsDe root) : this._root = root, super.internal(root);
|
||||
|
||||
final TranslationsDe _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
@override String get timedOut => 'Der Relay-Server hat nicht rechtzeitig geantwortet';
|
||||
@override String get connectionLost => 'Die Verbindung wurde geschlossen, bevor die Sitzung bereit war';
|
||||
@override String get invalidRelayResponse => 'Der Relay-Server hat eine unerwartete Antwort gesendet';
|
||||
@override String get sessionEnded => 'Der Host hat die Sitzung beendet';
|
||||
}
|
||||
|
||||
// Path: downloads.backgroundWarning
|
||||
class _Translations$downloads$backgroundWarning$de extends Translations$downloads$backgroundWarning$en {
|
||||
_Translations$downloads$backgroundWarning$de._(TranslationsDe root) : this._root = root, super.internal(root);
|
||||
@@ -2551,6 +2615,7 @@ class _Translations$companionRemote$session$de extends Translations$companionRem
|
||||
@override String get startServer => 'Server starten';
|
||||
@override String get stopServer => 'Server stoppen';
|
||||
@override String get minimize => 'Minimieren';
|
||||
@override String get manualAddressHint => 'Manuelle Verbindungsadresse:';
|
||||
}
|
||||
|
||||
// Path: companionRemote.pairing
|
||||
@@ -2787,6 +2852,18 @@ extension on TranslationsDe {
|
||||
'common.notAvailable' => 'N. v.',
|
||||
'common.url' => 'URL',
|
||||
'common.letterKeys' => 'ABC',
|
||||
'common.mediaKind.movie' => 'Film',
|
||||
'common.mediaKind.show' => 'Serie',
|
||||
'common.mediaKind.season' => 'Staffel',
|
||||
'common.mediaKind.episode' => 'Episode',
|
||||
'common.mediaKind.artist' => 'Interpret',
|
||||
'common.mediaKind.album' => 'Album',
|
||||
'common.mediaKind.track' => 'Titel',
|
||||
'common.mediaKind.collection' => 'Sammlung',
|
||||
'common.mediaKind.playlist' => 'Wiedergabeliste',
|
||||
'common.mediaKind.clip' => 'Clip',
|
||||
'common.mediaKind.photo' => 'Foto',
|
||||
'common.mediaKind.folder' => 'Ordner',
|
||||
'screens.licenses' => 'Lizenzen',
|
||||
'screens.switchProfile' => 'Profil wechseln',
|
||||
'screens.subtitleStyling' => 'Untertitel-Stil',
|
||||
@@ -2990,6 +3067,8 @@ extension on TranslationsDe {
|
||||
'settings.autoPipDescription' => 'Beim Verlassen der App während der Wiedergabe automatisch Bild-in-Bild starten',
|
||||
'settings.matchContentFrameRate' => 'Inhalts-Bildrate anpassen',
|
||||
'settings.matchContentFrameRateDescription' => 'Bildwiederholrate des Displays an Videoinhalt anpassen',
|
||||
'settings.matchContentResolution' => 'An Auflösung des Inhalts anpassen',
|
||||
'settings.matchContentResolutionDescription' => 'Wechselt die Anzeige auf die native Auflösung des Videos, damit dein Fernseher das Hochskalieren übernimmt. Menüs und Untertitel werden während der Wiedergabe ebenfalls hochskaliert',
|
||||
'settings.matchRefreshRate' => 'Bildwiederholrate anpassen',
|
||||
'settings.matchRefreshRateDescription' => 'Bildwiederholrate im Vollbild anpassen',
|
||||
'settings.matchDynamicRange' => 'Dynamikumfang anpassen',
|
||||
@@ -3018,6 +3097,10 @@ extension on TranslationsDe {
|
||||
'settings.dvConversionNativeDescription' => 'Natives DV7 erzwingen und einen erneuten DV-Konvertierungsversuch unterdrücken',
|
||||
'settings.dvConversionDv81Description' => 'Inline-RPU-Konvertierung in Dolby-Vision-Profil 8.1 erzwingen',
|
||||
'settings.dvConversionHevcStripDescription' => 'Dolby-Vision-RPU/EL-Schichten entfernen und reines HEVC ausgeben',
|
||||
'settings.demuxer' => 'Container-Demuxer',
|
||||
'settings.demuxerDescription' => 'Welcher Demuxer direkt abgespielte Dateien einliest. Wechsle zu media3, wenn eine Datei Probleme macht.',
|
||||
'settings.demuxerFfmpeg' => 'FFmpeg (empfohlen)',
|
||||
'settings.demuxerMedia3' => 'media3',
|
||||
'settings.requireProfileSelectionOnOpen' => 'Profil beim Öffnen abfragen',
|
||||
'settings.requireProfileSelectionOnOpenDescription' => 'Profilauswahl bei jedem Öffnen der App anzeigen',
|
||||
'settings.forceTvMode' => 'TV-Modus erzwingen',
|
||||
@@ -3205,6 +3288,8 @@ extension on TranslationsDe {
|
||||
'fileInfo.flagOriginal' => 'Original',
|
||||
'fileInfo.channelsMono' => 'Mono',
|
||||
'fileInfo.dolbyVisionProfile' => ({required Object profile}) => 'Profil ${profile}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.markAsWatched' => 'Als gesehen markieren',
|
||||
'mediaMenu.markAsUnwatched' => 'Als ungesehen markieren',
|
||||
'mediaMenu.removeFromContinueWatching' => 'Aus ‚Weiterschauen‘ entfernen',
|
||||
@@ -3223,8 +3308,6 @@ extension on TranslationsDe {
|
||||
'mediaMenu.deleteMovieTitle' => 'Diesen Film löschen?',
|
||||
'mediaMenu.deleteEpisodeConfirm' => 'Folge löschen',
|
||||
'mediaMenu.deleteSeasonConfirm' => 'Staffel löschen',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.deleteShowConfirm' => 'Serie löschen',
|
||||
'mediaMenu.deleteMovieConfirm' => 'Film löschen',
|
||||
'mediaMenu.deleteAnyway' => 'Trotzdem löschen',
|
||||
@@ -3346,6 +3429,7 @@ extension on TranslationsDe {
|
||||
'videoControls.pipErrors.notSupported' => 'Dieses Gerät unterstützt den Bild-in-Bild-Modus nicht',
|
||||
'videoControls.pipErrors.voSwitchFailed' => 'Videoausgabe für Bild-in-Bild konnte nicht umgeschaltet werden',
|
||||
'videoControls.pipErrors.failed' => 'Bild-in-Bild konnte nicht gestartet werden',
|
||||
'videoControls.pipErrors.prepareFailed' => 'Bild-in-Bild konnte nicht vorbereitet werden',
|
||||
'videoControls.pipErrors.unknown' => ({required Object error}) => 'Ein Fehler ist aufgetreten: ${error}',
|
||||
'videoControls.chapters' => 'Kapitel',
|
||||
'videoControls.noChaptersAvailable' => 'Keine Kapitel verfügbar',
|
||||
@@ -3666,6 +3750,7 @@ extension on TranslationsDe {
|
||||
'about.viewLicensesDescription' => 'Lizenzen von Drittanbieter-Bibliotheken anzeigen',
|
||||
'serverSelection.noServersFoundForAccount' => ({required Object username, required Object email}) => 'Keine Server gefunden für ${username} (${email})',
|
||||
'serverSelection.failedToLoadServers' => ({required Object error}) => 'Server konnten nicht geladen werden: ${error}',
|
||||
'serverSelection.noValidServers' => 'Für dieses Konto wurden keine nutzbaren Server gefunden',
|
||||
'hubDetail.title' => 'Titel',
|
||||
'hubDetail.releaseYear' => 'Erscheinungsjahr',
|
||||
'hubDetail.dateAdded' => 'Hinzugefügt am',
|
||||
@@ -3717,6 +3802,8 @@ extension on TranslationsDe {
|
||||
'explore.rows.watchlist' => 'Merkliste',
|
||||
'explore.rows.recommendedMovies' => 'Empfohlene Filme',
|
||||
'explore.rows.recommendedShows' => 'Empfohlene Serien',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.rows.trendingMovies' => 'Angesagte Filme',
|
||||
'explore.rows.trendingShows' => 'Angesagte Serien',
|
||||
'explore.rows.popularMovies' => 'Beliebte Filme',
|
||||
@@ -3737,8 +3824,6 @@ extension on TranslationsDe {
|
||||
'explore.characters' => 'Charaktere',
|
||||
'explore.addToWatchlist' => 'Zur Merkliste hinzufügen',
|
||||
'explore.removeFromWatchlist' => 'Von Merkliste entfernen',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.addedToWatchlist' => 'Zur Watchlist hinzugefügt',
|
||||
'explore.removedFromWatchlist' => 'Von der Watchlist entfernt',
|
||||
'explore.watchlistUpdateFailed' => 'Merkliste konnte nicht aktualisiert werden',
|
||||
@@ -3926,6 +4011,14 @@ extension on TranslationsDe {
|
||||
'liveTv.guideReloadRequested' => 'Aktualisierung des TV-Programms angefordert',
|
||||
'liveTv.rulesProcessRequested' => 'Regelauswertung angefordert',
|
||||
'liveTv.recordShow' => 'Sendung aufnehmen',
|
||||
'liveTv.recordSettings.startEarly' => 'Früher starten (Sekunden)',
|
||||
'liveTv.recordSettings.endLate' => 'Später beenden (Sekunden)',
|
||||
'liveTv.recordSettings.newOnly' => 'Nur neue Episoden',
|
||||
'liveTv.recordSettings.anyChannel' => 'Auf jedem Sender aufnehmen',
|
||||
'liveTv.recordSettings.anyTime' => 'Zu jeder Zeit aufnehmen',
|
||||
'liveTv.recordSettings.skipInLibrary' => 'Episoden überspringen, die schon in der Bibliothek sind',
|
||||
'liveTv.recordSettings.keepUpTo' => 'Zu behaltende Episoden',
|
||||
'liveTv.recordSettings.keepUpToHint' => '0 behält alle Episoden',
|
||||
'liveTv.startingInMinutes' => ({required Object minutes}) => 'Beginnt in ${minutes} Min.',
|
||||
'liveTv.dayAtTime' => ({required Object day, required Object time}) => '${day} um ${time}',
|
||||
'liveTv.invalidPlaybackData' => ({required Object product}) => '${product} hat ungültige Live-TV-Wiedergabedaten zurückgegeben',
|
||||
@@ -4070,6 +4163,10 @@ extension on TranslationsDe {
|
||||
'watchTogether.guestSwitchUnavailable' => 'Wechsel fehlgeschlagen — Server nicht für Synchronisierung verfügbar',
|
||||
'watchTogether.guestSwitchFailed' => 'Wechsel fehlgeschlagen — Inhalt auf diesem Server nicht gefunden',
|
||||
'watchTogether.defaultDisplayName' => 'Benutzer',
|
||||
'watchTogether.errors.timedOut' => 'Der Relay-Server hat nicht rechtzeitig geantwortet',
|
||||
'watchTogether.errors.connectionLost' => 'Die Verbindung wurde geschlossen, bevor die Sitzung bereit war',
|
||||
'watchTogether.errors.invalidRelayResponse' => 'Der Relay-Server hat eine unerwartete Antwort gesendet',
|
||||
'watchTogether.errors.sessionEnded' => 'Der Host hat die Sitzung beendet',
|
||||
'downloads.title' => 'Downloads',
|
||||
'downloads.manage' => 'Verwalten',
|
||||
'downloads.tvShows' => 'Serien',
|
||||
@@ -4209,6 +4306,7 @@ extension on TranslationsDe {
|
||||
'companionRemote.session.startServer' => 'Server starten',
|
||||
'companionRemote.session.stopServer' => 'Server stoppen',
|
||||
'companionRemote.session.minimize' => 'Minimieren',
|
||||
'companionRemote.session.manualAddressHint' => 'Manuelle Verbindungsadresse:',
|
||||
'companionRemote.pairing.discoveryDescription' => 'Plezy-Geräte mit demselben Plex-Konto erscheinen hier',
|
||||
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
|
||||
'companionRemote.pairing.connecting' => 'Verbinden...',
|
||||
@@ -4218,6 +4316,8 @@ extension on TranslationsDe {
|
||||
'companionRemote.pairing.availableDevices' => 'Verfügbare Geräte',
|
||||
'companionRemote.pairing.manualConnection' => 'Manuelle Verbindung',
|
||||
'companionRemote.pairing.cryptoInitFailed' => 'Sichere Verbindung konnte nicht gestartet werden. Melde dich zuerst bei Plex an.',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.pairing.validationHostRequired' => 'Bitte Host-Adresse eingeben',
|
||||
'companionRemote.pairing.validationHostFormat' => 'Format muss IP:Port sein (z. B. 192.168.1.100:48632)',
|
||||
'companionRemote.pairing.connectionTimedOut' => 'Zeitüberschreitung bei der Verbindung. Nutze auf beiden Geräten dasselbe Netzwerk.',
|
||||
@@ -4251,8 +4351,6 @@ extension on TranslationsDe {
|
||||
'companionRemote.remote.subtitles' => 'Untertitel',
|
||||
'companionRemote.remote.audio' => 'Audio',
|
||||
'companionRemote.remote.searchHint' => 'Auf dem Desktop suchen …',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.errors.noNetworkInterface' => 'Keine Netzwerkschnittstelle gefunden',
|
||||
'companionRemote.errors.authenticationFailed' => 'Authentifizierung fehlgeschlagen',
|
||||
'companionRemote.errors.serverStartFailed' => ({required Object error}) => 'Remote-Server konnte nicht gestartet werden: ${error}',
|
||||
@@ -4476,6 +4574,7 @@ extension on TranslationsDe {
|
||||
'seerr.statusPartiallyAvailable' => 'Teilweise verfügbar',
|
||||
'seerr.statusRequested' => 'Angefragt',
|
||||
'seerr.statusProcessing' => 'Wird verarbeitet',
|
||||
'seerr.statusBlocklisted' => 'Auf der Sperrliste',
|
||||
'seerr.couldNotReach' => ({required Object url, required Object error}) => '${url} nicht erreichbar: ${error}',
|
||||
'seerr.noInstanceAtUrl' => ({required Object url, required Object status}) => 'Keine Seerr-Instanz unter ${url} (HTTP ${status})',
|
||||
'seerr.notInitialized' => 'Die Ersteinrichtung dieser Seerr-Instanz wurde noch nicht abgeschlossen',
|
||||
@@ -4553,6 +4652,7 @@ extension on TranslationsDe {
|
||||
'addServer.borrowFromAnotherProfileSubtitle' => 'Verbindung eines anderen Profils wiederverwenden. PIN-geschützte Profile erfordern eine PIN.',
|
||||
'addServer.invalidCredentials' => 'Ungültiger Benutzername oder ungültiges Passwort',
|
||||
'addServer.authResponseNotJson' => 'Die Authentifizierungsantwort war kein gültiges JSON',
|
||||
'addServer.authResponseIncomplete' => 'Die Anmeldeantwort des Servers war unvollständig',
|
||||
'addServer.quickConnectRejected' => 'Quick Connect wurde vom Server abgelehnt',
|
||||
'addServer.quickConnectNotJson' => 'Die Quick Connect-Antwort war kein gültiges JSON',
|
||||
'addServer.quickConnectMissingFields' => 'In der Quick Connect-Antwort fehlt ein Code oder Geheimnis',
|
||||
|
||||
+179
-6
@@ -314,6 +314,8 @@ class Translations$common$en {
|
||||
|
||||
/// en: 'ABC'
|
||||
String get letterKeys => 'ABC';
|
||||
|
||||
late final Translations$common$mediaKind$en mediaKind = Translations$common$mediaKind$en.internal(_root);
|
||||
}
|
||||
|
||||
// Path: screens
|
||||
@@ -951,6 +953,12 @@ class Translations$settings$en {
|
||||
/// en: 'Match display refresh rate to video content'
|
||||
String get matchContentFrameRateDescription => 'Match display refresh rate to video content';
|
||||
|
||||
/// en: 'Match Content Resolution'
|
||||
String get matchContentResolution => 'Match Content Resolution';
|
||||
|
||||
/// en: 'Switch the display to the video's native resolution so your TV handles upscaling. Menus and subtitles are upscaled too during playback'
|
||||
String get matchContentResolutionDescription => 'Switch the display to the video\'s native resolution so your TV handles upscaling. Menus and subtitles are upscaled too during playback';
|
||||
|
||||
/// en: 'Match Refresh Rate'
|
||||
String get matchRefreshRate => 'Match Refresh Rate';
|
||||
|
||||
@@ -1035,6 +1043,18 @@ class Translations$settings$en {
|
||||
/// en: 'Strip Dolby Vision RPU/EL layers and present plain HEVC'
|
||||
String get dvConversionHevcStripDescription => 'Strip Dolby Vision RPU/EL layers and present plain HEVC';
|
||||
|
||||
/// en: 'Container Demuxer'
|
||||
String get demuxer => 'Container Demuxer';
|
||||
|
||||
/// en: 'Which demuxer parses direct-played files. Switch to media3 if a file misbehaves.'
|
||||
String get demuxerDescription => 'Which demuxer parses direct-played files. Switch to media3 if a file misbehaves.';
|
||||
|
||||
/// en: 'FFmpeg (Recommended)'
|
||||
String get demuxerFfmpeg => 'FFmpeg (Recommended)';
|
||||
|
||||
/// en: 'media3'
|
||||
String get demuxerMedia3 => 'media3';
|
||||
|
||||
/// en: 'Ask for profile on app open'
|
||||
String get requireProfileSelectionOnOpen => 'Ask for profile on app open';
|
||||
|
||||
@@ -2957,6 +2977,9 @@ class Translations$serverSelection$en {
|
||||
|
||||
/// en: 'Failed to load servers: ${error}'
|
||||
String failedToLoadServers({required Object error}) => 'Failed to load servers: ${error}';
|
||||
|
||||
/// en: 'No usable servers were found on this account'
|
||||
String get noValidServers => 'No usable servers were found on this account';
|
||||
}
|
||||
|
||||
// Path: hubDetail
|
||||
@@ -3457,6 +3480,8 @@ class Translations$liveTv$en {
|
||||
/// en: 'Record show'
|
||||
String get recordShow => 'Record show';
|
||||
|
||||
late final Translations$liveTv$recordSettings$en recordSettings = Translations$liveTv$recordSettings$en.internal(_root);
|
||||
|
||||
/// en: 'Starting in ${minutes} min'
|
||||
String startingInMinutes({required Object minutes}) => 'Starting in ${minutes} min';
|
||||
|
||||
@@ -3920,6 +3945,8 @@ class Translations$watchTogether$en {
|
||||
|
||||
/// en: 'User'
|
||||
String get defaultDisplayName => 'User';
|
||||
|
||||
late final Translations$watchTogether$errors$en errors = Translations$watchTogether$errors$en.internal(_root);
|
||||
}
|
||||
|
||||
// Path: downloads
|
||||
@@ -4978,6 +5005,9 @@ class Translations$seerr$en {
|
||||
/// en: 'Processing'
|
||||
String get statusProcessing => 'Processing';
|
||||
|
||||
/// en: 'Blocklisted'
|
||||
String get statusBlocklisted => 'Blocklisted';
|
||||
|
||||
/// en: 'Could not reach ${url}: ${error}'
|
||||
String couldNotReach({required Object url, required Object error}) => 'Could not reach ${url}: ${error}';
|
||||
|
||||
@@ -5149,6 +5179,9 @@ class Translations$addServer$en {
|
||||
/// en: 'The authentication response was not valid JSON'
|
||||
String get authResponseNotJson => 'The authentication response was not valid JSON';
|
||||
|
||||
/// en: 'The sign-in response from the server was incomplete'
|
||||
String get authResponseIncomplete => 'The sign-in response from the server was incomplete';
|
||||
|
||||
/// en: 'Quick Connect was rejected by the server'
|
||||
String get quickConnectRejected => 'Quick Connect was rejected by the server';
|
||||
|
||||
@@ -5240,6 +5273,51 @@ class Translations$common$ratingSource$en {
|
||||
String get rottenTomatoesAudience => 'Rotten Tomatoes audience';
|
||||
}
|
||||
|
||||
// Path: common.mediaKind
|
||||
class Translations$common$mediaKind$en {
|
||||
Translations$common$mediaKind$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'Movie'
|
||||
String get movie => 'Movie';
|
||||
|
||||
/// en: 'Show'
|
||||
String get show => 'Show';
|
||||
|
||||
/// en: 'Season'
|
||||
String get season => 'Season';
|
||||
|
||||
/// en: 'Episode'
|
||||
String get episode => 'Episode';
|
||||
|
||||
/// en: 'Artist'
|
||||
String get artist => 'Artist';
|
||||
|
||||
/// en: 'Album'
|
||||
String get album => 'Album';
|
||||
|
||||
/// en: 'Track'
|
||||
String get track => 'Track';
|
||||
|
||||
/// en: 'Collection'
|
||||
String get collection => 'Collection';
|
||||
|
||||
/// en: 'Playlist'
|
||||
String get playlist => 'Playlist';
|
||||
|
||||
/// en: 'Clip'
|
||||
String get clip => 'Clip';
|
||||
|
||||
/// en: 'Photo'
|
||||
String get photo => 'Photo';
|
||||
|
||||
/// en: 'Folder'
|
||||
String get folder => 'Folder';
|
||||
}
|
||||
|
||||
// Path: hotkeys.actions
|
||||
class Translations$hotkeys$actions$en {
|
||||
Translations$hotkeys$actions$en.internal(this._root);
|
||||
@@ -5350,6 +5428,9 @@ class Translations$videoControls$pipErrors$en {
|
||||
/// en: 'Picture-in-picture failed to start'
|
||||
String get failed => 'Picture-in-picture failed to start';
|
||||
|
||||
/// en: 'Picture-in-picture could not be prepared'
|
||||
String get prepareFailed => 'Picture-in-picture could not be prepared';
|
||||
|
||||
/// en: 'An error occurred: ${error}'
|
||||
String unknown({required Object error}) => 'An error occurred: ${error}';
|
||||
}
|
||||
@@ -5966,6 +6047,39 @@ class Translations$explore$detail$en {
|
||||
String get background => 'Background';
|
||||
}
|
||||
|
||||
// Path: liveTv.recordSettings
|
||||
class Translations$liveTv$recordSettings$en {
|
||||
Translations$liveTv$recordSettings$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'Start early (seconds)'
|
||||
String get startEarly => 'Start early (seconds)';
|
||||
|
||||
/// en: 'End late (seconds)'
|
||||
String get endLate => 'End late (seconds)';
|
||||
|
||||
/// en: 'Only new episodes'
|
||||
String get newOnly => 'Only new episodes';
|
||||
|
||||
/// en: 'Record on any channel'
|
||||
String get anyChannel => 'Record on any channel';
|
||||
|
||||
/// en: 'Record at any time'
|
||||
String get anyTime => 'Record at any time';
|
||||
|
||||
/// en: 'Skip episodes already in the library'
|
||||
String get skipInLibrary => 'Skip episodes already in the library';
|
||||
|
||||
/// en: 'Episodes to keep'
|
||||
String get keepUpTo => 'Episodes to keep';
|
||||
|
||||
/// en: '0 keeps every episode'
|
||||
String get keepUpToHint => '0 keeps every episode';
|
||||
}
|
||||
|
||||
// Path: music.discography
|
||||
class Translations$music$discography$en {
|
||||
Translations$music$discography$en.internal(this._root);
|
||||
@@ -5984,6 +6098,27 @@ class Translations$music$discography$en {
|
||||
String get compilations => 'Compilations';
|
||||
}
|
||||
|
||||
// Path: watchTogether.errors
|
||||
class Translations$watchTogether$errors$en {
|
||||
Translations$watchTogether$errors$en.internal(this._root);
|
||||
|
||||
final Translations _root; // ignore: unused_field
|
||||
|
||||
// Translations
|
||||
|
||||
/// en: 'The relay did not respond in time'
|
||||
String get timedOut => 'The relay did not respond in time';
|
||||
|
||||
/// en: 'The connection closed before the session was ready'
|
||||
String get connectionLost => 'The connection closed before the session was ready';
|
||||
|
||||
/// en: 'The relay sent an unexpected response'
|
||||
String get invalidRelayResponse => 'The relay sent an unexpected response';
|
||||
|
||||
/// en: 'The host ended the session'
|
||||
String get sessionEnded => 'The host ended the session';
|
||||
}
|
||||
|
||||
// Path: downloads.backgroundWarning
|
||||
class Translations$downloads$backgroundWarning$en {
|
||||
Translations$downloads$backgroundWarning$en.internal(this._root);
|
||||
@@ -6111,6 +6246,9 @@ class Translations$companionRemote$session$en {
|
||||
|
||||
/// en: 'Minimize'
|
||||
String get minimize => 'Minimize';
|
||||
|
||||
/// en: 'Manual connection address:'
|
||||
String get manualAddressHint => 'Manual connection address:';
|
||||
}
|
||||
|
||||
// Path: companionRemote.pairing
|
||||
@@ -6503,6 +6641,18 @@ extension on Translations {
|
||||
'common.notAvailable' => 'N/A',
|
||||
'common.url' => 'URL',
|
||||
'common.letterKeys' => 'ABC',
|
||||
'common.mediaKind.movie' => 'Movie',
|
||||
'common.mediaKind.show' => 'Show',
|
||||
'common.mediaKind.season' => 'Season',
|
||||
'common.mediaKind.episode' => 'Episode',
|
||||
'common.mediaKind.artist' => 'Artist',
|
||||
'common.mediaKind.album' => 'Album',
|
||||
'common.mediaKind.track' => 'Track',
|
||||
'common.mediaKind.collection' => 'Collection',
|
||||
'common.mediaKind.playlist' => 'Playlist',
|
||||
'common.mediaKind.clip' => 'Clip',
|
||||
'common.mediaKind.photo' => 'Photo',
|
||||
'common.mediaKind.folder' => 'Folder',
|
||||
'screens.licenses' => 'Licenses',
|
||||
'screens.switchProfile' => 'Switch Profile',
|
||||
'screens.subtitleStyling' => 'Subtitle Styling',
|
||||
@@ -6706,6 +6856,8 @@ extension on Translations {
|
||||
'settings.autoPipDescription' => 'Automatically enter picture-in-picture when you leave the app during playback',
|
||||
'settings.matchContentFrameRate' => 'Match Content Frame Rate',
|
||||
'settings.matchContentFrameRateDescription' => 'Match display refresh rate to video content',
|
||||
'settings.matchContentResolution' => 'Match Content Resolution',
|
||||
'settings.matchContentResolutionDescription' => 'Switch the display to the video\'s native resolution so your TV handles upscaling. Menus and subtitles are upscaled too during playback',
|
||||
'settings.matchRefreshRate' => 'Match Refresh Rate',
|
||||
'settings.matchRefreshRateDescription' => 'Match display refresh rate in fullscreen',
|
||||
'settings.matchDynamicRange' => 'Match Dynamic Range',
|
||||
@@ -6734,6 +6886,10 @@ extension on Translations {
|
||||
'settings.dvConversionNativeDescription' => 'Force native DV7 and suppress DV conversion retry',
|
||||
'settings.dvConversionDv81Description' => 'Force inline RPU conversion to Dolby Vision profile 8.1',
|
||||
'settings.dvConversionHevcStripDescription' => 'Strip Dolby Vision RPU/EL layers and present plain HEVC',
|
||||
'settings.demuxer' => 'Container Demuxer',
|
||||
'settings.demuxerDescription' => 'Which demuxer parses direct-played files. Switch to media3 if a file misbehaves.',
|
||||
'settings.demuxerFfmpeg' => 'FFmpeg (Recommended)',
|
||||
'settings.demuxerMedia3' => 'media3',
|
||||
'settings.requireProfileSelectionOnOpen' => 'Ask for profile on app open',
|
||||
'settings.requireProfileSelectionOnOpenDescription' => 'Show profile selection every time the app is opened',
|
||||
'settings.forceTvMode' => 'Force TV mode',
|
||||
@@ -6921,6 +7077,8 @@ extension on Translations {
|
||||
'fileInfo.flagOriginal' => 'Original',
|
||||
'fileInfo.channelsMono' => 'Mono',
|
||||
'fileInfo.dolbyVisionProfile' => ({required Object profile}) => 'Profile ${profile}',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.markAsWatched' => 'Mark as Watched',
|
||||
'mediaMenu.markAsUnwatched' => 'Mark as Unwatched',
|
||||
'mediaMenu.removeFromContinueWatching' => 'Remove from Continue Watching',
|
||||
@@ -6939,8 +7097,6 @@ extension on Translations {
|
||||
'mediaMenu.deleteMovieTitle' => 'Delete this movie?',
|
||||
'mediaMenu.deleteEpisodeConfirm' => 'Delete episode',
|
||||
'mediaMenu.deleteSeasonConfirm' => 'Delete season',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'mediaMenu.deleteShowConfirm' => 'Delete show',
|
||||
'mediaMenu.deleteMovieConfirm' => 'Delete movie',
|
||||
'mediaMenu.deleteAnyway' => 'Delete anyway',
|
||||
@@ -7062,6 +7218,7 @@ extension on Translations {
|
||||
'videoControls.pipErrors.notSupported' => 'Device doesn\'t support picture-in-picture mode',
|
||||
'videoControls.pipErrors.voSwitchFailed' => 'Failed to switch video output for picture-in-picture',
|
||||
'videoControls.pipErrors.failed' => 'Picture-in-picture failed to start',
|
||||
'videoControls.pipErrors.prepareFailed' => 'Picture-in-picture could not be prepared',
|
||||
'videoControls.pipErrors.unknown' => ({required Object error}) => 'An error occurred: ${error}',
|
||||
'videoControls.chapters' => 'Chapters',
|
||||
'videoControls.noChaptersAvailable' => 'No chapters available',
|
||||
@@ -7382,6 +7539,7 @@ extension on Translations {
|
||||
'about.viewLicensesDescription' => 'View licenses of third-party libraries',
|
||||
'serverSelection.noServersFoundForAccount' => ({required Object username, required Object email}) => 'No servers found for ${username} (${email})',
|
||||
'serverSelection.failedToLoadServers' => ({required Object error}) => 'Failed to load servers: ${error}',
|
||||
'serverSelection.noValidServers' => 'No usable servers were found on this account',
|
||||
'hubDetail.title' => 'Title',
|
||||
'hubDetail.releaseYear' => 'Release Year',
|
||||
'hubDetail.dateAdded' => 'Date Added',
|
||||
@@ -7433,6 +7591,8 @@ extension on Translations {
|
||||
'explore.rows.watchlist' => 'Watchlist',
|
||||
'explore.rows.recommendedMovies' => 'Recommended Movies',
|
||||
'explore.rows.recommendedShows' => 'Recommended Shows',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.rows.trendingMovies' => 'Trending Movies',
|
||||
'explore.rows.trendingShows' => 'Trending Shows',
|
||||
'explore.rows.popularMovies' => 'Popular Movies',
|
||||
@@ -7453,8 +7613,6 @@ extension on Translations {
|
||||
'explore.characters' => 'Characters',
|
||||
'explore.addToWatchlist' => 'Add to Watchlist',
|
||||
'explore.removeFromWatchlist' => 'Remove from Watchlist',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'explore.addedToWatchlist' => 'Added to watchlist',
|
||||
'explore.removedFromWatchlist' => 'Removed from watchlist',
|
||||
'explore.watchlistUpdateFailed' => 'Couldn\'t update watchlist',
|
||||
@@ -7642,6 +7800,14 @@ extension on Translations {
|
||||
'liveTv.guideReloadRequested' => 'Guide refresh requested',
|
||||
'liveTv.rulesProcessRequested' => 'Rule re-evaluation requested',
|
||||
'liveTv.recordShow' => 'Record show',
|
||||
'liveTv.recordSettings.startEarly' => 'Start early (seconds)',
|
||||
'liveTv.recordSettings.endLate' => 'End late (seconds)',
|
||||
'liveTv.recordSettings.newOnly' => 'Only new episodes',
|
||||
'liveTv.recordSettings.anyChannel' => 'Record on any channel',
|
||||
'liveTv.recordSettings.anyTime' => 'Record at any time',
|
||||
'liveTv.recordSettings.skipInLibrary' => 'Skip episodes already in the library',
|
||||
'liveTv.recordSettings.keepUpTo' => 'Episodes to keep',
|
||||
'liveTv.recordSettings.keepUpToHint' => '0 keeps every episode',
|
||||
'liveTv.startingInMinutes' => ({required Object minutes}) => 'Starting in ${minutes} min',
|
||||
'liveTv.dayAtTime' => ({required Object day, required Object time}) => '${day} at ${time}',
|
||||
'liveTv.invalidPlaybackData' => ({required Object product}) => '${product} returned invalid Live TV playback data',
|
||||
@@ -7786,6 +7952,10 @@ extension on Translations {
|
||||
'watchTogether.guestSwitchUnavailable' => 'Couldn\'t switch — server unavailable for sync',
|
||||
'watchTogether.guestSwitchFailed' => 'Couldn\'t switch — content not found on this server',
|
||||
'watchTogether.defaultDisplayName' => 'User',
|
||||
'watchTogether.errors.timedOut' => 'The relay did not respond in time',
|
||||
'watchTogether.errors.connectionLost' => 'The connection closed before the session was ready',
|
||||
'watchTogether.errors.invalidRelayResponse' => 'The relay sent an unexpected response',
|
||||
'watchTogether.errors.sessionEnded' => 'The host ended the session',
|
||||
'downloads.title' => 'Downloads',
|
||||
'downloads.manage' => 'Manage',
|
||||
'downloads.tvShows' => 'TV Shows',
|
||||
@@ -7925,6 +8095,7 @@ extension on Translations {
|
||||
'companionRemote.session.startServer' => 'Start Server',
|
||||
'companionRemote.session.stopServer' => 'Stop Server',
|
||||
'companionRemote.session.minimize' => 'Minimize',
|
||||
'companionRemote.session.manualAddressHint' => 'Manual connection address:',
|
||||
'companionRemote.pairing.discoveryDescription' => 'Plezy devices with the same Plex account appear here',
|
||||
'companionRemote.pairing.hostAddressHint' => '192.168.1.100:48632',
|
||||
'companionRemote.pairing.connecting' => 'Connecting...',
|
||||
@@ -7934,6 +8105,8 @@ extension on Translations {
|
||||
'companionRemote.pairing.availableDevices' => 'Available Devices',
|
||||
'companionRemote.pairing.manualConnection' => 'Manual Connection',
|
||||
'companionRemote.pairing.cryptoInitFailed' => 'Couldn\'t start secure connection. Sign in to Plex first.',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.pairing.validationHostRequired' => 'Please enter host address',
|
||||
'companionRemote.pairing.validationHostFormat' => 'Format must be IP:port (e.g., 192.168.1.100:48632)',
|
||||
'companionRemote.pairing.connectionTimedOut' => 'Connection timed out. Use the same network on both devices.',
|
||||
@@ -7967,8 +8140,6 @@ extension on Translations {
|
||||
'companionRemote.remote.subtitles' => 'Subtitles',
|
||||
'companionRemote.remote.audio' => 'Audio',
|
||||
'companionRemote.remote.searchHint' => 'Search on desktop...',
|
||||
_ => null,
|
||||
} ?? switch (path) {
|
||||
'companionRemote.errors.noNetworkInterface' => 'No network interface found',
|
||||
'companionRemote.errors.authenticationFailed' => 'Authentication failed',
|
||||
'companionRemote.errors.serverStartFailed' => ({required Object error}) => 'Failed to start remote server: ${error}',
|
||||
@@ -8192,6 +8363,7 @@ extension on Translations {
|
||||
'seerr.statusPartiallyAvailable' => 'Partially available',
|
||||
'seerr.statusRequested' => 'Requested',
|
||||
'seerr.statusProcessing' => 'Processing',
|
||||
'seerr.statusBlocklisted' => 'Blocklisted',
|
||||
'seerr.couldNotReach' => ({required Object url, required Object error}) => 'Could not reach ${url}: ${error}',
|
||||
'seerr.noInstanceAtUrl' => ({required Object url, required Object status}) => 'No Seerr instance at ${url} (HTTP ${status})',
|
||||
'seerr.notInitialized' => 'This Seerr instance has not completed first-run setup',
|
||||
@@ -8269,6 +8441,7 @@ extension on Translations {
|
||||
'addServer.borrowFromAnotherProfileSubtitle' => 'Reuse another profile\'s connection. PIN-protected profiles require a PIN.',
|
||||
'addServer.invalidCredentials' => 'Invalid username or password',
|
||||
'addServer.authResponseNotJson' => 'The authentication response was not valid JSON',
|
||||
'addServer.authResponseIncomplete' => 'The sign-in response from the server was incomplete',
|
||||
'addServer.quickConnectRejected' => 'Quick Connect was rejected by the server',
|
||||
'addServer.quickConnectNotJson' => 'The Quick Connect response was not valid JSON',
|
||||
'addServer.quickConnectMissingFields' => 'The Quick Connect response is missing a code or secret',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user