Compare commits

...
Author SHA1 Message Date
edde746 5d6ee0861e fix(player): snap Android MediaCodec frames to display vsync 2026-09-04 12:02:39 +02:00
edde746 986e769ac0 fix(player): stop subtitle updates from dropping video frames on the mpv Android backend
With the mpv backend on Android, every subtitle change cost two dropped
video frames on a Fire TV Cube (36 per minute with PGS SDH subtitles, 15
with srt, #2240) and accounts for the residual drops on the Shield in #2202,
whose sessions also had subtitles on. The diagnostic build showed the drops
in pairs: a frame handed over on time, then the video thread waking 90-100
ms late. vo_mediacodec rasterized subtitles and blitted them into the OSD
Surface on that thread, and locking the Surface waits CPU-side for the
compositor - dequeue plus the release fence, one or two vsyncs, 42-83 ms at
23.976 Hz. Kodi, VLC 4 and ExoPlayer all keep subtitle output off the
presentation thread.

Move the native pin to edde746/mpv-build@88c1b135e7: the whole OSD stage
runs on its own thread, fed with the video pts at every flip, so the video
thread never waits on the compositor or on libass. Subtitles latch on the
same vsync as the video in the common case and one later when the lock has
to wait. Shield on vo=mediacodec with ASS subtitles: no video-thread stage
over 10 ms and 0 drops across five 150 s runs, subtitles verified on
screen; DTS-HD MA 4K unchanged at 0 drops. The pin keeps the #2202
diagnostics and adds VO stage timing to them. Apple, Linux and Windows
assets are unchanged.
2026-09-04 06:14:18 +02:00
edde746 b61fc9e661 fix(audio): stop the passthrough clock from overshooting after a stall on the mpv Android backend
The smoothed passthrough clock from aeb06c2c9 (edde746/mpv-build 0105)
still let the Shield in #2202 drop a frame every 70 s or so on TrueHD and
DTS-HD MA. The average handles head jitter completely - on a Shield with
the raw head artificially held for 150 ms it went from 410 dropped frames
in 200 s to 0 - but it regresses on stalls: when the head freezes (device
underrun, rebuffer, a HAL that stops updating) while the wall clock runs,
the estimate runs past what was written, (written - head) wraps, and
getLatency reports 0 - the core sees the whole device buffer vanish in one
step and drops video. With the AO starved for 400 ms every 15 s that was 77
drops in 170 s against 8 with the raw clock, and a Box R 4K Plus hit the
wrap 361 times in four minutes of ordinary DTS-HD playback.

Move the native pin to edde746/mpv-build@a58f0c1336: the estimate is
clamped to the written position and its window restarted on overshoot, and
between reports it may deviate from "last report + elapsed" by at most 10%
of the elapsed time unless it is a second or more off - the two guards
media3's AudioTrackPositionTracker keeps over the same average. Starvation
run: 9 drops, no wrap; real HAL with pauses and seeks: 0 drops. The pin also
carries verbose-level diagnostics for this issue (per-drop timing in vo.c,
passthrough clock anomalies and a 10 s summary in ao_audiotrack) so the
next log from the reporter pins whatever remains. Apple, Linux and Windows
assets are unchanged (their content keys did not move).
2026-09-04 01:58:34 +02:00
edde746 fa8da33ec8 fix(tv): drop a stale Discover rail-focus claim, log swallowed tvOS Menu presses, and unblock shelf test resets
Three findings from the #2239 investigation.

Discover armed "focus the browse rail when it has hubs" on its first
load and kept it armed indefinitely while the rail had nothing to show.
Hubs landing minutes later — reconnect, push refresh — then yanked the
remote off a sidebar item the user had since moved to. The claim now
lapses once focus sits on a control outside the screen; a bare content
scope (the startup state) still lets the rail take its initial focus.

On Apple TV a Menu press that reaches MainScreen at the home root is
consumed silently by design (the engine normally hands root Menu to
UIKit). That branch is what turned a focus slip into a "dead remote"
report, so it now logs passthrough state, picker state, and the primary
focus label.

SystemShelfService.debugReset awaited the mutation tail queued by the
previous widget test, whose FakeAsync zone ends without flushing the
microtasks that settle the chain, so any second test in a file using it
hung in setUp. It now drops the queue synchronously; the #2239 session
regression test moves back beside the profile-switch test it belongs
with.
2026-09-03 23:54:09 +02:00
edde746 44599549e1 fix(focus): keep root-navigator routes from losing the remote to the covered profile session
On tvOS the profile picker shown after a background/standby resume lost
its focus highlight and the Siri Remote went dead until a force-quit.
Android TV hit the same shape with the player (#2034).

The picker and PIN dialog are pushed on the root navigator, above the
nested profile-session navigator. Nested routes still report
`isCurrent == true` under that cover, and Flutter leaves a covered
route's scope focusable, so any focus self-heal under MainScreen —
the sidebar reveal on an offline/online flip, a Libraries grid reload,
the TV browse rail — won the remote behind the picker. With menu
passthrough pinned off while the picker is up, Menu was swallowed too.

Restore the invariant once at the navigator boundary instead of at
every reclaim site: CoveredRouteFocusBoundary wraps the session in an
ExcludeFocus keyed on the root route's currency, so requests below a
cover are no-ops, and re-requests its own scope on uncover so focus
walks back to the leaf that had it (the covering route's pop culls the
excluded scope from the route scope's history before the exclusion
lifts, which is why Flutter's own restoration cannot). This makes
isRouteChainCurrent redundant; the player's guards return to plain
nested currency.

close #2239
2026-09-03 23:47:27 +02:00
edde746 e46b3dab7c fix(seerr): diagnose an auth proxy in front of Seerr instead of misreporting it
A Seerr instance behind forward-auth (Authelia, Authentik, Cloudflare
Access) or HTTP Basic failed setup with "No Seerr instance at … (HTTP
200)": the probe followed the proxy's redirect to its login page and
decoded the HTML as "not JSON". A live session that later hit the same
wall took the proxy's 401 as Seerr's, re-authed through the wall, failed,
and unlinked a perfectly good stored session.

Seerr's API never redirects and always answers with JSON, so a 3xx or a
non-JSON 401/403 is the proxy talking. Seerr requests no longer follow
redirects, that shape maps to a SeerrProxyException with a message that
says what to do, the probe reports it in place of "no instance", and the
client neither re-auths nor unlinks on it.

close #1877
2026-09-03 21:42:47 +02:00
edde746 e67bf996c5 fix(player): keep subtitles on the picture when ambient lighting is on
With ambient lighting enabled, ASS subtitles anchored to a corner (and PGS
bitmaps) rendered against the whole screen instead of the video: the effect
stretches mpv's frame to the window with video-aspect-override and lets the
shader composite the real picture inside it, and mpv places subtitles against
that stretched frame.

The pinned libmpv now carries --sub-video-rect-aspect (edde746/mpv-build
ec08018), which makes mpv derive its subtitle margins from the picture's real
aspect inside the displayed rect. AmbientLightingService hands it the video
aspect before overriding the frame, so a libmpv without the option refuses
cleanly with the frame untouched, and resets it on disable.

Verified on a Pixel 7 (2400x1080) with a 16:9 file whose OP credits are
\pos-anchored: subtitle extents are pixel-identical with ambient lighting on
and off, and mpv reports OSD borders l=240 r=240 for the overridden frame.

close #2120
2026-09-03 21:28:10 +02:00
edde746 66cc6fc192 fix(player): hide the header clock on a portrait phone
On a phone in portrait the video controls header is too narrow: the clock crowds the back button, title, and track/chapter controls. Hide it there; landscape, tablets, desktop, and TV keep it.
2026-09-03 20:32:05 +02:00
edde746 691d10b3c6 feat(navigation): landscape rail for the mobile shell and phone rotation
Phones were locked to portrait outside the video player, and the mobile
shell had no answer for a wide, short viewport: car head units (which use
the mobile layout) and tablets in landscape spent their scarce height on
a bottom navigation bar and a 500dp hero.

In landscape the mobile shell now puts the bottom bar's destinations on a
leading Material NavigationRail (MobileNavigationRail) and keeps every
other mobile layout decision as it is. The rail keeps the bottom bar's
extras: the offline reconnect affordance as its leading action and the
long-press library quick picker on the Libraries destination. Labels
follow the existing nav-bar-labels setting but give way automatically
when the destinations cannot fit (a landscape phone is ~410dp tall), and
the rail scrolls as a last resort. The content beside it drops the leading
system inset the rail already absorbs.

Phones now allow every orientation; OrientationHelper.restoreDefaultOrientations
is context-free and the player exit path uses it instead of its own copy
of the phone lock. The Discover hero fills the viewport in mobile landscape
and compacts its logo and bottom offset when short, so its content stays
below the top bar.

The music mini-player learns a start inset (MiniPlayerInsetController.setNavInsets)
so it floats beside the rail in landscape and above the bar in portrait;
route suspension zeroes both.

Known follow-up: the media detail header is not yet laid out for a
landscape phone (logo runs under the status bar and back button).
2026-09-03 20:29:08 +02:00
edde746 42b9bf7fb8 fix(automotive): keep every screen beside a side car system bar
On Android Automotive head units with a left- or right-positioned system
bar, the whole edge of the app rendered underneath it: Discover's title,
hero text and first card were clipped, and the player controls sat under
the bar. Play's car app quality AR-1 requires interactive UI to stay clear
of system bars.

The platform reports the bar as a systemBars inset and Flutter forwards it
as MediaQuery.padding.left/right, but the mobile screens only honour the
top and bottom insets. On the emulator this only showed after the first
video session (the player's edge-to-edge restore stops the DecorView from
fitting a navigation-bar-typed left bar); on Android 14+ CarSystemUI the
left bar is a status-bar-typed inset, so it is under the bar from launch.

Car bars are opaque and may be impossible to hide, so nothing is worth
drawing under them: FormFactorScale now wraps the automotive surface in a
horizontal SafeArea inside the scaled MediaQuery, consuming the insets
once for every route.

Reproduced and verified on the API 33 automotive image with the
com.android.systemui.rro.left overlay enabled for the foreground user.
2026-09-03 20:28:53 +02:00
edde746 2efd300a5f fix(downloads): show resume progress bar on downloaded episodes
Downloaded episodes never showed the partially-watched progress bar, so a
user resuming offline could not tell which episode they had started.

Offline playback already records progress: the tracker queues a progress
action and emits a WatchStateNotifier event, and DownloadProvider hydrates
those rows back into WatchStateStore on load. EpisodeCard consumed that
state via withFreshWatchState but then passed progressAvailable: false to
WatchedIndicator for offline cards, a guard left over from before offline
progress tracking existed. Downloaded movie cards (MediaCard) never had the
guard and already showed the bar.

Drop the guard and the now-unused WatchedIndicator.progressAvailable flag.

close #2236
2026-09-03 19:14:45 +02:00
edde746 8b1ac156f3 fix(player): drop chapter-derived intro markers longer than three minutes
A movie whose first chapter is titled "Opening Credits" or "Introduction"
got a Skip Intro button that skipped the whole chapter — several minutes
of picture. Detected intros are short; only Plezy's own chapter-title
fallback produced these. Cap chapter-derived intros at three minutes.
Server-supplied markers and credits chapters are unaffected.

close #2235
2026-09-03 18:34:44 +02:00
edde746 be8fa15733 chore: restore pubspec.lock quoting rewritten by pub get 2026-09-03 18:24:41 +02:00
edde746 fa054153ae fix(plex): surface a stale-endpoint failure instead of cascading after a mid-probe promotion 2026-09-03 18:22:13 +02:00
edde746 a230d51598 fix(plex): keep a LAN session on its local endpoint after device sleep
Apple TV (and any suspended process) wakes with dead keep-alive sockets in
the HTTP pool. The first request after resume — the health probe — failed
with a connection error, and the failover cascade treated that as a dead
endpoint: it validated the remote candidate, switched to it, and persisted
it as preferred. Nothing walked the session back to the local endpoint,
because the only re-optimization trigger is a connectivity event and a
same-interface sleep/wake never produces one. Only killing the app fixed it.

FailoverHttpClient now runs the existing candidate trust gate against the
current endpoint on a connection error and retries in place when it answers;
timeouts and 5xx still cascade directly. MultiServerManager gains
reoptimizeDemotedServers, called from the resume probe, which re-races any
online Plex server sitting on a remote or relay endpoint while a local one
is published.

close #2056
2026-09-03 18:13:28 +02:00
edde746 e4f3888694 fix(seerr): seed advanced requests from the Sonarr anime defaults and expose tags
Requesting an anime series with REQUEST_ADVANCED routed it to the standard
Sonarr profile and root folder. The sheet seeded its pickers from
activeProfileId/activeDirectory only, then posted them as explicit overrides,
which beat the anime defaults Seerr would otherwise apply at approval. A user
without the permission sent no overrides and was routed correctly.

The service DTOs now carry activeAnimeProfileId, activeAnimeDirectory,
activeAnimeLanguageProfileId, activeTags, activeAnimeTags and the instance's
tag list. The sheet detects the TMDB anime keyword on the TV details it
already fetches and seeds each picker the way Seerr's web requester does:
the anime value when the series is an anime and the instance configures one,
else the standard value. Options carry the "(Default)" marker and an anime
series shows the same note as the web UI.

Tags are editable: an inline checklist under the advanced pickers, seeded from
the instance's (anime) default tags and posted as `tags`. It is inline rather
than a nested sheet page because the host builds only the top page, so a push
would dispose the sheet and drop the season and picker selections on the way
back.

close #2215
2026-09-03 16:46:27 +02:00
Jan HaiderandGitHub 2087dff32d fix(tvos): eliminate runtime and project build warnings (#2228) 2026-09-03 14:41:16 +02:00
edde746 d112ade601 style(android): space out the annotated and commented libmpv lock declarations
ktlint's spacing-between-declarations-with-annotations and
-with-comments rules failed on android/libmpv/build.gradle.kts, so
scripts/format_native.sh --check - and with it scripts/ci_checks.sh -
reported a failure on an untouched file.

Add the blank line before the @Suppress'd mpvAssets declaration and
before the comment above stagedArchiveName.
2026-09-03 13:12:48 +02:00
edde746 6301d5124e chore(plex): send the JSON Accept header unconditionally
PlexConfig.acceptJson defaulted to true in both constructors and
travelled through copyWith, but no production or test caller ever passed
false, and every Plex path decodes JSON, so the header was conditional on
a flag that could not be off.

Emit `Accept: application/json` directly and drop the field. Headers on
the wire are unchanged.
2026-09-03 13:08:46 +02:00
edde746 13acd41b09 refactor(player): classify player keys with the shared D-pad extension
The video controls' key handling redefined the directional, horizontal
and select key sets privately, duplicating DpadKeyExtension with
identical members; the private select helper then handed the event to
handleOneShotSelect, which classified it again with the canonical
isSelectKey.

Use isDpadDirection, isLeftKey/isRightKey and isSelectKey and delete the
copies.
2026-09-03 13:08:46 +02:00
edde746 0003d95c0a refactor(watch_together): handle created and joined in one branch
The two setup acknowledgements ran the same sequence twice: accept and
validate the response, handle the same two exceptions, install the peer
roster, publish connected state, and complete the setup completer. Only
the log line differed, plus a roster loop that skipped the
already-present check.

One case handles both, using the guarded add so the roster publishes
idempotently for either acknowledgement.
2026-09-03 13:08:46 +02:00
edde746 4d2aa8f9a2 chore(plex): trim LiveTvDvr to the fields Live TV renders
LiveTvDvr parsed 21 DVR fields plus nested Setting and raw Device lists
on every Live TV availability refresh, while the app reads only the key,
the three lineup labels, and the enabled channel mappings. The rest
describe tuner hardware and DVR setup, which Plezy does not implement.

Keep key, lineup, lineupTitle, lineupURL and channelMappings, and
channelKey/enabled on ChannelMapping. The tests keep the root
channel-mapping fallback, malformed-sibling tolerance and flexible
`enabled` parsing.
2026-09-03 13:08:46 +02:00
edde746 deadf712a8 perf(profiles): resolve accounts from the registry watcher payloads
AccountPreferencesController subscribed to watchConnections() and
watchForProfile() and threw both payloads away, then re-read the same two
tables through list() and listForProfile() on every resolve - four
one-shot queries during attach alone, each re-decoding rows and revealing
credentials the watcher had already decoded. The generation counter
discarded stale results but never the queries.

Retain the rows the subscriptions deliver and resolve from them, clearing
the profile rows whenever the watched profile changes so one profile's
rows can never pair with another's. Until both watchers have delivered,
the resolve task parks on that first delivery, so ensureActiveLoaded
still has something to wait for.
2026-09-03 13:08:46 +02:00
edde746 ef91156827 perf(music): observe only the properties the audio-only core needs
The audio-only core reused the video core's property registrations
wholesale, so every music session observed track-list,
demuxer-cache-state, audio-device-list, audio-device, secondary-sid,
seekable, paused-for-cache, volume, speed, aid and sid. libmpv sends an
initial notification plus an event per edge for each one, and three of
them decode structured nodes into track and device models nothing on the
music path reads.

Register time-pos, duration, pause, eof-reached and playlist-pos there;
the video path keeps the full set. Also drop the post-initialization
`gapless-audio` write: every native audio core already sets it before
mpv_initialize, which is where libmpv wants initial configuration.
2026-09-03 13:08:46 +02:00
edde746 42b6710f04 fix(player): stop letting item metadata language override the audio track
The audio ladder still carried a per-item language tier between the
server's selected stream and the account preference. For Jellyfin and
Emby the value mapped to it was `PreferredMetadataLanguage`, which is the
library's metadata-scraping language - it inherits from the parent, the
library options, or the server config and says nothing about playback -
so on any source whose selected/default stream did not map to a native
track it silently picked audio in the scraping language instead of the
user's preferred one. Plex's item-level `audioLanguage` reached the same
tier, after 2dfebf32b and 7ae293631 had already settled that the server
folds every preference level into the stream `selected` flags.

Drop the tier and the plumbing that only fed it:
TrackSelectionPriority.perMedia, MediaItem.audioLanguage and
subtitleLanguage, PlexMetadataDto.audioLanguage/subtitleLanguage/
subtitleMode, and the Jellyfin PreferredMetadataLanguage mapping. The
order is now carried selection, server-selected or default source
stream, account preference, native default. Persisted cache entries
holding the old keys decode unchanged.
2026-09-03 13:08:46 +02:00
edde746 7e583ef05a style(tv): sit the detail track status on the action row's bottom edge 2026-09-03 13:03:25 +02:00
edde746 2132c23fab fix(tv): put the detail track status at the screen edge, not inside the hero column 2026-09-03 13:03:25 +02:00
edde746 c4be378219 fix(detail): make the track status read-only and right-align it
The action row's track status was a button that opened a pre-play
chooser, but on TV the hero describes whichever episode the rail has
focused, and focusing the row hands the hero back to the show, so there
was never a per-episode target for the control to act on. It also sat
inline with the buttons in muted grey, reading as a sixth, low-contrast
action.

The status is now plain text at the row's far end, right-aligned to the
hero's text column, in the hero's own ink, off the focus path. The
chooser sheet, the per-screen choice, and the Play pass-through go with
it, along with the overlay-host and track-tile changes that only served
the chooser.
2026-09-03 13:03:24 +02:00
edde746 f967b9b2f2 feat(detail): preview and choose the audio and subtitle tracks before Play
The detail screen gave no hint of what pressing Play would do with the
file: which audio track and which subtitles the player would start with,
or the picture format. Changing tracks meant starting playback first.

The action row now ends with a status line — picture labels, then the
audio and subtitle rows the player will select — computed by the player's
own selection ladder (TrackSelectionService) over the server's stream
rows, so it agrees with what the player then does. Select opens a
pre-play chooser with the track sheet's two columns; Play and rail
activation pass the pick to the player as its navigation-tier preference,
and a pick carries across episodes by semantics, forced-ness included.
Plex listings carry no stream rows, so a focused episode is probed once,
debounced, and cached for the screen.

Along the way: MediaStream keeps the server's `selected` apart from the
container `default` flag (they were OR'd, so the account's pick was
indistinguishable from the default track); the overlay sheet host no
longer overrides a row that claimed focus itself.
2026-09-03 13:03:13 +02:00
edde746 eafacff3be fix(tv): let the detail hero and rail describe the focused episode once
The TV show detail page spent its hero rows on information that never
changes while browsing episodes (the show's genres, the file's stream
quality) while the rail cards repeated the show name on every card and
pushed the episode title into a truncated subtitle. The Play button also
kept naming the on-deck episode while the hero described the focused one.

Rail cards inside the show now headline the episode title with
`S1 E3 · 23min` as subtitle; genres and quality labels move from the hero
to the details sheet (which now also names the episode and takes the show's
genres explicitly); Play follows the hero's episode and falls back to
on-deck when nothing is focused. The freed rows go back to the logo and the
third description line.

close #2217
2026-09-03 12:57:39 +02:00
edde746 33d845dcdd feat(tv): show the focused episode's title in the detail hero
On the TV detail screen the hero follows the focused episode: its metadata
line and description update, but the episode's own title is nowhere in the
hero. The only copy is the rail card's subtitle, which truncates for most
titles, so the viewer cannot read what they are about to play.

Add a title line between the show logo and the episode metadata line,
reserved in the hero's height budget like the other rows, announced in the
hero's accessibility label, and inside the focusable info block that opens
the details sheet. The hide-spoilers path no longer substitutes the episode
title for a missing summary, since the title line already names it.

close #2217
2026-09-03 12:57:05 +02:00
edde746 0134d9dbc0 fix(tv): tighten the spacing between mpv.conf editor rows
The remove button's default 48px tap target set each row's height, adding
about 12px of dead space around every 36px field on top of the row gap.
Constrain the button to 36px so the field decides the row height, and trim
the field padding and row gap.
2026-09-03 12:01:37 +02:00
edde746 4fd9034e8e feat(tv): edit mpv.conf line by line with the system keyboard on TV
On Android TV the mpv.conf editor used Plezy's own on-screen keyboard
instead of Gboard, and the only way to get a long conf onto a TV was to
retype it key by key (#2232). The system keyboards cannot host the
multiline editor: FireTVIME has no newline key, and both FireTVIME and
Gboard could wipe a pre-filled multiline field on the first keystroke
after the first-show restartInput.

On TV, render one single-line native field per line, with a line-number
gutter, a remove button per row and an Add line button. Rows open their
keyboard on Select only, so D-pad traversal does not raise it. A value
arriving with newlines (a paste from a phone remote) is split into rows
and typing continues on the last one; the rows are keyed so the split
does not rebind another row's input host. The keyboard's action key does
not insert a row: the app never learns which action the IME sent, and
FireTVIME reports Back as `previous`, so an insert-on-action editor kept
opening rows on every Back. Completion hands focus down instead — the
next row, or Add line after the last one.

TvTextInputController gains focusAndOpenTextInput() so a row the app
creates (Add line, paste split) can be typed into without a second
Select; it activates after the focus request lands, since the host's
focus sync deactivates an unfocused field.

Verified on a Google TV box (Gboard, Android 14) and a Fire TV Stick
(FireTVIME): rows keep their text on open, Back closes the keyboard
without side effects, edits persist across leaving the screen. Phone,
desktop and pointer platforms keep the text-area editor.

close #2232
2026-09-03 11:56:03 +02:00
edde746 51beb5ac4b fix(player): leave Plex subtitle auto-selection to the server
Plex Web reads only the `selected` flag PMS stamps on each stream; the
account's autoSelectSubtitle is applied server-side when that flag is
computed. Plezy's Priority 2 already trusts the same flag, but once
playback read AccountPreferences the Plex mode became non-null and could
reach the client-side profile pass whenever there was no media info or no
embedded subtitle streams - forcing subtitles off for Plex's 0 ("manually
selected") or on for 2, over a decision the server had already made.

TrackSelectionService now skips the profile subtitle mode for Plex items;
MediaBrowser keeps it because those servers do not pre-select.
2026-09-03 11:37:12 +02:00
edde746 b43cd81102 chore(profiles): let AccountPreferencesController own the active user's playback preferences
UserProfileProvider kept a second cache of the active user's audio/subtitle
defaults beside AccountPreferencesRepository, re-implemented the active
profile/connection listener wiring and Plex Home token resolution, and for
Plex Home profiles bypassed the shared cache entirely (fetching /user with
its own client), so a write in the Account preferences screen never reached
Home-profile playback.

The controller now resolves the active account (the head of its sorted
account list), loads it through the one repository on attach, on profile
switch, and when the account's token changes, and exposes it as
activePreferences; ensureActiveLoaded replaces initialize() for the startup
gate. Playback, offline waiting, and logout storage clearing read the
controller directly; UserProfileProvider, the per-backend user-profile DTOs,
PlexAuthService.getUserProfile, and JellyfinClient.fetchUserProfile are
deleted.

The ranked defaultAudioLanguages/defaultSubtitleLanguages lists go with
them: Plex Web never reads them, PMS applies them when it stamps `selected`
on streams, and Plezy already trusts that flag ahead of the profile. They
only refined a best-effort audio fallback for Plex items with no media
info, which the primary language covers; on that path a second preferred
language is no longer tried before the file's default track.

Plex Home profiles now read /user/profile with the switched token through
the same cache as local profiles.
2026-09-03 11:36:56 +02:00
edde746 5112d71820 chore(player,cards): share budgeted card realization and scope player subscriptions in bags
The memo-lookup, scroll-budget, skeleton-scheduling sequence was copied
in the paginated grid, the browse tab, and hub rows; SkeletonUpgradeScheduler
now owns it as realizeBudgeted with per-site skeleton and card builders,
keeping the hub's focus salt and padded skeleton.

The video player screen held fourteen nullable subscription fields and
listed them twice when cancelling; they are two lists (player re-wire,
media controls) snapshotted and cleared before cancellation, with the
screen-lifetime Apple TV and sleep-timer subscriptions left as named
fields. Live seek and subtitle switches open through one helper, and the
initial live open applies the shared stream options instead of an
inline property write.
2026-09-03 11:36:29 +02:00
edde746 ab477c971d chore(relay): generate reconnect token size and version predicate from the protocol spec
The 32-byte reconnect token and its 43-character base64url shape were
pinned by hand in both server/main.go and the Dart peer service, and the
supported-version check was spelled out three times in Go. The spec now
carries reconnectTokenBytes and the generator emits the token size,
encoded length, and validator for Dart plus the size and
supportedRelayProtocolVersion for Go, failing before writing either
target when the key is missing. The last handwritten error code in lib/
('not_in_room') uses the generated constant, and releaseSession's
in-flight join is a FutureCoalescer.
2026-09-03 11:36:29 +02:00
edde746 59f44d9ae1 chore(trackers,downloads): share rating request matching and download queue feedback
MDBList and Trakt repeated the rating type, entry matching, and request
body construction; tracker_rating_match.dart now owns them with the
service label passed in. The collection detail screen re-implemented
fetchAndQueueListDownload minus its cellular-blocked branch and now uses
it, and the three showDownloadOptionsAndQueue call sites share
queueDownloadWithFeedback, so the detail action buttons surface a queue
failure as an error snackbar instead of an unhandled async error.
2026-09-03 11:36:29 +02:00
edde746 de39e15e36 chore(sheets): build flat sheets on BottomSheetPageScaffold
Seven sheets hand-rolled the Column(min) + BottomSheetHeader + Flexible
tree that BottomSheetPageScaffold already produces; each now passes its
header arguments to the scaffold. No onBack is supplied, so the widget
tree, height, and focus behaviour are unchanged.
2026-09-03 11:36:29 +02:00
edde746 7b1b0d766b chore: reuse drainPages, SerialFutureQueue, and FutureCoalescer for hand-rolled equivalents
Three MediaBrowser pagination loops re-implemented drainPages; it gains an
onPage hook (fires after intermediate pages only) so the two
progressive-render loops fit as well as the episode queue. Five
handwritten FIFO future tails (companion lifecycle, Seerr persistence,
tracker write lock, companion host-auth commit, Watch Together message
routing) become SerialFutureQueue, and the companion peer service's
disconnect/dispose in-flight joins become FutureCoalescer.
2026-09-03 11:36:29 +02:00
edde746 960adf42f2 perf(downloads): resolve cache scopes once per server and build one deletion plan
Loading the downloads list re-resolved the backend and profile scope for
every row, and the provider's bulk lookup only tried the public key, so
every MediaBrowser leaf fell back to a per-item lookup that resolved the
scope again (twice more for episodes and tracks). Startup was therefore
O(downloads x profile bindings) in database selects.

getAllPinnedMetadata now resolves each distinct server once, covers
queued and in-progress rows too, and returns the scope snapshot beside
the items; hydration tries the exact compound key, then the public key,
then the existing per-item fallback, and reuses the snapshot for parent
rows. findProfileScopeId prefetches bound connections in one select while
keeping binding precedence. A provider test pins the select count as
constant across download count.

Deleting a container also read the row, resolved metadata, and queried
its children twice; deleteDownload now loads them once and threads the
snapshot through the file deletion, keeping the cancel/progress/file/row
order intact.
2026-09-03 11:36:29 +02:00
edde746 d181bd34ae chore(mpv): share desktop startup options and stop forwarding unused Android events
Linux and Windows each wrote the same eleven pre-initialize mpv options
(keep-open, idle, input disabling, OSC, ytdl, audio fallback, and the
audio-only set); ApplyCommonStartupOptions in mpv_player_common.h owns
them once, with the ytdl security rationale kept in one place. Rendering,
windowing, HDR, and log-level options stay per platform.

The Android JNI event thread forwarded every mpv event to Kotlin, where
MpvEvent modelled ten variants but MpvPlayerCore consumes four. The
native switch now forwards only START_FILE, FILE_LOADED, and
PLAYBACK_RESTART (END_FILE keeps its own path), and the unused variants
are gone.
2026-09-03 11:36:29 +02:00
edde746 b27cab4510 build: read Windows libmpv pins from the lock and share the Linux fetch and version parsing
windows/CMakeLists.txt repeated the mpv-build key, asset base, and both
SHA-256 values that mpv-build.lock.json already owns, and the pin mover
never touched it, so a lock bump left Windows silently stale. CMake now
reads artifacts.windows with string(JSON) (floor raised to 3.19) and the
Windows native cache key hashes the lock; a workflow guard rejects
hand-pinned checksums.

The byte-identical Linux libmpv fetch heredoc in build.yml and ci.yml
moves to scripts/fetch_linux_libmpv.py, which verifies the checksum
before extracting and is what the packaging script now points local
builds at. The package-windows and release jobs and
linux/packaging/build-packages.py read the version through
scripts/pubspec_version.py instead of three looser regexes.
2026-09-03 11:36:29 +02:00
edde746 17c877c973 chore(website): share page metadata, model screenshot devices as records, honor reduced motion
Home, privacy, and scan each repeated the same 13 title/canonical/Open
Graph/Twitter tags; PageMetadata now emits them once with route-specific
title, description, url, and an optional noindex. Screenshots keeps one
record per device instead of four parallel arrays plus a lookup table.

FAQ hash jumps and screenshot arrows forced behavior: 'smooth' from JS,
which bypasses the prefers-reduced-motion override in layout.css; both
now defer to CSS scroll-behavior. Removes the unused adapter-auto
dependency.
2026-09-03 11:36:29 +02:00
edde746 1373c299df chore(plex): hydrate Plex Home users at bootstrap through PlexHomeService
ConnectionBootstrap kept a private cache read/fetch/write path for Plex
Home users beside PlexHomeService, which already owns refresh
coalescing, generation checks, durable writes, and publication. The
bootstrap now keeps only the one-time legacy cache migration, then
reloads the service from storage or asks it to refresh, and reads the
hydrated users from the service snapshot. A failed hydration clears the
service's empty cache slot before the migrated account is removed.
2026-09-03 11:36:29 +02:00
edde746 7e84df6385 perf(livetv): rebuild the live timeline once per second instead of per position tick
The timeline bar rendered whole seconds but rebuilt on every ~250ms
position emission, so three of four rebuilds produced identical output.
It now derives a distinct position-seconds stream, the same pattern
ContentStrip uses for its chapter index, and rebinds only when the player
changes; streamStartEpoch changes still apply on the next build.
2026-09-03 11:36:29 +02:00
edde746 e8e67df379 chore(plex): map metadata type codes and fetch detail metadata in one place
The movie/show/season/episode/artist/album/track to 1/2/3/4/8/9/10 table
was repeated in the query translator (forward and inverse), collection
creation, and the metadata-edit adapter; PlexMetadataType now owns
forKind/kindFor and each caller keeps its own unsupported sentinel.

getMetadataWithImagesAndOnDeck and _getMetadataWithImages shared the
endpoint, cache key, query flags, first-row parsing, and library-section
stamping and differed only by includeOnDeck; they are one private typed
fetcher returning (metadata, onDeckEpisode), so fetchItemWithOnDeck no
longer reads a string-keyed dynamic map.
2026-09-03 11:36:29 +02:00
edde746 c70f88cee0 fix(android): transcode mpv strings as standard UTF-8 across JNI
Emoji and other supplementary-plane characters in titles, file names, and
subtitle paths were corrupted on the Android MPV path, and malformed bytes
from mpv logs could abort under CheckJNI. NewStringUTF/GetStringUTFChars
speak JNI's modified UTF-8, not the standard UTF-8 mpv produces and
consumes; the native lead-byte filter and the Kotlin surrogate scrubber
ran on the wrong side of that conversion and could not recover it.

Both directions now go through UTF-16 (NewString/GetStringChars) with a
small JNI-free transcoder that replaces malformed input with U+FFFD, the
same policy as shared/cpp/sanitize_utf8.h on desktop. The header is
covered by the Android host native test harness.
2026-09-03 11:36:29 +02:00
edde746 54efd4fe73 fix(emby): stop leading the transcode codec list with AV1
Capping quality against an Emby server on macOS (or any device with an
AV1 decoder) failed with HTTP 500: Emby takes the first entry of the
TranscodingProfile codec list verbatim and has no AV1 encoder. Jellyfin
rotates admin-disabled codecs to the back, which is what the AV1-first
list relied on. Gate AV1 on that dialect behavior.

close #2230
2026-09-03 08:02:09 +02:00
edde746 deaa06826c fix(player): stop corrupting high-bitrate HEVC at large keyframes on MediaTek Fire TV
High-bitrate HEVC episodes showed smeared frames and green flashes for the
first 10-15 seconds of playback on the Fire TV Stick 4K Max 2nd gen with the
mpv backend, while ExoPlayer played the same file cleanly (#2227). The
reporter's clip failed at exactly two timestamps on every run: the two IDR
frames larger than 1 MiB.

The FFmpeg mediacodec decoder never set "max-input-size" on the codec
format, so OMX.MTK.VIDEO.DECODER.HEVC allocated 1,052,672-byte input buffers
and FFmpeg split any larger packet across several queueInputBuffer calls.
The MediaTek VPU treats each buffer as a complete access unit, rejects the
remainder ("invalid u4BufferAccumulated"), fails the slice and conceals with
lost-picture references until the next IDR. ExoPlayer is unaffected because
media3 sizes HEVC input buffers at max(2 MiB, w*h*3/4) and never splits a
sample.

Move the native pin to edde746/mpv-build@83879375c9, which sizes the
buffers the same way ExoPlayer does for H.264, HEVC, MPEG-4, VP8, VP9 and
AV1 and logs a warning if a packet still does not fit. Verified on the
AFTKRT with the reporter's clip: zero VPU errors and no lost pictures across
repeated runs, and an H.264 file with ~1 MB keyframes still plays on the
MediaTek AVC decoder; both files also play on a Pixel 7 (Exynos C2). Apple,
Linux and Windows assets are unchanged (their content keys did not move).

close #2227
2026-09-03 07:47:58 +02:00
edde746 d371bfed3a fix(networking): connect in resolver address order with a Happy Eyeballs race
On a dual-stack network Plezy pinned API traffic and the notification
websocket to IPv4 while the native Plex apps and the media stream used
IPv6. dart:io looks up A before AAAA and connects in arrival order, so
the AAAA address was never tried when the IPv4 path answered within
250 ms.

Install an HttpClient.connectionFactory that does one lookup (keeping
the resolver's RFC 6724 order), interleaves families per RFC 8305 and
races candidates 250 ms apart. The task is returned before the lookup
starts so connectionTimeout and cancel cover resolution. TLS is done in
the factory since the SDK skips it once one is installed; proxied
requests stay plain. The library-event and companion-remote websockets
get the same client because WebSocket.connect otherwise builds its own.

Supersedes #2233.
2026-09-03 07:35:34 +02:00
edde746 aeb06c2c9e fix(audio): smooth the passthrough audio clock on the mpv Android backend
Playing lossless passthrough audio (TrueHD, DTS-HD MA) on an Nvidia Shield
running Android 9 dropped a video frame every ten to twenty seconds with the
mpv backend, while lossy passthrough and PCM were unaffected and A/V sync
never moved (#2202).

IEC 61937 and raw passthrough tracks in ao_audiotrack never use
AudioTimestamp; their clock is AudioTrack.getPlaybackHeadPosition() taken at
face value, which on a direct track is the HAL's render position and
advances in HAL-period steps - 8192 frames at 192 kHz (42.7 ms) for the HBR
output on the Shield, longer than a 24p frame. The AO thread samples it once
per chunk and feeds it straight into the end time mpv schedules video
against, so a forward snap larger than a frame's remaining lead makes mpv
drop that frame; lossy passthrough runs at 48 kHz where the period stays
below a frame.

Move the native pin to edde746/mpv-build@af74e1906e, which estimates the
passthrough position the way media3 does: a ten-sample average of
(head - clock) offsets taken at least 30 ms apart, so a period-sized step is
spread over the window instead of landing on one frame. PCM tracks keep
their AudioTimestamp path. Apple, Linux and Windows assets are unchanged
(their content keys did not move).
2026-09-03 05:35:03 +02:00
edde746 9a9b89082b fix(home): apply the grid spacing setting to hub rows
Grid Spacing (Settings > Appearance) only changed the library grid. The
home, explore, detail and library-recommended rows were byte-identical
across Tight/Normal/Spacious because #2083 deliberately opted hub-row
cell packing out of the setting and hard-coded a 2px pad per card, and
the TV home rail never read the setting at all.

Treat a hub row as one row of the grid. MediaGridDelegate.cellWidth
packs row cells with the same gutter MediaGridGeometry uses, so a row
and the "see all" grid behind it render the same card at every setting.
HubSection renders max(4, gap) between cards - Tight keeps its historical
4px so nothing moves on update, Normal/Spacious render the grid's 6/12px
gutter - and feeds the same gap into its D-pad item extent and card memo
epoch. TvBrowseRail threads GridSpacing through metricsForHub,
maxActiveRailHeight and estimateHeight; non-full-card rails use the
setting scaled with the rest of the rail metrics, full-card rails keep
their own scale-derived gutter like full-bleed grids. The spotlight and
detail rail height reservations pass the setting too so reserved
heights track the narrower cards. Both surfaces watch the pref, so rows
re-lay out live.

close #2226
2026-09-02 22:38:11 +02:00
edde746 c79ff68a7b perf(tv): shape spotlight text once per swap instead of twice
Every D-pad step on the TV home ends with a spotlight swap, and on a
low-end box that frame ran over budget: 12 % of UI-thread CPU during
navigation was paragraph layout, most of it shaping strings a second time
to measure them before the render tree shaped them for real.

- FittingTitleText no longer lays the title out to learn whether it fits:
  Text wraps and ellipsizes at maxLines, so the box can only overflow
  vertically, and one cached one-glyph line height settles that. Only a
  box shorter than maxLines lines still searches, now bracketed by the
  proportional shrink of the base layout and stopped at a 0.25 px
  tolerance instead of a fixed 12 bisections.
- FittedMetadataLine and inlineRatingBadgeWidth measure through a small
  bounded cache keyed by text, style, scaler and direction, so separators,
  type labels, certifications, runtimes and years measure once per
  session.
- MediaHub.isContinueWatchingHub/usesContinueWatchingAction memoize their
  regex tokenisation per key; every card build and step re-asked them.

Cold navigation on the Android 14 box (30 steps over three hubs): build
312-316 ms -> 284-285 ms, layout 530-540 ms -> 515 ms, UI frame p90
7.5-7.9 ms -> 6.8-7.2 ms.
2026-09-02 22:38:11 +02:00
edde746 7e1f18f93f perf(android): skip the semantics tree when no enabled accessibility service can read it
Android enables Flutter semantics for any bound accessibility service, so a
TV running the Projectivy Launcher (whose service only wants foreground-app
events) paid for a full semantics tree on every frame that touched a node:
on an Android 14 box, 2 ms per frame, ~20 ms on each spotlight swap, and a
third of the navigation-time GC churn.

The Android side now reports whether any enabled service can consume the
tree (touch exploration, an accessibility tool, or spoken/braille/audible/
visual feedback; an empty list means UiAutomation, which reads it too), and
AssistiveTechnologyService closes a SemanticsTreeGate on the app binding
when none can. The gate sits under SemanticsBinding.semanticsEnabled, so the
pipeline owner drops the semantics owner exactly as if the platform had
turned accessibility off; explicit ensureSemantics clients (the debug handle
for Maestro) always win. Re-evaluated on platform toggles, service-list
changes (API 33+) and resume.

Cold navigation on the box with Projectivy's service bound, 30 D-pad steps
over three hubs: SEMANTICS phase 700-770 ms -> 0, UI frame max 31-37 ms ->
25 ms, GC 3.0 s -> 2.2-2.6 s.
2026-09-02 22:38:11 +02:00
edde746 5bd742c8b8 fix(tv): glide D-pad row and hub scrolls in 150ms on Android TV instead of 500ms
D-pad navigation on Android TV felt sluggish next to Projectivy and the
Fire TV launcher: every step of the home rail and hub rows trailed the
focus border in a 500ms ease-out, and hub moves deferred the vertical
glide by a frame. The 500ms was measured from the tvOS focus engine
(f357be407) and applied to every platform; Leanback prices a one-card
step at roughly 100-150ms, so the same glide reads as input lag on a
D-pad.

FocusTheme.navigationScrollDuration now vends the per-platform value:
Apple TV keeps the measured 500ms, everything else glides in 150ms.
TvBrowseRail and HubSection use it for row and hub-list scrolls, and a
hub move starts the vertical animation in the same frame when the
build-time section offsets are already known.

Measured with screen recordings on a Shield TV (2019) and a Fire TV
Stick 4K Max: row motion per press 470-510ms before, 135-150ms after;
hub move 480ms before, 120-150ms after.
2026-09-02 22:38:11 +02:00
Jan HaiderandGitHub 5c37c72a08 fix(tvos): adopt UIScene lifecycle for Xcode 27 (#2225) 2026-09-02 22:16:11 +02:00
edde746 22c1ad56d3 fix(player): play Dolby Vision profile 7 and DV+HDR10+ files on MediaTek Fire TV devices
Dolby Vision profile 7 titles (UHD Blu-ray remuxes, typically TrueHD or
DTS-HD MA) never showed a frame on the Fire TV Stick 4K Max 2nd gen with the
mpv backend: the spinner stayed forever while audio came up. Profile 8.1
titles carrying HDR10+ on the same device went fully black, controls
included, with audio playing.

Both are the FFmpeg mediacodec DV packet filter. It emitted every rewritten
access unit with a five-byte "00 00 00 00 01" start code - the leading zero
was copied once as head bytes and again as part of the first NAL region -
and MediaTek's VPU rejects such units ("H265_decode invalid NALU"), so the
profile 7 conversion and strip paths both produced nothing. And the filter
never dropped in-band HDR10+ SEI, which these chipsets cannot take next to
the RPU on the native DV decoder (#1296 on the ExoPlayer path).

Move the native pin to edde746/mpv-build@0ad6388c, which counts that zero
once and strips the ST 2094-40 SEI whenever a video/dolby-vision decoder is
selected. Verified on an AFTKRT with the published armeabi-v7a asset: a
P7.6 remux sample decodes on both the HEVC (strip) and DVHE.STH (convert)
paths with no VPU errors, and a P8.1 + HDR10+ remux plays on the DV decoder
with a single output-format change. Apple, Linux and Windows assets are
unchanged (their content keys did not move).

close #2176
2026-09-02 20:59:02 +02:00
edde746 3b3a816de0 fix(player): deinterlace software-decoded video on Android and Linux
Enabling Deinterlacing had no effect on Android and Android TV for
interlaced MPEG-2 (and any other software-decoded stream): mpv asks
libavfilter for bwdif, and the pinned Android and Linux FFmpeg builds were
configured with --disable-filters, so the request failed with
"filter 'bwdif' not found" and the frame passed through combed. Windows
and Apple ship FFmpeg with the filter, which is why the same file
deinterlaced on Windows.

Move the native pin to edde746/mpv-build@9bfbcd69, which builds bwdif into
the Android and Linux FFmpeg. Apple and Windows assets are unchanged
(content-addressed keys did not move). Verified on a Shield TV Pro with the
published arm64 asset: 480i MPEG-2 now deinterlaces cleanly.

close #2224
2026-09-02 20:05:38 +02:00
edde746 3fc229cd6c fix(android): tell external players to start unwatched items from the beginning
With an external player on Plex, starting a never-watched episode could
open a "resume playback?" prompt at the position the previous, unrelated
file was exited. The intent carried no start hint when the item had no
resume point, so players with their own bookmark store (Zidoo native
player, VLC) consulted it - and every Plex part URL ends in the same
`file.<ext>`, so those bookmarks collide across items.

Send `from_start=true` on fresh launches and `from_start=false` beside
`position` when resuming, matching the Zidoo integrations in
jellyfin-androidtv-zidoo and PlexToZidoo. MX, Just Player and mpv ignore
the extra.

close #2223
2026-09-02 15:43:04 +02:00
edde746 b5186624b8 fix(android): output 5.1 PCM at 44.1 kHz on the mpv backend instead of downmixing to stereo
AAC/AC3/EAC3 5.1 tracks at 44.1 kHz played as stereo through mpv on Android:
ao_audiotrack sized its buffer as 75 ms aligned to the sample size, which at
44.1 kHz is not a whole number of 6-channel frames, so AudioTrack refused it
("Invalid audio buffer size") and mpv fell back to the stereo-only OpenSL ES
output. 48 kHz sources (DTS, or audio-samplerate=48000) happened to align.

Pin mpv-build 1779135, which frame-aligns the audiotrack PCM buffer
(edde746/mpv-build@d89cfbb). Only the Android libmpv key moves.

close #1445
2026-09-02 14:16:20 +02:00
edde746 0c809491c7 fix(watch-together): declare rate changes to the room and stop the host clock during its own stalls
Rooms drifted in speed and kept pausing on poor links. A 2x long-press or a
speed pick on any peer propagated with no attribution, so it read as the app
changing speed on its own; a host whose cache starved let mpv resume its player
on its own timetable while the room waited, so every recovery re-anchored ahead
of the guests and they hard-seeked in a loop; and a wall-clock step on a guest
made every host anchor read stale and seeked the file by the size of the step.

Rate intent is now declared by the screen (speed sheet, keyboard, long-press,
media controls) through WatchTogetherProvider.onLocalRate instead of being
inferred from the player's rate stream, matching how seeks already work. The
expectation ledger no longer tracks rate at all, so a nudge, a default-speed
apply or a late ack can never become a room rate change, and a promoted host
adopts the room rate rather than its player's momentary one. Remote rate
changes surface as "<name> set the speed to <rate>".

The host pauses its own player when it stalls, anchors the room there, raises
mpv's cache-pause-wait to 4s, and holds the resume until it has buffered three
times the stall it just had. Heartbeats during a sub-grace blip keep
extrapolating the previous anchor instead of re-anchoring on a frozen position.

The sync layer's clock is monotonic. ClockSync discards its window when a
sample's offset moves further than the round trips involved can explain, and a
guest that receives an anchor reading implausibly old holds corrections and
re-converges instead of seeking.
2026-09-02 12:31:27 +02:00
edde746 5860079b43 fix(plex): include personal media libraries in search results
Searching for items in a Plex "Other Videos"/home-video library returned
nothing, while the same query worked in Plex Web. `/library/search` with
`searchTypes=movies,tv,music` skips libraries on the Personal Media agent;
they only answer to the `otherVideos` category.

Add `otherVideos` to the search request and treat personal-media rows
(`*.agents.none://` guids) as their own category when a saturated response
is supplemented, so a large movie library cannot starve home videos and
vice versa.

close #2216
2026-09-02 11:31:47 +02:00
edde746andClaude Fable 5.1 ce03857588 fix(seerr): take permissions from /auth/me, not the partial login body
A local Seerr account with request rights could sign in to Plezy but never
saw the Request action. POST /auth/local loads only the columns it needs to
check the password, so the entity it returns carries the class default
permissions of 0 (and the email as display name); the session stored that
snapshot and the detail screen gated Request on it.

Sign-in now ignores the login body and reads the user back through
GET /auth/me with the fresh cookie, for every method. SeerrUser.permissions
is required, so a user without a mask fails sign-in instead of persisting 0.

Two related gaps kept an affected session broken until a manual reconnect:

- Seerr answers an expired session with 403, never 401, so the silent
  re-auth never ran. A 403 now re-auths once GET /auth/me confirms the
  cookie is dead; a 403 from a live session stays a permission denial so a
  Quick Connect session is not unlinked over one.
- Nothing refreshed a stored session's permissions. The account provider
  now re-reads the user on bind, so sessions persisted with 0 by earlier
  builds, and admin-side permission changes, reach the Request action on
  the next launch.

close #2213

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 11:31:47 +02:00
edde746 200d896bea build: switch every platform's libmpv supply chain to the unified mpv-build repo
Plezy consumed mpv through four unrelated supply chains: an MPVKit fork
via SwiftPM for the Apple platforms, a libmpv-android fork's AAR for
Android, an in-CI from-source build for Linux, and an unpinned
sourceforge mpv-dev 7z for Windows. All four now consume the same
per-commit, content-addressed binaries from
https://github.com/edde746/mpv-build, pinned to one commit and built
from one set of pinned sources (mpv v0.41.0 on Apple/Android/Windows,
ffmpeg n8.0.1, our libass fork).

- Apple: the SwiftPM package moves from edde746/MPVKit to
  edde746/mpv-build across the ios/macos/tvos projects;
  scripts/set_mpvkit_revision.sh becomes set_native_revision.sh, writes
  every pin site plus the new repo-root mpv-build.lock.json, and
  tvos/scripts/wire_mpv.rb derives the package repo from the locks.
- Android: the mpv Kotlin API and JNI glue move in-app under
  android/libmpv (repackaged com.edde746.plezy.libmpv, exports renamed,
  shrinker rules covered), and the module downloads per-ABI native
  tarballs (lib/*.so incl. libc++_shared.so + include/) driven entirely
  by mpv-build.lock.json, with a PLEZY_LOCAL_MPV_DIR escape hatch for
  locally built artifacts. The fork AAR and its Maven coordinates are
  gone.
- Linux: CI downloads the prebuilt self-relocating libmpv prefix
  (lock-driven, sha256-verified) instead of compiling mpv/ffmpeg/dav1d/
  libplacebo/shaderc from source; linux/packaging/build-libmpv.sh and
  its test are deleted and native-inputs.json shrinks to the simdutf
  entry the CMake builds still fetch.
- Windows: both arches FetchContent the mpv-build dev zips with
  URL_HASH enforcement, replacing the checksum-less sourceforge
  download and its ARM64 7-Zip special case; guard scripts updated.

The lock plus the Apple pin sites all point at mpv-build commit
d7c3d559, whose manifest was verified asset-by-asset against the
published release digests (17/17 match). Verified locally: wire and
pin-script suites green, runtime-input checks green, all four Android
ABI tarballs downloaded/verified/extracted through the real Gradle
tasks, the Windows FetchContent block exercised end to end through
cmake, the Linux asset hash and layout checked against the workflow
contract, and xcodebuild resolved the flipped SwiftPM graph with
SwiftPM validating every binary checksum.
2026-09-02 11:31:47 +02:00
edde746 8fe7e4bcfd fix(logs): render log entries lazily to stop OOM kills on the logs screen
Opening View Logs with a full 5 MiB buffer laid out the entire log as one
paragraph, freezing the frame for tens of seconds and using ~1 GB of glyph
data — the OS killed the app on low-memory phones and TVs (watchdog/OOM).

Render one Text.rich per entry in a SliverList.builder so only the visible
slice is laid out, keeping selection through a SelectionArea. Also cap the
copy-to-clipboard payload at 256 KiB (newest lines kept) to stay under
Android's ~1 MiB binder transaction limit.
2026-09-02 11:31:47 +02:00
edde746 d2b5039bb3 fix(explore): stop d-pad on detail prose instead of skipping to the next button
On TV, pressing down on the Explore detail screen jumped straight from the
action bar to the next focusable button, scrolling the description and
background prose past unread. The overview and background sections are now
collapsible focus stops wired into the d-pad chain in both directions, so a
viewer can stop, read, and expand them before moving on.

close #2199
2026-09-02 11:31:46 +02:00
edde746 12b8c7e7ef fix(windows): log tone-map input churn on Adreno for #2191 diagnosis
4K HDR->SDR playback on Windows-on-ARM stutters and flickers because libplacebo regenerates its tone-map and gamut-map LUTs on every drawn frame. The two earlier workarounds targeted peak detection and HDR10+ metadata, but both regenerating LUTs log at info level, which libplacebo only does for non-dynamic LUTs, so something else is moving the LUT keys. The same libmpv build on a Snapdragon X Elite CRD (Adreno X1-85, driver 31.0.160.0) shows no churn at all, so the trigger is specific to the reporter's machine.

Add an HdrProbe to the Windows runner that polls the two LUT inputs every 250 ms - mpv's video-target-params (destination colour space, derived per frame from DXGI_OUTPUT_DESC1 and the DisplayConfig SDR white level) and video-out-params (source HDR metadata) - plus the raw DXGI output description, SDR white level and factory IsCurrent() state once a second, and reports every change and a 10 s summary into the app log as hdr-probe lines. Change streams are rate limited so an uploaded log stays within the relay's 1 MiB.
2026-09-02 03:59:26 +02:00
edde746 e9988165df style: run the repo formatters over the Dart and Kotlin stragglers
CI's formatting jobs were red on main: dart format wanted
media_card_grid_spacing_test.dart collapsed, and ktlint wanted three
Kotlin expression bodies on their signature line plus one import moved
into lexicographic order.

Pure formatter output from `dart format` and `scripts/format_native.sh
--fix`; no behavior change.
2026-09-01 16:21:07 +02:00
edde746 582d419618 fix(libraries): keep a sidebar library selection that mounts the Libraries tab
Choosing a hidden library from the sidebar on a fresh launch opened the
topmost visible library instead, and reordering the sidebar changed which
wrong library appeared. A second attempt worked.

The first visit to the Libraries tab mounts LibrariesScreen, and two
post-frame callbacks then run in registration order: MainScreen's, which
applies the requested library, and the one initState registers during that
frame's build, which picks the saved or topmost-visible default. The second
one overwrote the first — and a hidden library can be neither default, so
the selection was always lost.

Initialization now treats an existing selection as authoritative, both on
entry and after each of its awaits, so a selection arriving while it is
suspended (the refresh() stale-resume path) also survives.

close #2207
2026-09-01 16:11:09 +02:00
edde746 72d15b96a2 fix(linux): spell the maybe_unused attribute on the plugin keepalive globals
The Linux build stopped compiling everywhere: d9e31fd1a wrote the
attribute as [[maybe unused]], with a space instead of an underscore.
An attribute-list is comma-separated, so two bare identifiers are a
parse error rather than an ignorable unknown attribute, and
linux/runner/mpv/mpv_plugin.cc reaches every Linux build.

Use [[maybe_unused]], which is what clang 23's -Wunused-but-set-global
actually checks for, so the diagnostic the original change was chasing
stays suppressed.
2026-09-01 16:01:55 +02:00
K1ngfish3randGitHub d9e31fd1a4 fix for llvm23 (#2212) 2026-09-01 15:38:21 +02:00
edde746 23f9afa5b1 fix(windows): strip HDR10+ metadata from the Adreno tone-map path
Disabling peak detection (efb0e885) did not stop the per-frame shader LUT regeneration on Snapdragon devices: libplacebo keys the tone-map LUT on the frame's raw HDR metadata, and mpv forwards HDR10+ per-scene values (scene_max, scene_avg, ootf) on every decoded frame, so the LUT - at tens of milliseconds per rebuild on Qualcomm's D3D11 driver - still regenerated continuously and playback kept stuttering and flickering (#2191).

Zero the dynamic metadata before the renderer with vf=format:hdr10plus=no on Qualcomm GPUs; tone mapping uses the static HDR10 mastering metadata and the LUT is generated once. Dolby Vision L1 metadata is deliberately not stripped: dovi=no would break profile-5 rendering. The applied HDR pipeline options are now reported into the app log on first file load so uploaded logs are self-diagnosing.
2026-09-01 09:02:59 +02:00
edde746 efb0e885ae fix(windows): disable dynamic HDR peak detection on Qualcomm GPUs
Playing HDR content tone-mapped to an SDR display on Windows-on-ARM stutters heavily and flickers in brightness: dynamic peak detection moves the tone-mapping parameters every frame, libplacebo regenerates its tone-map and gamut-map shader LUTs each time, and Qualcomm's Adreno D3D11 driver takes tens of milliseconds per regeneration - roughly 100 ms of work against a 42 ms frame budget at 24 fps.

Scan the DXGI adapter list for a Qualcomm vendor id and set hdr-compute-peak=no when one is present, keeping auto elsewhere; static metadata-driven tone mapping generates its LUTs once.

close #2191
2026-09-01 07:37:10 +02:00
edde746 5fb4c78385 fix(jellyfin): restore Live TV on ts-only tuners and honor the quality preset
Since 2.18.0 no Jellyfin Live TV channel plays: opening one fails with
"Could not start the live channel", and switching channel inside the player
does nothing at all. Negotiating video transcodes as fMP4 (#2131) left the
device profile with no MPEG-TS entry, and Jellyfin discards every non-ts
transcoding profile for a live source whose tuner sets
UseMostCompatibleTranscodingProfile - hardcoded for every HDHomeRun host, the
default for M3U ones - so the negotiation came back with no HLS URL at all.

The device profile now sends a ts profile alongside the fMP4 one, listed
second, the way jellyfin-web does. Both of its codec lists are strict subsets
of the fMP4 entry's and the server ranks profiles with a stable sort, so ts
can only win where fMP4 has been filtered out; VOD keeps negotiating fMP4.
flac and truehd are absent because TS cannot carry them, av1 because that is
the gap fMP4 exists to fill.

Live TV also stops being unconditionally transcode-only. It now reads the same
saved quality preset the library path does: Original asks for direct play and
sends no bitrate ceiling, so a channel the server can hand over untouched no
longer costs a GPU encode session per viewer, and a capped preset transcodes at
that ceiling. A direct-play session whose stream dies re-negotiates a forced
transcode instead of re-opening a URL the server will not serve.

Two smaller holes on the same path: a negotiation that bailed out left the live
stream AutoOpenLiveStream had already opened running, because no playback
session existed to ever stop-report it - a few failed tunes could saturate a
provider's connection budget - and a channel switch that failed to start showed
no message at all.

close #2198
2026-08-31 19:23:22 +02:00
edde746 5a666fd10f feat(discover): refresh home and library content from server library push events
New media added server-side was invisible while the app was open - the
client had no channel for library-change notifications, so the home
screen and library tabs sat stale until an app restart.

Each online server now runs a reconnecting websocket push channel
(Plex `/:/websockets/notifications`; Jellyfin/Emby `/socket` with the
dialect deltas, including Emby's capabilities registration), owned per
server by a LibraryEventService supervisor that follows server
online/offline/replaced-client transitions and app lifecycle. Channels
emit one coalesced LibraryChangeEvent per burst on a leading-edge
throttle modeled on Plex Web's repopulate pacing: the first settled
change surfaces immediately and a library scan's flood merges behind
it. Connection failure degrades silently to the stale-refresh paths -
bounded reconnect backoff, re-armed on every status sync.

Consumers pace their reaction through one shared RefreshPacer: burst
debounce, blocked retry while video playback or an active scroll owns
the surface, a cooldown bounding pass frequency during bulk imports,
and credit for committed pull passes so a push landing right after a
fresh load defers to the cooldown's trailing edge.

- Discover runs a debounced full pass and swaps the result in place;
  the hero carousel resets only when a pass lands first content, so a
  push never yanks a screen the user is reading. Pushed removals drop
  from every visible list immediately via the deletion bus, scoped to
  the emitting server.
- The visible library tab swaps its data in place: transaction tabs
  reload without clearing, and the browse and paginated card grids
  refetch their loaded span (Plex Web's repopulateRange) with the
  scroll offset anchored on the first visible item and the span
  clamped after alpha jumps. Hidden tabs - and tabs behind another
  main tab - mark per-library staleness epochs instead and reload when
  next shown; epochs are snapshotted at load start so a push racing an
  in-flight fetch stays stale.
- The stale-resume and tab-shown paths refetch home hubs (previously
  Continue Watching only), covering setups where the socket cannot
  connect.

close #1646
2026-08-31 18:52:03 +02:00
edde746 56312a9eb2 fix(ui): keep clear logos with significant color untouched on heroes
Remapping a mark whose color is part of its identity - a red-outline
wordmark with white fill, a colored badge - fixes legibility but changes
the logo's character, which reads worse on hero surfaces than the
partial invisibility it cures.

The light tone class now splits on measured colored-pixel fraction:
light-dominant marks with incidental color (<=15% saturated pixels,
lightAccented) always remap, while lightMixed marks remap only when the
new ToneMappedLogoImage.remapMixed policy allows it. Heroes pass false
on the network, offline, and TV spotlight logo paths; the Live TV
guide's channel cells keep remapping mixed marks. The policy joins the
image-cache key. The threshold comes from a real clear-logo set:
remap-friendly marks measured at <=0.11 colored, identity-colored marks
at >=0.28.
2026-08-31 18:51:46 +02:00
edde746 976bdbd021 fix(ui): keep hero titles and clear logos legible in light theme
On the light theme, the detail hero's fallback title was hard-coded
white over a scrim that washes artwork toward the near-white background,
and white-on-transparent clear logos vanished into the same wash on the
detail, home, and TV spotlight heroes.

The title fallback now defaults to the theme foreground with a
background-side halo, matching what the TV hero already did. Clear logos
run through the channel-logo tone remap: light-toned marks recolor
toward the theme foreground on light backdrops (network and downloaded
artwork alike), colored marks keep their pixels, and dark themes render
the original artwork. The backdrop-luminance gate is shared with the
Live TV guide as logoToneTargetFor.
2026-08-31 18:51:46 +02:00
edde746 274b31ebac fix(livetv): recolor light channel logos for legibility in light theme
White-on-transparent broadcast logos (CBS, FOX, the NBC wordmark) vanish
on the light theme's white guide cards, making channels hard to identify.

Channel logo decodes now classify the frame's tone once per image-cache
entry and bake light-neutral pixels toward the theme foreground:
monochrome white marks recolor fully, mixed marks (colored peacock plus
white wordmark) keep their colored pixels, and self-backed or dark
artwork decodes unchanged. Applied in the guide channel column, guide
search, and favorite reordering whenever the backdrop is light,
including the dark theme's inverted focus card; dark backdrops keep the
original artwork.

close #2197
2026-08-31 18:51:46 +02:00
edde746 e1ef52aba1 fix(android): fall back to software decoding for non-Main-profile AV1
4:4:4 (High profile) AV1 played as green or black video on Android TV
devices with AV1 hardware decoders: MediaCodec defines no profile
constants beyond Main, but decoders like the Fire Stick 4K Max (MTK)
and Amlogic C2 accept the stream at configure time and emit garbage or
nothing, so no error ever reached the player and no fallback ran.

libmpv v1.2.2 carries an FFmpeg patch that reads seq_profile from the
bitstream at av1_mediacodec init and refuses High/Professional streams,
letting mpv's hwdec probing fall through to dav1d software decoding.
Main-profile AV1 keeps hardware decoding.

close #2194
2026-08-31 13:29:13 +02:00
edde746 9db6f54b7a feat(plex): make the covered-source direct play optional
A quality preset the source already fits under direct plays the file
since #2152, but a transcode above the source bitrate is sometimes the
point: a device that cannot decode the source (10-bit H.264, AV1, 4:4:4)
wants the server's highest-quality encode, and the shortcut silently
handed it the very file it cannot play smoothly.

A new Quality switch, "Play Smaller Videos at Original Quality" (on by
default), gates the shortcut in PlexClient._presetNeedsTranscode; off
restores the pre-#2152 behavior where any non-original preset always
transcodes. Plex-only by design: MediaBrowser servers make the
equivalent direct-play-vs-transcode call server-side.

close #2193
2026-08-31 11:32:07 +02:00
edde746 39ee089212 fix(audio): reload the mpv audio output when the HDMI route changes
TrueHD/Atmos passthrough with Frame Rate Matching enabled never engaged
the receiver on the mpv backend (Ugoos SK1 -> Denon AVR): the display
mode switch settles 2 s before the audio output opens, but some HDMI
chains are still renegotiating audio then, so the IEC 61937 track binds
a half-negotiated route and the sink never locks onto the MAT
bitstream - for the whole session. The same file with Frame Rate
Matching off, or on ExoPlayer, engages Atmos immediately: media3
rebuilds its sink when the audio device set changes, while mpv's
ao_audiotrack never revisited a track once created.

libmpv v1.2.1 polls AudioTrack.getRoutedDevice from the AO thread and
reloads the AO when the route changes - or vanishes and rebinds - under
a live IEC or raw passthrough track, reopening it against the settled
route. PCM tracks are exempt, and audiotrack-route-reload=no is the
escape hatch.

close #2190
2026-08-31 10:05:08 +02:00
edde746 89d54d8f1d feat(watch-together): let the host hand the room to another participant
close #2183

Reusing a room means whoever enters first becomes the host, and moving the
session to someone else's library meant everyone leaving and re-entering in
the right order. The host can now promote any connected guest from the
participant list (Watch Together screen and the in-player session sheet),
with playback, control mode, and reconnect identities carried across.

The relay owns the swap: a new `transferHost` message validates the sender
is the live host and the target a connected modern-protocol guest, then
swaps `HostPeerID` and the reconnect verifiers (each peer keeps its own
token), persists the room, and broadcasts `hostChanged` to every peer.

Clients flip roles in place: the controller swaps its role engine while
keeping the session, message queue, and player attachment. A promoted guest
seeds the coordinator with the room's last known intent (a paused room
stays paused) and the known-peer roster so the fresh epoch re-gates
instead of solo-starting; a demoted host falls back to a reconciler with a
fresh clock sync and asks the new authority for state. Guests re-pin the
host identity, reset their sequence, and re-converge their clocks.

A rejected transfer (`not_host` / `peer_not_found`) surfaces as a toast
instead of tearing the session down. Pre-transfer app builds in the room
ignore `hostChanged` and stop following the room at the next transfer;
targets on an old sync protocol are not offered the action.
2026-08-31 08:55:45 +02:00
edde746 44773fd742 feat(player): remember the swipe brightness level between playbacks
The brightness set with the left-edge swipe was lost the moment playback
ended, so every session started back at the system level. A new
"Remember Brightness Level" toggle under Settings > Playback > Gestures
persists the level a swipe settles on and reapplies it when the next
playback starts (and when the app resumes mid-session). Leaving the
player still restores the pre-playback brightness, so the rest of the
app is unaffected. Default off, preserving current behavior.

close #2178
2026-08-31 06:43:47 +02:00
edde746 4f4a7338e0 fix(search): tighten spacing around the kind filter chip strip
The chip strip sat 24px below the search field and 24px above the first
result. Drop the strip's own top padding (the field's bottom padding
already provides 16px) and halve the results sliver's top padding when
the strip is shown, so both gaps read as an even 16px.
2026-08-31 06:01:48 +02:00
edde746 10f9139ac6 fix(audio): bitstream Dolby/DTS as raw tracks on the mpv path
Audio Passthrough on 2.18.0 played EAC3 silently on a Shield in front of
a Dolby-Digital-only receiver: mpv's IEC 61937 AudioTrack bypasses the
platform's Dolby transcoder, so the pre-packed DD+ bitstream reached a
sink that cannot decode it, drained at full rate, and no failure was
observable app-side. Disabling passthrough lost surround instead, because
multichannel PCM collapses to stereo in the platform mixer before the
HDMI re-encode.

libmpv v1.2.0 unwraps the IEC bursts and feeds AC3, E-AC3 and the DTS
core to a raw ENCODING_AC3/E_AC3/DTS track - the transport ExoPlayer and
Kodi use - keeping the platform decoder/transcoder in the path, with the
IEC track as fallback and audiotrack-raw-passthrough=no as an escape
hatch. TrueHD and DTS-HD MA stay on the 8-channel IEC carrier.

The audio-spdif route probe now accepts a codec when the route takes its
raw track (the same direct-playback tiering media3 uses; encoding-only
below API 29) or one of the IEC shapes, matching the AO's transport
ladder. A dev-only PLEZY_LOCAL_MPV_AAR override allows testing locally
built fork AARs before a release is pinned.

close #2177
close #2179
2026-08-30 19:22:14 +02:00
edde746 3c1ab3cc6c fix(windows): bundle the Vulkan loader so libmpv's vulkan-1.dll import resolves
Since the libmpv bump to 20260809 (2.15.0), libmpv-2.dll dynamically links
the Khronos Vulkan loader instead of statically linking it. plezy.exe links
libmpv at load time, so on machines whose GPU driver does not install
vulkan-1.dll - Windows-on-ARM Adreno drivers, driverless x64 VMs - the
process failed before startup with "vulkan-1.dll was not found".

Download the LunarG-built loader (pinned, hash-verified) at configure time
and install it next to the executable with its license. Without a Vulkan
ICD the gpu-api=auto probe fails cleanly and falls back to D3D11, matching
the old static-loader behavior.

close #2110
2026-08-30 12:16:26 +02:00
github-actions[bot] c597390e1c chore: update cask to 2.18.0 2026-08-30 08:39:52 +00:00
400 changed files with 23703 additions and 5149 deletions
+24 -19
View File
@@ -414,9 +414,7 @@ jobs:
- arch: arm64
runner: windows-11-arm
flutter_setup: git
native_cache_path: |
build/windows/arm64/_deps
build/windows/arm64/mpv-dev-arm64
native_cache_path: build/windows/arm64/_deps
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
@@ -427,12 +425,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ${{ matrix.native_cache_path }}
key: ${{ env.TRUSTED_BUILD_CACHE_VERSION }}-windows-native-${{ matrix.arch }}-${{ hashFiles('windows/CMakeLists.txt') }}
- name: Install 7-Zip
if: matrix.arch == 'arm64' && steps.windows-native-cache.outputs.cache-hit != 'true'
shell: pwsh
run: choco install 7zip -y
key: ${{ env.TRUSTED_BUILD_CACHE_VERSION }}-windows-native-${{ matrix.arch }}-${{ hashFiles('windows/CMakeLists.txt', 'mpv-build.lock.json') }}
- name: Setup Flutter
if: matrix.flutter_setup == 'action'
@@ -585,10 +578,10 @@ jobs:
- name: Read version from pubspec
id: version
shell: pwsh
shell: bash
run: |
$v = (Select-String -Path pubspec.yaml -Pattern '^version:\s*(\S+)').Matches[0].Groups[1].Value -replace '\+.*'
echo "version=$v" >> $env:GITHUB_OUTPUT
VERSION=$(python3 scripts/pubspec_version.py pubspec.yaml)
echo "version=${VERSION%%+*}" >> "$GITHUB_OUTPUT"
- name: Build installer and portables
run: .\windows\build-installer.ps1 -X64BuildDir "build-x64" -Arm64BuildDir "build-arm64" -Version "${{ steps.version.outputs.version }}"
@@ -725,17 +718,26 @@ jobs:
exit 1
- name: Cache libmpv build
- name: Cache libmpv prefix
id: libmpv-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: libmpv-prefix
key: ${{ env.TRUSTED_BUILD_CACHE_VERSION }}-libmpv-${{ runner.arch }}-${{ hashFiles('linux/packaging/build-libmpv.sh', 'linux/packaging/native-inputs.json') }}
key: ${{ env.TRUSTED_BUILD_CACHE_VERSION }}-libmpv-${{ runner.arch }}-${{ hashFiles('mpv-build.lock.json') }}
- name: Build libmpv
# The prebuilt prefix from our unified mpv-build repo: the script reads
# the asset and expected SHA-256 from the lock and verifies the bytes
# before a single one is extracted. The tarball is a self-relocating
# prefix tree (lib/ or lib/<triplet>/ with the libmpv.so* chain,
# lib/libshaderc_shared.so*, include/, and pkgconfig/ dirs with
# ${pcfiledir}-relative roots), so the downstream PKG_CONFIG_PATH,
# bundle-copy, and find steps are unchanged.
- name: Fetch libmpv
if: steps.libmpv-cache.outputs.cache-hit != 'true'
shell: bash
run: bash linux/packaging/build-libmpv.sh
run: |
command -v zstd >/dev/null 2>&1 || { sudo apt-get update && sudo apt-get install -y --no-install-recommends zstd; }
python3 scripts/fetch_linux_libmpv.py --dest libmpv-prefix
- name: Install fpm
shell: bash
@@ -872,15 +874,18 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
sparse-checkout: pubspec.yaml
sparse-checkout: |
pubspec.yaml
scripts/pubspec_version.py
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Read version from pubspec.yaml
id: version
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//')
BUILD_NUMBER=$(grep '^version:' pubspec.yaml | sed 's/.*+//')
VERSION=$(python3 scripts/pubspec_version.py pubspec.yaml)
BUILD_NUMBER=${VERSION#*+}
VERSION=${VERSION%%+*}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
+23 -20
View File
@@ -252,9 +252,6 @@ jobs:
- name: Verify native formatting
run: scripts/format_native.sh --check
- name: Verify Linux native acquisition and build plan
run: bash linux/packaging/build-libmpv_test.sh
linux-native-test:
name: Linux native reliability (${{ matrix.sanitizer }})
runs-on: ubuntu-latest
@@ -404,7 +401,9 @@ jobs:
- name: Verify tvOS project wiring
if: matrix.platform == 'tvOS'
run: ruby tvos/scripts/test_wire_mpv.rb
run: |
ruby tvos/scripts/test_wire_mpv.rb
ruby tvos/scripts/test_wire_top_shelf.rb
- name: Select Apple test destination
env:
@@ -645,10 +644,10 @@ jobs:
cache: true
pub-cache: false
# The packaging deps, minus libmpv: this job builds it from source below,
# because the distro's is a different version with different windowing
# backends, and a package smoke-built against it cannot show that
# build-libmpv.sh still works or that the bundle it produces is coherent.
# The packaging deps, minus libmpv: that arrives prebuilt from mpv-build
# below. The dev packages still matter — they install the runtime
# libraries the pinned libmpv links (ass, pulse, pipewire, ...), which
# bundle-libs.sh resolves off the host into the bundle.
- name: Install packaging dependencies
run: |
sudo apt-get update
@@ -662,25 +661,29 @@ jobs:
liblua5.2-dev rpm libarchive-tools imagemagick ruby-dev build-essential
sudo gem install fpm --version 1.17.0 --no-document
# Keyed the same way build.yml keys it, so editing the script or its pinned
# inputs is what invalidates the cache - and this branch's whole point is
# that those edits get exercised somewhere.
- name: Cache libmpv build
# Keyed the same way build.yml keys it: the lock names the asset and its
# checksum, so editing the lock is what invalidates the cache.
- name: Cache libmpv prefix
id: libmpv-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: libmpv-prefix
key: ci-libmpv-${{ runner.arch }}-${{ hashFiles('linux/packaging/build-libmpv.sh', 'linux/packaging/native-inputs.json') }}
key: ci-libmpv-${{ runner.arch }}-${{ hashFiles('mpv-build.lock.json') }}
- name: Build libmpv
# Same contract as build.yml: the script reads mpv-build.lock.json,
# downloads the linux asset for this arch, verifies its SHA-256, and
# extracts the prefix tree.
- name: Fetch libmpv
if: steps.libmpv-cache.outputs.cache-hit != 'true'
run: bash linux/packaging/build-libmpv.sh
run: |
command -v zstd >/dev/null 2>&1 || { sudo apt-get update && sudo apt-get install -y --no-install-recommends zstd; }
python3 scripts/fetch_linux_libmpv.py --dest libmpv-prefix
# The windowing backends the runner depends on, read off the library the
# script just produced. The plane hands mpv MPV_RENDER_PARAM_WL_DISPLAY, so
# a libmpv without Wayland cannot find the VAAPI device and quietly decodes
# in software; X11 and VDPAU are gone with the texture path.
- name: Check the built libmpv's backends
# The windowing backends the runner depends on, read off the pinned
# library just extracted. The plane hands mpv MPV_RENDER_PARAM_WL_DISPLAY,
# so a libmpv without Wayland cannot find the VAAPI device and quietly
# decodes in software; X11 and VDPAU are gone with the texture path.
- name: Check the pinned libmpv's backends
run: |
LIB=$(find libmpv-prefix -name 'libmpv.so.2' | head -1)
echo "== $LIB =="
+2 -2
View File
@@ -1,6 +1,6 @@
cask "plezy" do
version "2.17.1"
sha256 "6b9ed5b89dd6b1a00389bbc2d3d9d67f31bfb731be6496bdffff36c473100e38"
version "2.18.0"
sha256 "affa0922fb33b6ca79a0d6ce7e5042539097a0ea097f011c9a4cfdbe0e822f94"
url "https://github.com/edde746/plezy/releases/download/#{version}/plezy-macos.dmg"
name "Plezy"
+1 -1
View File
@@ -205,4 +205,4 @@ Plezy is licensed under [GPL-3.0](LICENSE).
- Built with [Flutter](https://flutter.dev)
- Supports [Plex Media Server](https://www.plex.tv), [Jellyfin](https://jellyfin.org), and [Emby](https://emby.media)
- Playback powered by [mpv](https://mpv.io), [MPVKit](https://github.com/mpvkit/MPVKit), Android [ExoPlayer](https://developer.android.com/media/media3/exoplayer), [libass-android](https://github.com/peerless2012/libass-android), and [libmpv-android](https://github.com/jarnedemeulemeester/libmpv-android)
- Playback powered by [mpv](https://mpv.io) via our [mpv-build](https://github.com/edde746/mpv-build) pipeline (started as a fork of [MPVKit](https://github.com/mpvkit/MPVKit); the Android Kotlin/JNI glue descends from [libmpv-android](https://github.com/jarnedemeulemeester/libmpv-android)), Android [ExoPlayer](https://developer.android.com/media/media3/exoplayer), and [libass-android](https://github.com/peerless2012/libass-android)
+31 -80
View File
@@ -58,82 +58,31 @@ plugins {
id("dev.flutter.flutter-gradle-plugin")
}
val mpvVersion = "v1.1.3"
val mpvSha256 = "cc5dfa97b140934515691082d1125afedb796ea55357a9051d4ac09a9f6f39ac"
val mpvDir = layout.buildDirectory.dir("libmpv").get().asFile
val mpvAar = "libmpv-release.aar"
val mpvUrl = "https://github.com/edde746/libmpv-android/releases/download/$mpvVersion/$mpvAar"
// The in-project :libmpv module owns the mpv-build pin (repo-root
// mpv-build.lock.json assets + checksums, plus the plezy.localMpvDir/
// PLEZY_LOCAL_MPV_DIR escape hatch) and extracts the per-ABI tarballs'
// prebuilt native libraries. This file reads two of its output trees
// back: FFmpeg .so files for the Media3 adapter link step, and the libc++
// runtime packaged at PROJECT scope below.
val libmpvBuildDir = project(":libmpv").layout.buildDirectory.dir("libmpv").get().asFile
val libmpvNativeJniDir = File(libmpvBuildDir, "native/jni")
val libmpvLibcxxJniDir = File(libmpvBuildDir, "libcxx/jni")
val media3Version = "1.11.0"
val mpvFfmpegVersion = "8.0.1"
val mpvFfmpegSourceSha256 = "05ee0b03119b45c0bdb4df654b96802e909e0a752f72e4fe3794f487229e5a41"
val mpvFfmpegSourceUrl = "https://ffmpeg.org/releases/ffmpeg-$mpvFfmpegVersion.tar.xz"
val mpvFfmpegDevelopmentDir = File(mpvDir, "ffmpeg-development")
val downloadLibmpv = tasks.register("downloadLibmpv") {
val aar = File(mpvDir, mpvAar)
val manifest = File(mpvDir, ".manifest")
inputs.property("version", mpvVersion)
inputs.property("sourceUrl", mpvUrl)
inputs.property("sha256", mpvSha256)
outputs.files(aar, manifest)
doLast {
mpvDir.parentFile.mkdirs()
val staging = File(mpvDir.parentFile, "${mpvDir.name}.staging-${UUID.randomUUID()}")
try {
staging.mkdirs()
val stagedAar = File(staging, mpvAar)
try {
providers.exec {
commandLine("curl", "-sfL", mpvUrl, "-o", stagedAar.absolutePath)
}.result.get().assertNormalExitValue()
} catch (error: Exception) {
throw GradleException("Failed to download $mpvAar $mpvVersion", error)
}
verifySha256(stagedAar, mpvSha256, "$mpvAar $mpvVersion")
File(staging, ".manifest").writeText("version=$mpvVersion\nsha256=$mpvSha256\n")
promoteDirectory(staging, mpvDir)
} finally {
staging.deleteRecursively()
}
}
}
// Extract libc++_shared.so from the libmpv AAR so the app source set can package
// it with top merge priority (see packaging { jniLibs } and sourceSets below).
val extractMpvLibcxx = tasks.register("extractMpvLibcxx") {
dependsOn(downloadLibmpv)
val aar = File(mpvDir, mpvAar)
val outDir = File(mpvDir, "libcxx")
inputs.file(aar)
outputs.dir(outDir)
doLast {
outDir.deleteRecursively() // drop stale ABIs from a previous AAR version
outDir.mkdirs()
providers.exec {
commandLine(
"unzip",
"-q",
"-o",
aar.absolutePath,
"jni/*/libc++_shared.so",
"-d",
outDir.absolutePath
)
}.result.get().assertNormalExitValue()
}
}
val mpvFfmpegDevelopmentDir = layout.buildDirectory.dir("libmpv-ffmpeg-development").get().asFile
// Build the Media3 JNI adapter against the same shared FFmpeg libraries that
// libmpv packages. Headers are pinned to libmpv's FFmpeg version and remain
// build-only; the APK contains one FFmpeg implementation for both players.
val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment") {
dependsOn(downloadLibmpv)
val aar = File(mpvDir, mpvAar)
dependsOn(":libmpv:extractLibmpvNative")
val manifest = File(mpvFfmpegDevelopmentDir, ".manifest")
val abis = listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
val libraries = listOf("avcodec", "avutil", "swresample")
inputs.file(aar)
inputs.dir(libmpvNativeJniDir)
inputs.property("ffmpegVersion", mpvFfmpegVersion)
inputs.property("sourceUrl", mpvFfmpegSourceUrl)
inputs.property("sourceSha256", mpvFfmpegSourceSha256)
@@ -203,15 +152,12 @@ val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment")
)
project.copy {
from(zipTree(aar)) {
from(libmpvNativeJniDir) {
include(
"jni/*/libavcodec.so",
"jni/*/libavutil.so",
"jni/*/libswresample.so"
"*/libavcodec.so",
"*/libavutil.so",
"*/libswresample.so"
)
eachFile {
path = path.removePrefix("jni/")
}
}
includeEmptyDirs = false
into(nativeDir)
@@ -222,11 +168,11 @@ val prepareMpvFfmpegDevelopment = tasks.register("prepareMpvFfmpegDevelopment")
}.filterNot(File::isFile)
if (missing.isNotEmpty()) {
throw GradleException(
"libmpv $mpvVersion is missing FFmpeg libraries: ${missing.joinToString { it.relativeTo(staging).path }}"
"the :libmpv prebuilt tree is missing FFmpeg libraries: ${missing.joinToString { it.relativeTo(staging).path }}"
)
}
File(staging, ".manifest").writeText(
"mpv=$mpvVersion\nffmpeg=$mpvFfmpegVersion\nsourceSha256=$mpvFfmpegSourceSha256\n"
"ffmpeg=$mpvFfmpegVersion\nsourceSha256=$mpvFfmpegSourceSha256\n"
)
sourceArchive.delete()
extractedSource.deleteRecursively()
@@ -336,7 +282,7 @@ android {
defaultConfig {
applicationId = "com.edde746.plezy"
minSdk = 25 // Fire OS 6.x (API 25); overrides libmpv-android's minSdk=26
minSdk = 25 // Fire OS 6.x (API 25); :libmpv shares the same floor
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
@@ -435,8 +381,9 @@ android {
packaging {
jniLibs {
// pickFirst only suppresses the duplicate libc++ merge error; the
// sourceSets rule below makes libmpv's newer runtime win for
// std::from_chars<float>, while older native consumers remain ABI-compatible.
// sourceSets rule below makes the runtime :libmpv extracts from the
// mpv-build tarballs win for std::from_chars<float>, while older
// native consumers remain ABI-compatible.
pickFirsts.add("lib/*/libc++_shared.so")
}
}
@@ -444,8 +391,10 @@ android {
sourceSets {
getByName("main") {
// PROJECT-scope jniLibs merge ahead of subprojects/AARs, so dependency
// order cannot accidentally select the older libc++ copy.
jniLibs.srcDir(File(mpvDir, "libcxx/jni"))
// order cannot accidentally select an older libc++ copy. The directory
// is :libmpv's extractLibmpvNative output (the tarballs' 16 KB-capable
// libc++), wired below via the JniLibFolders dependency.
jniLibs.srcDir(libmpvLibcxxJniDir)
}
}
@@ -501,16 +450,18 @@ tasks.matching { it.name.contains("CMake") || it.name.contains("externalNative")
}
tasks.matching { it.name.startsWith("pre") && it.name.endsWith("Build") }.configureEach {
dependsOn(downloadLibmpv, extractMpvLibcxx, prepareMpvFfmpegDevelopment)
dependsOn(prepareMpvFfmpegDevelopment)
}
// Gradle snapshots jniLibs source dirs before task execution; this keeps the
// extracted libmpv libc++ directory present during input discovery.
tasks.matching { it.name.startsWith("merge") && it.name.endsWith("JniLibFolders") }.configureEach {
dependsOn(extractMpvLibcxx)
dependsOn(":libmpv:extractLibmpvNative")
}
dependencies {
implementation(files(File(mpvDir, mpvAar)))
// mpv Kotlin API + JNI glue live in-project; the prebuilt libmpv/FFmpeg .so
// set rides along from the module's extracted mpv-build tarballs.
implementation(project(":libmpv"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0")
// Android TV Watch Next integration
-3
View File
@@ -6,9 +6,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">
<!-- Allow minSdk=25 despite libmpv-android declaring minSdk=26 -->
<uses-sdk tools:overrideLibrary="dev.jdtech.mpv" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
@@ -28,6 +28,12 @@ internal class ExternalPlayerChannel(private val activity: Activity) {
private const val API_VLC_RESULT_POSITION = "extra_position"
private const val API_VLC_RESULT_DURATION = "extra_duration"
// Honored by VLC and the native Zidoo player (com.android.gallery3d /
// com.zidoo.player). Without it, a launch with no resume point lets the
// player consult its own bookmark store, which on Zidoo collides across
// Plex items because every part URL ends in the same `file.<ext>` (#2223).
private const val API_VLC_FROM_START = "from_start"
private const val API_VIMU_TITLE = "forcename"
private const val API_VIMU_SEEK_POSITION = "startfrom"
private const val API_VIMU_RESUME = "forceresume"
@@ -150,7 +156,7 @@ internal class ExternalPlayerChannel(private val activity: Activity) {
}
}
private data class Source(val uri: Uri, val grantRead: Boolean, val fileName: String?)
internal data class Source(val uri: Uri, val grantRead: Boolean, val fileName: String?)
private fun resolveSource(filePath: String): Source {
if (filePath.startsWith("http://") || filePath.startsWith("https://")) {
@@ -168,7 +174,7 @@ internal class ExternalPlayerChannel(private val activity: Activity) {
return Source(uri, grantRead = true, fileName = file.name)
}
private fun buildIntent(
internal fun buildIntent(
source: Source,
packageName: String?,
startPositionMs: Long,
@@ -181,6 +187,9 @@ internal class ExternalPlayerChannel(private val activity: Activity) {
if (startPosition > 0) {
putExtra(API_MX_RESULT_POSITION, startPosition)
putExtra(API_VIMU_SEEK_POSITION, startPosition)
putExtra(API_VLC_FROM_START, false)
} else {
putExtra(API_VLC_FROM_START, true)
}
putExtra(API_MX_RETURN_RESULT, true)
putExtra(API_MX_SECURE_URI, true)
@@ -31,6 +31,7 @@ import com.edde746.plezy.car.CarRestrictionsMonitor
import com.edde746.plezy.exoplayer.ExoPlayerPlugin
import com.edde746.plezy.mpv.MpvAudioPlayerPlugin
import com.edde746.plezy.mpv.MpvPlayerPlugin
import com.edde746.plezy.shared.AssistiveTechnologyMonitor
import com.edde746.plezy.shared.DeviceQuirks
import com.edde746.plezy.shared.MediaCodecQuery
import com.edde746.plezy.shared.ThemeHelper
@@ -96,9 +97,12 @@ class MainActivity : FlutterActivity() {
private val TEXT_INPUT_CHANNEL = "com.plezy/text_input"
private val APP_EXIT_CHANNEL = "com.plezy/app_exit"
private val CAR_RESTRICTIONS_CHANNEL = "com.plezy/car_restrictions"
private val ASSISTIVE_TECHNOLOGY_CHANNEL = "com.plezy/assistive_technology"
private var watchNextPlugin: WatchNextPlugin? = null
private var carRestrictions: CarRestrictionsMonitor? = null
private var carRestrictionsChannel: MethodChannel? = null
private var assistiveTechnology: AssistiveTechnologyMonitor? = null
private var assistiveTechnologyChannel: MethodChannel? = null
private var nativeTextInputFocused = false
private val imeRecoveryHandler = Handler(Looper.getMainLooper())
private var imeShowAttempts = 0
@@ -593,6 +597,9 @@ class MainActivity : FlutterActivity() {
carRestrictions?.release()
carRestrictions = null
carRestrictionsChannel = null
assistiveTechnology?.release()
assistiveTechnology = null
assistiveTechnologyChannel = null
activityStarted = false
flutterSurfaceReconnectPending = false
flutterTextureView = null
@@ -781,6 +788,19 @@ class MainActivity : FlutterActivity() {
}
}
val assistiveChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, ASSISTIVE_TECHNOLOGY_CHANNEL)
assistiveTechnologyChannel = assistiveChannel
val assistiveMonitor = assistiveTechnology ?: AssistiveTechnologyMonitor(applicationContext).also {
assistiveTechnology = it
}
assistiveMonitor.start { runOnUiThread { assistiveTechnologyChannel?.invokeMethod("onChanged", null) } }
assistiveChannel.setMethodCallHandler { call, result ->
when (call.method) {
"getSignals" -> result.success(assistiveMonitor.signals())
else -> result.notImplemented()
}
}
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, DEVICE_ADJUSTMENT_CHANNEL).setMethodCallHandler { call, result ->
handleDeviceAdjustmentCall(call.method, call.arguments, result)
}
@@ -79,18 +79,26 @@ internal fun isPcmEncoding(encoding: Int): Boolean = when (encoding) {
/** The IEC 61937 track shape a codec's spdif burst rides. */
internal enum class MpvIecShape { STEREO_48K, STEREO_192K, SURROUND_192K }
private class MpvSpdifCodec(val name: String, val encoding: Int, val shape: MpvIecShape)
private class MpvSpdifCodec(
val name: String,
val encoding: Int,
val shape: MpvIecShape,
/** Whether the fork's audiotrack AO opens this codec as a raw bitstream track first. */
val raw: Boolean = false
)
/**
* mpv `audio-spdif` codec names, the platform encoding a route must advertise to carry that
* bitstream, and the IEC 61937 track shape the codec's burst rides.
* bitstream, and the track shape the fork's `ao_audiotrack` opens for it.
*
* `ad_spdif` fixes the geometry per codec: AC3 and the DTS core are stereo frames at the mixer
* rate, E-AC3 a stereo frame at 192kHz, TrueHD as MAT and DTS-HD MA 8-channel 192kHz bursts
* (`audio/decode/ad_spdif.c:216-267`). Only AC3 and the DTS core used to be listed because
* libmpv's `ao_audiotrack` squeezed every burst into a stereo track at the mixer rate; v1.1.0
* skips that clamp for spdif and takes the channel mask from the burst instead
* (`audio/out/ao_audiotrack.c:678-731`).
* Since the raw-passthrough patch (0102), the AO feeds AC3, E-AC3 and the DTS core to a raw
* `ENCODING_AC3`/`E_AC3`/`DTS` track at 48kHz/stereo — the transport ExoPlayer and Kodi use —
* and only falls back to the IEC 61937 carrier when the route rejects the raw encoding
* outright. Raw tracks keep the platform's Dolby/DTS transcoder in the path; a pre-packed IEC
* track bypasses it and drains into silence on routes whose sink cannot decode the codec
* itself (#2177's Shield in front of a Dolby-Digital-only Sonos). TrueHD (MAT) and DTS-HD MA
* stay on the 8-channel 192kHz IEC carrier the multichannel patch (0101) added: their raw
* forms are not recoverable from the burst stream.
*
* `dts-hd` supersedes plain `dts`: that literal is what selects the lossless `spdif_dts_hd`
* decoder, and it enables spdif for the whole `dts` codec while doing so, with the core burst
@@ -99,31 +107,37 @@ private class MpvSpdifCodec(val name: String, val encoding: Int, val shape: MpvI
* conservative choice.
*/
private val MPV_SPDIF_CODECS: List<MpvSpdifCodec> = listOf(
MpvSpdifCodec("ac3", C.ENCODING_AC3, MpvIecShape.STEREO_48K),
MpvSpdifCodec("eac3", C.ENCODING_E_AC3, MpvIecShape.STEREO_192K),
MpvSpdifCodec("ac3", C.ENCODING_AC3, MpvIecShape.STEREO_48K, raw = true),
MpvSpdifCodec("eac3", C.ENCODING_E_AC3, MpvIecShape.STEREO_192K, raw = true),
MpvSpdifCodec("truehd", C.ENCODING_DOLBY_TRUEHD, MpvIecShape.SURROUND_192K),
MpvSpdifCodec("dts", C.ENCODING_DTS, MpvIecShape.STEREO_48K),
MpvSpdifCodec("dts", C.ENCODING_DTS, MpvIecShape.STEREO_48K, raw = true),
MpvSpdifCodec("dts-hd", C.ENCODING_DTS_HD, MpvIecShape.SURROUND_192K)
)
/**
* Builds an `audio-spdif` value naming only the codecs the route can carry: [supportsEncoding]
* advertises the codec's encoding *and* [supportsShape] takes the track shape its burst needs.
* Plain `dts` is dropped whenever `dts-hd` qualifies, which already covers the core burst.
* advertises the codec's encoding *and* a transport the AO's ladder can open exists —
* [supportsRawTrack] for the raw bitstream track it tries first, or [supportsShape] for the
* IEC 61937 burst it falls back to. Plain `dts` is dropped whenever `dts-hd` qualifies, which
* already covers the core burst.
*
* mpv force-passes through every codec named here and has no decode fallback, so an
* unsupported name leaves the file rendering video against a dead audio output (#1703).
*
* The gate is the exact encoding rather than media3's passthrough probe on purpose. That
* probe answers by downgrading (DTS-HD to the DTS core, E-AC3 JOC to E-AC3) and rejects
* channel counts above the route's PCM maximum, neither of which describes what an IEC
* 61937 track carries.
* channel counts above the route's PCM maximum, neither of which describes what a
* passthrough track carries.
*/
internal fun mpvSpdifCodecs(
supportsEncoding: (Int) -> Boolean,
supportsShape: (MpvIecShape) -> Boolean
supportsShape: (MpvIecShape) -> Boolean,
supportsRawTrack: (Int) -> Boolean = { false }
): String {
val carried = MPV_SPDIF_CODECS.filter { supportsEncoding(it.encoding) && supportsShape(it.shape) }
val carried = MPV_SPDIF_CODECS.filter {
supportsEncoding(it.encoding) &&
((it.raw && supportsRawTrack(it.encoding)) || supportsShape(it.shape))
}
val dtsHd = carried.any { it.name == "dts-hd" }
return (if (dtsHd) carried.filterNot { it.name == "dts" } else carried).joinToString(",") { it.name }
}
@@ -132,16 +146,17 @@ internal fun mpvSpdifCodecs(
* [mpvSpdifCodecs] resolved against the audio route [context] is currently routed to.
*
* Two conditions per codec, both required:
* - The route must accept the exact track shape mpv opens for that codec's burst — stereo
* IEC 61937 at 48kHz ([supportsMpvIecShape]), stereo at 192kHz
* ([supportsMpvHighRateIecShape]) or 192kHz/7.1 ([supportsIecCarrier]). Advertising the raw
* encoding only says the receiver decodes it, not that the HAL takes an IEC 61937 AudioTrack:
* #1991's Shield bitstreams AC3 through ExoPlayer's raw path while every mpv spdif attempt
* strands playback on a dead audio output, leaving nothing but AAC playable. The shapes are
* independent, so none of them may veto the whole list: a route that takes the 192kHz carrier
* but not the 48kHz stereo frame still bitstreams TrueHD and DTS-HD MA.
* - The route must accept a track shape the AO's ladder actually opens. For AC3, E-AC3 and the
* DTS core that is the raw bitstream track probed by [supportsMpvRawTrack], with the IEC
* stereo shapes ([supportsMpvIecShape], [supportsMpvHighRateIecShape]) as the AO's fallback
* transport; TrueHD and DTS-HD MA need the 192kHz/7.1 carrier ([supportsIecCarrier]).
* Advertising the raw encoding only says the receiver decodes it, not that the HAL takes the
* track: #1991's Shield strands playback on every mpv IEC attempt while bitstreaming AC3 raw.
* The probes are independent, so none of them may veto the whole list: a route that takes the
* 192kHz carrier but no raw track still bitstreams TrueHD and DTS-HD MA.
* - The receiver must decode the codec itself — the raw encoding on the current
* [AudioCapabilities] — because IEC 61937 is transport, not transcoding.
* [AudioCapabilities] — because passthrough is transport, not transcoding. (On a raw track
* the platform may additionally transcode, which is exactly why the AO prefers it.)
*/
// Deprecated only in favour of an overload that also takes spatializer channel masks, which
// do not affect bitstream routing. Same probe ExoPlayerCore's TrueHD decision uses.
@@ -158,13 +173,16 @@ internal fun supportedMpvSpdifCodecs(context: Context): String {
Log.w(TAG, "Audio route capabilities unavailable; mpv will decode instead of bitstreaming", error)
return ""
}
// Every shape costs real route probes and is shared by more than one codec, so probe each once.
val probed = HashMap<MpvIecShape, Boolean>(3)
val codecs = mpvSpdifCodecs(capabilities::supportsEncoding) { shape ->
probed.getOrPut(shape) { routeTakesIecShape(context, shape) }
}
// Every probe costs real route calls and may be shared by more than one codec, so probe once.
val shapeProbed = HashMap<MpvIecShape, Boolean>(3)
val rawProbed = HashMap<Int, Boolean>(3)
val codecs = mpvSpdifCodecs(
capabilities::supportsEncoding,
{ shape -> shapeProbed.getOrPut(shape) { routeTakesIecShape(context, shape) } },
{ encoding -> rawProbed.getOrPut(encoding) { supportsMpvRawTrack(context, encoding) } }
)
if (codecs.isEmpty()) {
Log.i(TAG, "Route takes no IEC 61937 track mpv can fill; mpv will decode instead of bitstreaming")
Log.i(TAG, "Route takes no passthrough track mpv can fill; mpv will decode instead of bitstreaming")
} else {
Log.i(TAG, "mpv will bitstream: $codecs")
}
@@ -198,6 +216,30 @@ internal fun supportsMpvIecShape(context: Context): Boolean = iecRouteSupported(
hdmiRouteAdvertised = { hdmiAdvertisesIecRoute(context, MPV_IEC_SAMPLE_RATE, MPV_IEC_CHANNEL_COUNT) }
)
/**
* Whether the route takes a raw bitstream `AudioTrack` for [encoding] at the shape the fork's
* `ao_audiotrack` opens first: the codec frame rate with a stereo mask (Kodi's raw shape; the
* HAL reads the real channel layout from the bitstream). Same probe tiering as the IEC shapes,
* except below API 29, where no runtime oracle exists for raw tracks and media3 gates its raw
* path on the advertised encoding alone — which [supportedMpvSpdifCodecs] already requires via
* [AudioCapabilities]. #1991's API 28 Shield bitstreams AC3 exactly this way.
*/
internal fun supportsMpvRawTrack(context: Context, encoding: Int): Boolean = iecRouteSupported(
sdkInt = Build.VERSION.SDK_INT,
canSizeBuffer = { canSizeDirectBuffer(MPV_IEC_SAMPLE_RATE, AudioFormat.CHANNEL_OUT_STEREO, encoding) },
// The SDK_INT guards repeat iecRouteSupported's tiering only because lint's NewApi
// check cannot see through the injected lambdas.
bitstreamSupported = {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
iecBitstreamSupported(directProbeFormat(encoding, MPV_IEC_SAMPLE_RATE, AudioFormat.CHANNEL_OUT_STEREO))
},
directPlaybackSupported = {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q &&
iecDirectPlaybackSupported(directProbeFormat(encoding, MPV_IEC_SAMPLE_RATE, AudioFormat.CHANNEL_OUT_STEREO))
},
hdmiRouteAdvertised = { true }
)
/** E-AC3's geometry: the stereo shape at the 192kHz burst rate, same route tiering as the others. */
internal fun supportsMpvHighRateIecShape(context: Context): Boolean = iecRouteSupported(
sdkInt = Build.VERSION.SDK_INT,
@@ -280,8 +322,10 @@ internal fun iecRouteSupported(
else -> hdmiRouteAdvertised()
}
private fun canSizeIecBuffer(sampleRate: Int, channelMask: Int): Boolean = try {
AudioTrack.getMinBufferSize(sampleRate, channelMask, AudioFormat.ENCODING_IEC61937) > 0
private fun canSizeIecBuffer(sampleRate: Int, channelMask: Int): Boolean = canSizeDirectBuffer(sampleRate, channelMask, AudioFormat.ENCODING_IEC61937)
private fun canSizeDirectBuffer(sampleRate: Int, channelMask: Int, encoding: Int): Boolean = try {
AudioTrack.getMinBufferSize(sampleRate, channelMask, encoding) > 0
} catch (error: Exception) {
false
}
@@ -326,8 +370,10 @@ private fun hdmiAdvertisesIecRoute(context: Context, sampleRate: Int, channelCou
}
/** The exact tuple an IEC output's `AudioTrack` is built with; see [PlezyRenderersFactory]. */
private fun iecProbeFormat(sampleRate: Int, channelMask: Int): AudioFormat = AudioFormat.Builder()
.setEncoding(AudioFormat.ENCODING_IEC61937)
private fun iecProbeFormat(sampleRate: Int, channelMask: Int): AudioFormat = directProbeFormat(AudioFormat.ENCODING_IEC61937, sampleRate, channelMask)
private fun directProbeFormat(encoding: Int, sampleRate: Int, channelMask: Int): AudioFormat = AudioFormat.Builder()
.setEncoding(encoding)
.setChannelMask(channelMask)
.setSampleRate(sampleRate)
.build()
@@ -1,9 +1,9 @@
package com.edde746.plezy.mpv
import dev.jdtech.mpv.EndFileReason
import dev.jdtech.mpv.LogLevel
import dev.jdtech.mpv.LogMessage
import dev.jdtech.mpv.MpvEvent
import com.edde746.plezy.libmpv.EndFileReason
import com.edde746.plezy.libmpv.LogLevel
import com.edde746.plezy.libmpv.LogMessage
import com.edde746.plezy.libmpv.MpvEvent
/** Adds the native diagnostic that libmpv-android exposes separately via logFlow. */
internal class MpvEndFileDiagnostics {
@@ -17,12 +17,12 @@ import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver
import com.edde746.plezy.exoplayer.DoviBridge
import com.edde746.plezy.libmpv.*
import com.edde746.plezy.shared.AudioFocusManager
import com.edde746.plezy.shared.FrameRateManager
import com.edde746.plezy.shared.PlayerDelegate
import com.edde746.plezy.shared.PlayerSurfaceHost
import com.edde746.plezy.shared.SurfacePlayerCore
import dev.jdtech.mpv.*
import kotlinx.coroutines.*
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
@@ -537,7 +537,6 @@ class MpvPlayerCore private constructor(
delegate?.onEvent("file-loaded", null)
}
is MpvEvent.PlaybackRestart -> delegate?.onEvent("playback-restart", null)
else -> {}
}
}
}
@@ -0,0 +1,86 @@
package com.edde746.plezy.shared
import android.accessibilityservice.AccessibilityServiceInfo
import android.content.Context
import android.os.Build
import android.view.accessibility.AccessibilityManager
/**
* Reports whether an enabled accessibility service can consume the app's semantics tree.
*
* Flutter compiles a semantics tree for every frame while [AccessibilityManager.isEnabled], which
* Android sets for any bound service. On TV that is routinely a utility that never reads app
* content (a launcher's foreground-app hook, a key remapper), so Dart gates the tree on this
* verdict. The verdict errs towards keeping the tree:
*
* - touch exploration is a screen reader, full stop;
* - an empty enabled list while accessibility is on means a [android.app.UiAutomation] client
* (instrumentation, Maestro), which is not listed but reads the tree;
* - on API 33+ a service flagged `isAccessibilityTool`, or one giving spoken, braille, audible or
* visual feedback, consumes; a non-tool with only generic/haptic feedback does not;
* - below 33 only a haptic-only service is treated as not consuming, since `feedbackGeneric` is
* what Switch Access-style tools declare.
*/
class AssistiveTechnologyMonitor(context: Context) {
private val manager = context.getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager
private var onChanged: (() -> Unit)? = null
private val stateListener = AccessibilityManager.AccessibilityStateChangeListener { onChanged?.invoke() }
private val touchExplorationListener =
AccessibilityManager.TouchExplorationStateChangeListener { onChanged?.invoke() }
private var servicesListener: AccessibilityManager.AccessibilityServicesStateChangeListener? = null
fun start(onChanged: () -> Unit) {
if (this.onChanged != null) return
this.onChanged = onChanged
manager.addAccessibilityStateChangeListener(stateListener)
manager.addTouchExplorationStateChangeListener(touchExplorationListener)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val listener = AccessibilityManager.AccessibilityServicesStateChangeListener { onChanged() }
servicesListener = listener
manager.addAccessibilityServicesStateChangeListener(listener)
}
}
fun release() {
if (onChanged == null) return
onChanged = null
manager.removeAccessibilityStateChangeListener(stateListener)
manager.removeTouchExplorationStateChangeListener(touchExplorationListener)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
servicesListener?.let { manager.removeAccessibilityServicesStateChangeListener(it) }
servicesListener = null
}
}
fun signals(): Map<String, Any> {
val services = manager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK)
return mapOf(
"accessibilityEnabled" to manager.isEnabled,
"touchExplorationEnabled" to manager.isTouchExplorationEnabled,
"enabledServiceCount" to services.size,
"consumesSemantics" to consumesSemantics(services)
)
}
private fun consumesSemantics(services: List<AccessibilityServiceInfo>): Boolean {
if (manager.isTouchExplorationEnabled) return true
if (services.isEmpty()) return true
return services.any { info -> consumesSemantics(info) }
}
private fun consumesSemantics(info: AccessibilityServiceInfo): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (info.isAccessibilityTool) return true
return info.feedbackType and READER_FEEDBACK != 0
}
return info.feedbackType and AccessibilityServiceInfo.FEEDBACK_HAPTIC.inv() != 0
}
private companion object {
const val READER_FEEDBACK =
AccessibilityServiceInfo.FEEDBACK_SPOKEN or
AccessibilityServiceInfo.FEEDBACK_BRAILLE or
AccessibilityServiceInfo.FEEDBACK_AUDIBLE or
AccessibilityServiceInfo.FEEDBACK_VISUAL
}
}
+5
View File
@@ -13,3 +13,8 @@ add_executable(ffmpeg_audio_buffer_test ffmpeg_audio_buffer_test.cpp)
target_compile_features(ffmpeg_audio_buffer_test PRIVATE cxx_std_17)
add_test(NAME ffmpeg_audio_buffer_test COMMAND ffmpeg_audio_buffer_test)
add_executable(mpv_utf8_convert_test mpv_utf8_convert_test.cpp)
target_compile_features(mpv_utf8_convert_test PRIVATE cxx_std_17)
add_test(NAME mpv_utf8_convert_test COMMAND mpv_utf8_convert_test)
@@ -0,0 +1,59 @@
#include <cstdio>
#include <string>
#include "../../../../libmpv/src/main/cpp/utf8_convert.h"
namespace {
using plezy::utf8::FromUtf16;
using plezy::utf8::ToUtf16;
bool check(bool condition, const char* message) {
if (!condition) std::fprintf(stderr, "%s\n", message);
return condition;
}
bool roundTripsAsciiBmpAndSupplementary() {
// "a" U+00E9 U+4E2D U+1F3AC (clapper board) — 1/2/3/4-byte sequences.
const std::string utf8 = "a\xC3\xA9\xE4\xB8\xAD\xF0\x9F\x8E\xAC";
const std::u16string utf16 = ToUtf16(utf8.c_str());
return check(utf16 == u"a\u00E9\u4E2D\U0001F3AC", "UTF-8 -> UTF-16 mismatch") &&
check(FromUtf16(utf16.data(), utf16.size()) == utf8, "UTF-16 -> UTF-8 mismatch");
}
bool doesNotEmitModifiedUtf8() {
// JNI's modified UTF-8 would encode U+1F3AC as a 6-byte CESU-8 surrogate
// pair; mpv/open() need the real 4-byte form.
const std::u16string clapper = u"\U0001F3AC";
return check(FromUtf16(clapper.data(), clapper.size()) == "\xF0\x9F\x8E\xAC", "supplementary char not 4 bytes") &&
check(
ToUtf16("\xED\xA0\xBC\xED\xBE\xAC") == u"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD",
"CESU-8 surrogate bytes accepted as UTF-8");
}
bool replacesMalformedBytesOneAtATime() {
return check(ToUtf16("ok\xFF\xFEz") == u"ok\uFFFD\uFFFDz", "stray bytes not replaced individually") &&
check(ToUtf16("\xC0\x80") == u"\uFFFD\uFFFD", "overlong NUL accepted") &&
check(ToUtf16("\xE2\x82") == u"\uFFFD\uFFFD", "truncated sequence not replaced") &&
check(ToUtf16("\xF4\x90\x80\x80") == u"\uFFFD\uFFFD\uFFFD\uFFFD", "code point above U+10FFFF accepted") &&
check(ToUtf16("\xE0\x80\xAF") == u"\uFFFD\uFFFD\uFFFD", "overlong 3-byte form accepted");
}
bool replacesLoneSurrogates() {
const std::u16string lone = u"x\xD83Cy\xDFACz";
return check(FromUtf16(lone.data(), lone.size()) == "x\xEF\xBF\xBDy\xEF\xBF\xBDz", "lone surrogates not replaced");
}
bool handlesNullAndEmpty() {
return check(ToUtf16(nullptr).empty(), "NULL input not empty") &&
check(ToUtf16("").empty(), "empty input not empty") &&
check(FromUtf16(nullptr, 0).empty(), "NULL UTF-16 not empty");
}
} // namespace
int main() {
const bool ok = roundTripsAsciiBmpAndSupplementary() && doesNotEmitModifiedUtf8() &&
replacesMalformedBytesOneAtATime() && replacesLoneSurrogates() && handlesNullAndEmpty();
return ok ? 0 : 1;
}
@@ -2,8 +2,10 @@ package com.edde746.plezy
import android.app.Activity
import android.content.Intent
import android.net.Uri
import io.flutter.plugin.common.MethodChannel
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
@@ -30,6 +32,40 @@ class ExternalPlayerChannelTest {
assertEquals(false, result["playbackError"])
}
@Test
fun freshLaunchTellsPlayerToStartFromBeginning() {
val activity = Robolectric.buildActivity(Activity::class.java).get()
val channel = ExternalPlayerChannel(activity)
val source = ExternalPlayerChannel.Source(
Uri.parse("http://plex:32400/library/parts/9808/1775431760/file.mkv?X-Plex-Token=tok"),
grantRead = false,
fileName = "file.mkv"
)
val intent = channel.buildIntent(source, packageName = null, startPositionMs = 0L, title = "Episode")
assertTrue(intent.getBooleanExtra("from_start", false))
assertFalse(intent.hasExtra("position"))
assertFalse(intent.hasExtra("startfrom"))
}
@Test
fun resumeLaunchPassesPositionAndDisablesFromStart() {
val activity = Robolectric.buildActivity(Activity::class.java).get()
val channel = ExternalPlayerChannel(activity)
val source = ExternalPlayerChannel.Source(
Uri.parse("http://plex:32400/library/parts/9808/1775431760/file.mkv?X-Plex-Token=tok"),
grantRead = false,
fileName = "file.mkv"
)
val intent = channel.buildIntent(source, packageName = null, startPositionMs = 90_000L, title = null)
assertFalse(intent.getBooleanExtra("from_start", true))
assertEquals(90_000, intent.getIntExtra("position", -1))
assertEquals(90_000, intent.getIntExtra("startfrom", -1))
}
@Test
fun activityDestroyCompletesPendingChannelCall() {
val activity = Robolectric.buildActivity(Activity::class.java).get()
@@ -155,11 +155,52 @@ class AudioOutputPolicyTest {
@Test
fun spdifListIsEmptyWhenTheRouteTakesNoIecTrackAtAll() {
// Every encoding advertised, but no IEC 61937 track shape opens: mpv has no decode fallback
// for a named codec, so nothing may be named (#1991).
// Every encoding advertised, but no raw track and no IEC 61937 shape opens: mpv has no
// decode fallback for a named codec, so nothing may be named (#1991).
assertEquals("", spdifCodecs(allEncodings, emptySet()))
}
@Test
fun rawCapableRouteBitstreamsTheCoreCodecsWithoutAnyIecShape() {
// #2177's Shield: every mpv IEC track opens and drains into silence, while raw
// ENCODING_AC3/E_AC3/DTS tracks (the ExoPlayer transport) play. The AO opens raw first,
// so raw support alone must qualify the core codecs.
assertEquals(
"ac3,eac3,dts",
spdifCodecs(allEncodings, emptySet(), raw = setOf(C.ENCODING_AC3, C.ENCODING_E_AC3, C.ENCODING_DTS))
)
}
@Test
fun rawSupportNeverQualifiesTheLosslessCodecs() {
// TrueHD and DTS-HD MA have no raw transport in the AO; they ride the 192kHz/7.1 IEC
// carrier or decode. A route that takes every raw track but no carrier must not name them.
assertEquals("ac3,eac3,dts", spdifCodecs(allEncodings, emptySet(), raw = allEncodings))
}
@Test
fun rawProbeIsOnlyConsultedForRawCandidates() {
// The raw probe costs real route calls; the carrier-only codecs must never trigger it.
val codecs = mpvSpdifCodecs(
{ true },
{ true },
{ encoding ->
if (encoding == C.ENCODING_DOLBY_TRUEHD || encoding == C.ENCODING_DTS_HD) {
throw AssertionError("raw probe consulted for a carrier-only codec")
}
true
}
)
assertEquals("ac3,eac3,truehd,dts-hd", codecs)
}
@Test
fun dtsHdStillSupersedesPlainDtsWhenDtsBitstreamsRaw() {
// dts-hd selects the lossless spdif decoder for the whole dts codec; the raw core track
// must not resurrect the plain name beside it.
assertEquals("ac3,eac3,truehd,dts-hd", spdifCodecs(allEncodings, allShapes, raw = allEncodings))
}
@Test
fun iecRouteIsNeverOfferedBelowApi24() {
// ENCODING_IEC61937 does not exist there.
@@ -262,5 +303,5 @@ class AudioOutputPolicyTest {
private val allShapes = MpvIecShape.values().toSet()
private fun spdifCodecs(encodings: Set<Int>, shapes: Set<MpvIecShape>): String = mpvSpdifCodecs({ it in encodings }, { it in shapes })
private fun spdifCodecs(encodings: Set<Int>, shapes: Set<MpvIecShape>, raw: Set<Int> = emptySet()): String = mpvSpdifCodecs({ it in encodings }, { it in shapes }, { it in raw })
}
@@ -7,11 +7,11 @@ import android.os.Looper
import android.view.ViewGroup
import android.view.ViewTreeObserver
import android.widget.FrameLayout
import com.edde746.plezy.libmpv.EndFileReason
import com.edde746.plezy.libmpv.LogLevel
import com.edde746.plezy.libmpv.LogMessage
import com.edde746.plezy.libmpv.MpvEvent
import com.edde746.plezy.shared.AudioFocusManager
import dev.jdtech.mpv.EndFileReason
import dev.jdtech.mpv.LogLevel
import dev.jdtech.mpv.LogMessage
import dev.jdtech.mpv.MpvEvent
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MethodCall
@@ -3,6 +3,7 @@ package com.edde746.plezy.shared
import android.app.Activity
import android.os.Handler
import android.os.Looper
import java.time.Duration
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Test
@@ -10,7 +11,6 @@ import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.Shadows.shadowOf
import java.time.Duration
/**
* Teardown ordering for frame-rate matching (#2172): restoring the display
@@ -21,8 +21,7 @@ import java.time.Duration
@RunWith(RobolectricTestRunner::class)
class FrameRateManagerRestoreTest {
private fun buildManager(activity: Activity): FrameRateManager =
FrameRateManager(activity, Handler(Looper.getMainLooper()))
private fun buildManager(activity: Activity): FrameRateManager = FrameRateManager(activity, Handler(Looper.getMainLooper()))
private fun preferredModeId(activity: Activity): Int = activity.window.attributes.preferredDisplayModeId
+1 -1
View File
@@ -12,7 +12,7 @@ android {
compileSdk = 36
// Matches the app's latest stable NDK so every project-owned native library
// is built with the same 16 KB page-size-capable libc++ toolchain. That copy
// is NOT what ships: the app packages the libmpv AAR's newer copy with top
// is NOT what ships: the app packages the mpv-build tarball's newer copy with top
// merge priority (see app/build.gradle.kts packaging { jniLibs } + sourceSets).
ndkVersion = "29.0.14206865"
+292
View File
@@ -0,0 +1,292 @@
import java.nio.file.Files
import java.nio.file.StandardCopyOption
import java.security.MessageDigest
import java.util.UUID
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
fun verifySha256(file: File, expected: String, identity: String) {
val digest = MessageDigest.getInstance("SHA-256")
file.inputStream().buffered().use { input ->
val buffer = ByteArray(DEFAULT_BUFFER_SIZE)
while (true) {
val count = input.read(buffer)
if (count < 0) break
digest.update(buffer, 0, count)
}
}
val actual = digest.digest().joinToString("") {
(it.toInt() and 0xff).toString(16).padStart(2, '0')
}
if (actual != expected) {
throw GradleException("SHA-256 mismatch for $identity: expected $expected, got $actual")
}
}
fun promoteDirectory(staging: File, destination: File) {
val backup = File(destination.parentFile, "${destination.name}.backup-${UUID.randomUUID()}")
val hadDestination = destination.exists()
try {
if (hadDestination) {
Files.move(destination.toPath(), backup.toPath(), StandardCopyOption.ATOMIC_MOVE)
}
try {
Files.move(staging.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE)
} catch (promotionFailure: Exception) {
if (hadDestination && backup.exists()) {
try {
Files.move(backup.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE)
} catch (restoreFailure: Exception) {
promotionFailure.addSuppressed(restoreFailure)
}
}
throw promotionFailure
}
if (hadDestination && backup.exists() && !backup.deleteRecursively()) {
throw GradleException("Failed to remove obsolete native artifact backup at ${backup.absolutePath}")
}
} finally {
staging.deleteRecursively()
}
}
// mpv Kotlin API + JNI glue built in-project (imported from the libmpv-android
// fork, commit e60c3ba); the external dependency is reduced to prebuilt native
// trees carried by the mpv-build per-ABI tarballs pinned below.
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}
// Single source for the pinned native artifacts: the repo-root
// mpv-build.lock.json (github.com/edde746/mpv-build release assets + sha256
// checksums). This module downloads and extracts them; app/build.gradle.kts
// reads FFmpeg .so files and the libc++ runtime back out of the extracted
// trees.
val mpvAbis = listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
val mpvLockFile = rootProject.file("../mpv-build.lock.json")
val mpvLockAndroid = run {
@Suppress("UNCHECKED_CAST")
val lock = groovy.json.JsonSlurper().parse(mpvLockFile) as Map<String, Any?>
@Suppress("UNCHECKED_CAST")
((lock["artifacts"] as? Map<String, Any?>)?.get("android") as? Map<String, Any?>)
?: throw GradleException("$mpvLockFile has no artifacts.android section")
}
val mpvKey = mpvLockAndroid["key"] as? String
?: throw GradleException("$mpvLockFile artifacts.android.key is missing")
val mpvAssetBase = mpvLockAndroid["assetBase"] as? String
?: throw GradleException("$mpvLockFile artifacts.android.assetBase is missing")
@Suppress("UNCHECKED_CAST")
val mpvAssets = (mpvLockAndroid["assets"] as? Map<String, Map<String, String>>).let { assets ->
val missing = mpvAbis.filter { assets?.get(it)?.get("asset").isNullOrEmpty() || assets?.get(it)?.get("checksum").isNullOrEmpty() }
if (assets == null || missing.isNotEmpty()) {
throw GradleException("$mpvLockFile artifacts.android.assets lacks asset+checksum for: ${missing.joinToString()}")
}
assets
}
val mpvDir = layout.buildDirectory.dir("libmpv").get().asFile
val mpvArchivesDir = File(mpvDir, "archives")
val mpvNativeDir = File(mpvDir, "native")
val mpvLibcxxDir = File(mpvDir, "libcxx")
// Downloaded archives are renamed to a key-independent name so a lock bump
// (new key) changes task inputs, not the output file set.
fun stagedArchiveName(abi: String) = "libmpv-android-$abi.tar.gz"
// Dev-only escape hatch: point the build at a directory of locally built
// mpv-build android tarballs (platforms/android output, one
// libmpv-android-<key>-<abi>.tar.gz per ABI) to test changes before a lock
// bump. Checksums are skipped for local archives; the lock stays
// authoritative otherwise.
val localMpvDir: String? = (project.findProperty("plezy.localMpvDir") as String?)
?: System.getenv("PLEZY_LOCAL_MPV_DIR")
fun localArchive(abi: String): File {
val dir = File(localMpvDir!!)
val exact = File(dir, mpvAssets.getValue(abi).getValue("asset"))
if (exact.isFile) return exact
val pattern = Regex("libmpv-android-.+-${Regex.escape(abi)}\\.tar\\.gz")
val matches = dir.listFiles()?.filter { it.isFile && pattern.matches(it.name) }.orEmpty()
return matches.singleOrNull() ?: throw GradleException(
"PLEZY_LOCAL_MPV_DIR=$localMpvDir must contain exactly one libmpv-android-*-$abi.tar.gz, found ${matches.size}"
)
}
val downloadLibmpv = tasks.register("downloadLibmpv") {
val manifest = File(mpvArchivesDir, ".manifest")
inputs.file(mpvLockFile)
inputs.property("localOverride", localMpvDir ?: "")
if (localMpvDir != null) mpvAbis.forEach { abi -> inputs.file(localArchive(abi)) }
outputs.files(mpvAbis.map { File(mpvArchivesDir, stagedArchiveName(it)) } + manifest)
doLast {
mpvDir.mkdirs()
val staging = File(mpvDir, "archives.staging-${UUID.randomUUID()}")
try {
staging.mkdirs()
val manifestText = StringBuilder()
mpvAbis.forEach { abi ->
val staged = File(staging, stagedArchiveName(abi))
if (localMpvDir != null) {
val source = localArchive(abi)
source.copyTo(staged, overwrite = true)
manifestText.append("$abi=local:${source.absolutePath}\n")
} else {
val asset = mpvAssets.getValue(abi).getValue("asset")
val checksum = mpvAssets.getValue(abi).getValue("checksum")
try {
providers.exec {
commandLine("curl", "-sfL", "$mpvAssetBase/$asset", "-o", staged.absolutePath)
}.result.get().assertNormalExitValue()
} catch (error: Exception) {
throw GradleException("Failed to download $asset (mpv-build $mpvKey)", error)
}
verifySha256(staged, checksum, "$asset (mpv-build $mpvKey)")
manifestText.append("$abi=$asset sha256=$checksum\n")
}
}
File(staging, ".manifest").writeText(manifestText.toString())
promoteDirectory(staging, mpvArchivesDir)
} finally {
staging.deleteRecursively()
}
}
}
// Each tarball is a native tree: lib/*.so (libmpv, seven FFmpeg libraries,
// libc++_shared) + include/mpv/*.h. The .so files land in the per-ABI jniLibs
// layout under native/jni, the headers under native/include for the CMake
// glue build, and libc++ in a separate tree that the app packages at PROJECT
// scope so the tarball's 16 KB-capable runtime deterministically wins the
// merge (see app/build.gradle.kts packaging { jniLibs } + sourceSets).
val extractLibmpvNative = tasks.register("extractLibmpvNative") {
dependsOn(downloadLibmpv)
inputs.files(mpvAbis.map { File(mpvArchivesDir, stagedArchiveName(it)) })
outputs.dir(mpvNativeDir)
outputs.dir(mpvLibcxxDir)
doLast {
val nativeStaging = File(mpvDir, "native.staging-${UUID.randomUUID()}")
val libcxxStaging = File(mpvDir, "libcxx.staging-${UUID.randomUUID()}")
val unpackRoot = File(mpvDir, "unpack-${UUID.randomUUID()}")
try {
mpvAbis.forEach { abi ->
val unpack = File(unpackRoot, abi).apply { mkdirs() }
providers.exec {
commandLine(
"tar",
"-xzf",
File(mpvArchivesDir, stagedArchiveName(abi)).absolutePath,
"-C",
unpack.absolutePath
)
}.result.get().assertNormalExitValue()
val jniDir = File(nativeStaging, "jni/$abi")
File(unpack, "lib").listFiles()?.filter { it.isFile && it.name.endsWith(".so") }?.forEach { so ->
val target = if (so.name == "libc++_shared.so") {
File(libcxxStaging, "jni/$abi/${so.name}")
} else {
File(jniDir, so.name)
}
target.parentFile.mkdirs()
Files.move(so.toPath(), target.toPath())
}
// Headers are identical across ABIs; keep the first archive's copy.
val include = File(unpack, "include")
val includeTarget = File(nativeStaging, "include")
if (!includeTarget.exists() && include.isDirectory) {
include.copyRecursively(includeTarget)
}
}
val missing = buildList {
mpvAbis.forEach { abi ->
if (!File(nativeStaging, "jni/$abi/libmpv.so").isFile) add("native/jni/$abi/libmpv.so")
if (!File(nativeStaging, "jni/$abi/libavcodec.so").isFile) add("native/jni/$abi/libavcodec.so")
if (!File(libcxxStaging, "jni/$abi/libc++_shared.so").isFile) add("libcxx/jni/$abi/libc++_shared.so")
}
if (!File(nativeStaging, "include/mpv/client.h").isFile) add("native/include/mpv/client.h")
}
if (missing.isNotEmpty()) {
throw GradleException(
"mpv-build $mpvKey android archives are missing expected entries: ${missing.joinToString()}"
)
}
promoteDirectory(nativeStaging, mpvNativeDir)
promoteDirectory(libcxxStaging, mpvLibcxxDir)
} finally {
nativeStaging.deleteRecursively()
libcxxStaging.deleteRecursively()
unpackRoot.deleteRecursively()
}
}
}
android {
namespace = "com.edde746.plezy.libmpv"
compileSdk = 36
// Matches the app's latest stable NDK so every project-owned native library
// is built with the same 16 KB page-size-capable libc++ toolchain. That copy
// is NOT what ships: the app packages the mpv-build tarball's newer copy with
// top merge priority (see app/build.gradle.kts packaging { jniLibs } + sourceSets).
ndkVersion = "29.0.14206865"
defaultConfig {
// Fire OS 6.x (API 25), same floor as the app. The fork declared 26, but
// nothing in this API or glue uses anything above 25.
minSdk = 25
consumerProguardFiles("consumer-rules.pro")
externalNativeBuild {
cmake {
arguments += listOf(
"-DANDROID_STL=c++_shared",
"-DMPV_PREBUILT_ROOT=${mpvNativeDir.absolutePath}"
)
cFlags += "-Werror"
cppFlags += "-std=c++11"
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "4.1.2"
}
}
sourceSets {
getByName("main") {
// Prebuilt libmpv + FFmpeg .so files extracted from the mpv-build tarballs;
// the glue libplayer.so comes from the CMake build above.
jniLibs.srcDir(File(mpvNativeDir, "jni"))
}
}
}
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
// The imported libmpv.so/libavcodec.so must exist before CMake links the glue.
tasks.matching { it.name.contains("CMake") || it.name.contains("externalNative") }.configureEach {
dependsOn(extractLibmpvNative)
}
// Gradle snapshots jniLibs source dirs before task execution; this keeps the
// extracted prebuilt directory present during input discovery.
tasks.matching { it.name.startsWith("merge") && it.name.endsWith("JniLibFolders") }.configureEach {
dependsOn(extractLibmpvNative)
}
tasks.matching { it.name.startsWith("pre") && it.name.endsWith("Build") }.configureEach {
dependsOn(extractLibmpvNative)
}
dependencies {
// Same version the app pins; MpvPlayer's public flows compile against it.
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0")
}
+14
View File
@@ -0,0 +1,14 @@
# JNI exports bind by name (Java_com_edde746_plezy_libmpv_MpvPlayer_native*); keep the names stable.
-keepclasseswithmembernames class com.edde746.plezy.libmpv.* {
native <methods>;
}
# jni_utils.cpp caches MpvPlayer with FindClass and resolves these static callbacks
# with GetStaticMethodID on the native event thread. R8 sees no reference to the
# class name or the member names, so both must stay alive and un-renamed.
-keep class com.edde746.plezy.libmpv.MpvPlayer {
public static void onPropertyChanged(...);
public static void onEvent(int);
public static void onEndFile(int);
public static void onLogMessage(java.lang.String, int, java.lang.String);
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.22.1)
project("libmpv")
# The JNI glue this module compiles; MpvPlayer loads it with
# System.loadLibrary("player") after libmpv.so itself.
add_library(
player
SHARED
main.cpp render.cpp log.cpp jni_utils.cpp property.cpp event.cpp
)
# Prebuilt libraries extracted from the pinned mpv-build per-ABI tarballs by the
# extractLibmpvNative Gradle task; MPV_PREBUILT_ROOT points at its output.
add_library(
mpv
SHARED
IMPORTED
)
set_target_properties(
mpv
PROPERTIES IMPORTED_LOCATION
${MPV_PREBUILT_ROOT}/jni/${ANDROID_ABI}/libmpv.so
)
# av_jni_set_java_vm / av_jni_set_android_app_ctx (main.cpp) live in FFmpeg's
# libavcodec, which the same tarballs package.
add_library(
avcodec
SHARED
IMPORTED
)
set_target_properties(
avcodec
PROPERTIES IMPORTED_LOCATION
${MPV_PREBUILT_ROOT}/jni/${ANDROID_ABI}/libavcodec.so
)
# mpv public headers ride in the extracted tarballs next to libmpv.so; the
# vendored tree only carries FFmpeg's libavcodec/jni.h (see include/README.md).
include_directories( ${MPV_PREBUILT_ROOT}/include ${CMAKE_CURRENT_SOURCE_DIR}/include )
target_link_libraries( player mpv avcodec log )
+99
View File
@@ -0,0 +1,99 @@
#include <jni.h>
#include <mpv/client.h>
#include "globals.h"
#include "jni_utils.h"
#include "log.h"
static void sendPropertyUpdateToJava(JNIEnv* env, mpv_event_property* prop) {
jstring jprop = new_java_string(env, prop->name);
jstring jvalue = NULL;
switch (prop->format) {
case MPV_FORMAT_NONE:
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onPropertyChanged_S, jprop);
break;
case MPV_FORMAT_FLAG:
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onPropertyChanged_Sb, jprop, *(int*)prop->data);
break;
case MPV_FORMAT_INT64:
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onPropertyChanged_Sl, jprop, *(int64_t*)prop->data);
break;
case MPV_FORMAT_DOUBLE:
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onPropertyChanged_Sd, jprop, *(double*)prop->data);
break;
case MPV_FORMAT_STRING:
jvalue = new_java_string(env, *(const char**)prop->data);
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onPropertyChanged_SS, jprop, jvalue);
break;
default:
break;
}
if (jprop) env->DeleteLocalRef(jprop);
if (jvalue) env->DeleteLocalRef(jvalue);
}
static void sendEventToJava(JNIEnv* env, int event) {
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onEvent, event);
}
static void sendEndFileToJava(JNIEnv* env, mpv_event* event) {
mpv_event_end_file* end_file = (mpv_event_end_file*)event->data;
int reason = end_file ? end_file->reason : -1;
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onEndFile, (jint)reason);
}
static void sendLogMessageToJava(JNIEnv* env, mpv_event_log_message* msg) {
jstring jprefix = new_java_string(env, msg->prefix);
jstring jtext = new_java_string(env, msg->text);
env->CallStaticVoidMethod(mpv_MpvPlayer, mpv_MpvPlayer_onLogMessage, jprefix, (jint)msg->log_level, jtext);
if (jprefix) env->DeleteLocalRef(jprefix);
if (jtext) env->DeleteLocalRef(jtext);
}
void* event_thread(void* arg) {
JNIEnv* env = NULL;
acquire_jni_env(g_vm, &env);
if (!env) die("failed to acquire java env");
while (true) {
mpv_event* mp_event;
mpv_event_property* mp_property;
mpv_event_log_message* msg;
mp_event = mpv_wait_event(g_mpv, -1.0);
if (g_event_thread_request_exit) break;
if (mp_event->event_id == MPV_EVENT_NONE) continue;
switch (mp_event->event_id) {
case MPV_EVENT_LOG_MESSAGE:
msg = (mpv_event_log_message*)mp_event->data;
ALOGV("[%s:%s] %s", msg->prefix, msg->level, msg->text);
sendLogMessageToJava(env, msg);
break;
case MPV_EVENT_PROPERTY_CHANGE:
mp_property = (mpv_event_property*)mp_event->data;
sendPropertyUpdateToJava(env, mp_property);
break;
case MPV_EVENT_END_FILE:
sendEndFileToJava(env, mp_event);
break;
case MPV_EVENT_START_FILE:
case MPV_EVENT_FILE_LOADED:
case MPV_EVENT_PLAYBACK_RESTART:
ALOGV("event: %s\n", mpv_event_name(mp_event->event_id));
sendEventToJava(env, mp_event->event_id);
break;
default:
// Nothing on the Kotlin side consumes the remaining ids (MpvEvent.fromId).
break;
}
}
g_vm->DetachCurrentThread();
return NULL;
}
+3
View File
@@ -0,0 +1,3 @@
#pragma once
void* event_thread(void* arg);
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include <jni.h>
#include <mpv/client.h>
#include <atomic>
extern JavaVM* g_vm;
extern mpv_handle* g_mpv;
extern std::atomic<bool> g_event_thread_request_exit;
@@ -0,0 +1,15 @@
# Vendored native headers
Build-time headers for the JNI glue in this module; nothing here ships in the APK.
Each file carries its own upstream license text — none is modified.
- `libavcodec/jni.h` — FFmpeg n8.0.1 (https://github.com/FFmpeg/FFmpeg, tag `n8.0.1`,
commit `894da5ca7d742e4429ffb2af534fcda0103ef593`), copied unmodified. Declares
`av_jni_set_java_vm` / `av_jni_set_android_app_ctx`, which `main.cpp` calls into the
`libavcodec.so` packaged by the pinned mpv-build tarballs (FFmpeg 8.0.1 — the
version `app/build.gradle.kts` also pins for the Media3 adapter headers).
The mpv public headers (`mpv/client.h`, `mpv/render.h`, `mpv/render_gl.h`,
`mpv/stream_cb.h`) are no longer vendored: each mpv-build per-ABI tarball carries
`include/mpv/*.h` matching its `libmpv.so`, and `extractLibmpvNative` places them
under `native/include`, which CMake reads via `MPV_PREBUILT_ROOT`.
@@ -0,0 +1,67 @@
/*
* JNI public API functions
*
* Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_JNI_H
#define AVCODEC_JNI_H
/*
* Manually set a Java virtual machine which will be used to retrieve the JNI
* environment. Once a Java VM is set it cannot be changed afterwards, meaning
* you can call multiple times av_jni_set_java_vm with the same Java VM pointer
* however it will error out if you try to set a different Java VM.
*
* @param vm Java virtual machine
* @param log_ctx context used for logging, can be NULL
* @return 0 on success, < 0 otherwise
*/
int av_jni_set_java_vm(void *vm, void *log_ctx);
/*
* Get the Java virtual machine which has been set with av_jni_set_java_vm.
*
* @param vm Java virtual machine
* @return a pointer to the Java virtual machine
*/
void *av_jni_get_java_vm(void *log_ctx);
/*
* Set the Android application context which will be used to retrieve the Android
* content resolver to handle content uris.
*
* This function is only available on Android.
*
* @param app_ctx global JNI reference to the Android application context
* @return 0 on success, < 0 otherwise
*/
int av_jni_set_android_app_ctx(void *app_ctx, void *log_ctx);
/*
* Get the Android application context that has been set with
* av_jni_set_android_app_ctx.
*
* This function is only available on Android.
*
* @return a pointer the the Android application context
*/
void *av_jni_get_android_app_ctx(void);
#endif /* AVCODEC_JNI_H */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,760 @@
/* Copyright (C) 2018 the mpv developers
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef MPV_CLIENT_API_RENDER_H_
#define MPV_CLIENT_API_RENDER_H_
#include "client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Overview
* --------
*
* This API can be used to make mpv render using supported graphic APIs (such
* as OpenGL). It can be used to handle video display.
*
* The renderer needs to be created with mpv_render_context_create() before
* you start playback (or otherwise cause a VO to be created). Then (with most
* backends) mpv_render_context_render() can be used to explicitly render the
* current video frame. Use mpv_render_context_set_update_callback() to get
* notified when there is a new frame to draw.
*
* Preferably rendering should be done in a separate thread. If you call
* normal libmpv API functions on the renderer thread, deadlocks can result
* (these are made non-fatal with timeouts, but user experience will obviously
* suffer). See "Threading" section below.
*
* You can output and embed video without this API by setting the mpv "wid"
* option to a native window handle (see "Embedding the video window" section
* in the client.h header). In general, using the render API is recommended,
* because window embedding can cause various issues, especially with GUI
* toolkits and certain platforms.
*
* Supported backends
* ------------------
*
* OpenGL: via MPV_RENDER_API_TYPE_OPENGL, see render_gl.h header.
* Software: via MPV_RENDER_API_TYPE_SW, see section "Software renderer"
*
* Threading
* ---------
*
* You are recommended to do rendering on a separate thread than normal libmpv
* use.
*
* The mpv_render_* functions can be called from any thread, under the
* following conditions:
* - only one of the mpv_render_* functions can be called at the same time
* (unless they belong to different mpv cores created by mpv_create())
* - never can be called from within the callbacks set with
* mpv_set_wakeup_callback() or mpv_render_context_set_update_callback()
* - if the OpenGL backend is used, for all functions the OpenGL context
* must be "current" in the calling thread, and it must be the same OpenGL
* context as the mpv_render_context was created with. Otherwise, undefined
* behavior will occur.
* - the thread does not call libmpv API functions other than the mpv_render_*
* functions, except APIs which are declared as safe (see below). Likewise,
* there must be no lock or wait dependency from the render thread to a
* thread using other libmpv functions. Basically, the situation that your
* render thread waits for a "not safe" libmpv API function to return must
* not happen. If you ignore this requirement, deadlocks can happen, which
* are made non-fatal with timeouts; then playback quality will be degraded,
* and the message
* mpv_render_context_render() not being called or stuck.
* is logged. If you set MPV_RENDER_PARAM_ADVANCED_CONTROL, you promise that
* this won't happen, and must absolutely guarantee it, or a real deadlock
* will freeze the mpv core thread forever.
*
* libmpv functions which are safe to call from a render thread are:
* - functions marked with "Safe to be called from mpv render API threads."
* - client.h functions which don't have an explicit or implicit mpv_handle
* parameter
* - mpv_render_* functions; but only for the same mpv_render_context pointer.
* If the pointer is different, mpv_render_context_free() is not safe. (The
* reason is that if MPV_RENDER_PARAM_ADVANCED_CONTROL is set, it may have
* to process still queued requests from the core, which it can do only for
* the current context, while requests for other contexts would deadlock.
* Also, it may have to wait and block for the core to terminate the video
* chain to make sure no resources are used after context destruction.)
* - if the mpv_handle parameter refers to a different mpv core than the one
* you're rendering for (very obscure, but allowed)
*
* Note about old libmpv version:
*
* Before API version 1.105 (basically in mpv 0.29.x), simply enabling
* MPV_RENDER_PARAM_ADVANCED_CONTROL could cause deadlock issues. This can
* be worked around by setting the "vd-lavc-dr" option to "no".
* In addition, you were required to call all mpv_render*() API functions
* from the same thread on which mpv_render_context_create() was originally
* run (for the same the mpv_render_context). Not honoring it led to UB
* (deadlocks, use of invalid mp_thread handles), even if you moved your GL
* context to a different thread correctly.
* These problems were addressed in API version 1.105 (mpv 0.30.0).
*
* Context and handle lifecycle
* ----------------------------
*
* Video initialization will fail if the render context was not initialized yet
* (with mpv_render_context_create()), or it will revert to a VO that creates
* its own window.
*
* Currently, there can be only 1 mpv_render_context at a time per mpv core.
*
* Calling mpv_render_context_free() while a VO is using the render context is
* active will disable video.
*
* You must free the context with mpv_render_context_free() before the mpv core
* is destroyed. If this doesn't happen, undefined behavior will result.
*
* Software renderer
* -----------------
*
* MPV_RENDER_API_TYPE_SW provides an extremely simple (but slow) renderer to
* memory surfaces. You probably don't want to use this. Use other render API
* types, or other methods of video embedding.
*
* Use mpv_render_context_create() with MPV_RENDER_PARAM_API_TYPE set to
* MPV_RENDER_API_TYPE_SW.
*
* Call mpv_render_context_render() with various MPV_RENDER_PARAM_SW_* fields
* to render the video frame to an in-memory surface. The following fields are
* required: MPV_RENDER_PARAM_SW_SIZE, MPV_RENDER_PARAM_SW_FORMAT,
* MPV_RENDER_PARAM_SW_STRIDE, MPV_RENDER_PARAM_SW_POINTER.
*
* This method of rendering is very slow, because everything, including color
* conversion, scaling, and OSD rendering, is done on the CPU, single-threaded.
* In particular, large video or display sizes, as well as presence of OSD or
* subtitles can make it too slow for realtime. As with other software rendering
* VOs, setting "sw-fast" may help. Enabling or disabling zimg may help,
* depending on the platform.
*
* In addition, certain multimedia job creation measures like HDR may not work
* properly, and will have to be manually handled by for example inserting
* filters.
*
* This API is not really suitable to extract individual frames from video etc.
* (basically non-playback uses) - there are better libraries for this. It can
* be used this way, but it may be clunky and tricky.
*
* Further notes:
* - MPV_RENDER_PARAM_FLIP_Y is currently ignored (unsupported)
* - MPV_RENDER_PARAM_DEPTH is ignored (meaningless)
*/
/**
* Opaque context, returned by mpv_render_context_create().
*/
typedef struct mpv_render_context mpv_render_context;
/**
* Parameters for mpv_render_param (which is used in a few places such as
* mpv_render_context_create().
*
* Also see mpv_render_param for conventions and how to use it.
*/
typedef enum mpv_render_param_type {
/**
* Not a valid value, but also used to terminate a params array. Its value
* is always guaranteed to be 0 (even if the ABI changes in the future).
*/
MPV_RENDER_PARAM_INVALID = 0,
/**
* The render API to use. Valid for mpv_render_context_create().
*
* Type: char*
*
* Defined APIs:
*
* MPV_RENDER_API_TYPE_OPENGL:
* OpenGL desktop 2.1 or later (preferably core profile compatible to
* OpenGL 3.2), or OpenGLES 2.0 or later.
* Providing MPV_RENDER_PARAM_OPENGL_INIT_PARAMS is required.
* It is expected that an OpenGL context is valid and "current" when
* calling mpv_render_* functions (unless specified otherwise). It
* must be the same context for the same mpv_render_context.
*/
MPV_RENDER_PARAM_API_TYPE = 1,
/**
* Required parameters for initializing the OpenGL renderer. Valid for
* mpv_render_context_create().
* Type: mpv_opengl_init_params*
*/
MPV_RENDER_PARAM_OPENGL_INIT_PARAMS = 2,
/**
* Describes a GL render target. Valid for mpv_render_context_render().
* Type: mpv_opengl_fbo*
*/
MPV_RENDER_PARAM_OPENGL_FBO = 3,
/**
* Control flipped rendering. Valid for mpv_render_context_render().
* Type: int*
* If the value is set to 0, render normally. Otherwise, render it flipped,
* which is needed e.g. when rendering to an OpenGL default framebuffer
* (which has a flipped coordinate system).
*/
MPV_RENDER_PARAM_FLIP_Y = 4,
/**
* Control surface depth. Valid for mpv_render_context_render().
* Type: int*
* This implies the depth of the surface passed to the render function in
* bits per channel. If omitted or set to 0, the renderer will assume 8.
* Typically used to control dithering.
*/
MPV_RENDER_PARAM_DEPTH = 5,
/**
* ICC profile blob. Valid for mpv_render_context_set_parameter().
* Type: mpv_byte_array*
* Set an ICC profile for use with the "icc-profile-auto" option. (If the
* option is not enabled, the ICC data will not be used.)
*/
MPV_RENDER_PARAM_ICC_PROFILE = 6,
/**
* Deprecated
* Ambient light in lux. Valid for mpv_render_context_set_parameter().
* Type: int*
* This can be used for automatic gamma correction.
*/
MPV_RENDER_PARAM_AMBIENT_LIGHT = 7,
/**
* X11 Display, sometimes used for hwdec. Valid for
* mpv_render_context_create(). The Display must stay valid for the lifetime
* of the mpv_render_context.
* Type: Display*
*/
MPV_RENDER_PARAM_X11_DISPLAY = 8,
/**
* Wayland display, sometimes used for hwdec. Valid for
* mpv_render_context_create(). The wl_display must stay valid for the
* lifetime of the mpv_render_context.
* Type: struct wl_display*
*/
MPV_RENDER_PARAM_WL_DISPLAY = 9,
/**
* Better control about rendering and enabling some advanced features. Valid
* for mpv_render_context_create().
*
* This conflates multiple requirements the API user promises to abide if
* this option is enabled:
*
* - The API user's render thread, which is calling the mpv_render_*()
* functions, never waits for the core. Otherwise deadlocks can happen.
* See "Threading" section.
* - The callback set with mpv_render_context_set_update_callback() can now
* be called even if there is no new frame. The API user should call the
* mpv_render_context_update() function, and interpret the return value
* for whether a new frame should be rendered.
* - Correct functionality is impossible if the update callback is not set,
* or not set soon enough after mpv_render_context_create() (the core can
* block while waiting for you to call mpv_render_context_update(), and
* if the update callback is not correctly set, it will deadlock, or
* block for too long).
*
* In general, setting this option will enable the following features (and
* possibly more):
*
* - "Direct rendering", which means the player decodes directly to a
* texture, which saves a copy per video frame ("vd-lavc-dr" option
* needs to be enabled, and the rendering backend as well as the
* underlying GPU API/driver needs to have support for it).
* - Rendering screenshots with the GPU API if supported by the backend
* (instead of using a suboptimal software fallback via libswscale).
*
* Warning: do not just add this without reading the "Threading" section
* above, and then wondering that deadlocks happen. The
* requirements are tricky. But also note that even if advanced
* control is disabled, not adhering to the rules will lead to
* playback problems. Enabling advanced controls simply makes
* violating these rules fatal.
*
* Type: int*: 0 for disable (default), 1 for enable
*/
MPV_RENDER_PARAM_ADVANCED_CONTROL = 10,
/**
* Return information about the next frame to render. Valid for
* mpv_render_context_get_info().
*
* Type: mpv_render_frame_info*
*
* It strictly returns information about the _next_ frame. The implication
* is that e.g. mpv_render_context_update()'s return value will have
* MPV_RENDER_UPDATE_FRAME set, and the user is supposed to call
* mpv_render_context_render(). If there is no next frame, then the
* return value will have is_valid set to 0.
*/
MPV_RENDER_PARAM_NEXT_FRAME_INFO = 11,
/**
* Enable or disable video timing. Valid for mpv_render_context_render().
*
* Type: int*: 0 for disable, 1 for enable (default)
*
* When video is timed to audio, the player attempts to render video a bit
* ahead, and then do a blocking wait until the target display time is
* reached. This blocks mpv_render_context_render() for up to the amount
* specified with the "video-timing-offset" global option. You can set
* this parameter to 0 to disable this kind of waiting. If you do, it's
* recommended to use the target time value in mpv_render_frame_info to
* wait yourself, or to set the "video-timing-offset" to 0 instead.
*
* Disabling this without doing anything in addition will result in A/V sync
* being slightly off.
*/
MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME = 12,
/**
* Use to skip rendering in mpv_render_context_render().
*
* Type: int*: 0 for rendering (default), 1 for skipping
*
* If this is set, you don't need to pass a target surface to the render
* function (and if you do, it's completely ignored). This can still call
* into the lower level APIs (i.e. if you use OpenGL, the OpenGL context
* must be set).
*
* Be aware that the render API will consider this frame as having been
* rendered. All other normal rules also apply, for example about whether
* you have to call mpv_render_context_report_swap(). It also does timing
* in the same way.
*/
MPV_RENDER_PARAM_SKIP_RENDERING = 13,
/**
* Deprecated. Not supported. Use MPV_RENDER_PARAM_DRM_DISPLAY_V2 instead.
* Type : struct mpv_opengl_drm_params*
*/
MPV_RENDER_PARAM_DRM_DISPLAY = 14,
/**
* DRM draw surface size, contains draw surface dimensions.
* Valid for mpv_render_context_create().
* Type : struct mpv_opengl_drm_draw_surface_size*
*/
MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE = 15,
/**
* DRM display, contains drm display handles.
* Valid for mpv_render_context_create().
* Type : struct mpv_opengl_drm_params_v2*
*/
MPV_RENDER_PARAM_DRM_DISPLAY_V2 = 16,
/**
* MPV_RENDER_API_TYPE_SW only: rendering target surface size, mandatory.
* Valid for MPV_RENDER_API_TYPE_SW & mpv_render_context_render().
* Type: int[2] (e.g.: int s[2] = {w, h}; param.data = &s[0];)
*
* The video frame is transformed as with other VOs. Typically, this means
* the video gets scaled and black bars are added if the video size or
* aspect ratio mismatches with the target size.
*/
MPV_RENDER_PARAM_SW_SIZE = 17,
/**
* MPV_RENDER_API_TYPE_SW only: rendering target surface pixel format,
* mandatory.
* Valid for MPV_RENDER_API_TYPE_SW & mpv_render_context_render().
* Type: char* (e.g.: char *f = "rgb0"; param.data = f;)
*
* Valid values are:
* "rgb0", "bgr0", "0bgr", "0rgb"
* 4 bytes per pixel RGB, 1 byte (8 bit) per component, component bytes
* with increasing address from left to right (e.g. "rgb0" has r at
* address 0), the "0" component contains uninitialized garbage (often
* the value 0, but not necessarily; the bad naming is inherited from
* FFmpeg)
* Pixel alignment size: 4 bytes
* "rgb24"
* 3 bytes per pixel RGB. This is strongly discouraged because it is
* very slow.
* Pixel alignment size: 1 bytes
* other
* The API may accept other pixel formats, using mpv internal format
* names, as long as it's internally marked as RGB, has exactly 1
* plane, and is supported as conversion output. It is not a good idea
* to rely on any of these. Their semantics and handling could change.
*/
MPV_RENDER_PARAM_SW_FORMAT = 18,
/**
* MPV_RENDER_API_TYPE_SW only: rendering target surface bytes per line,
* mandatory.
* Valid for MPV_RENDER_API_TYPE_SW & mpv_render_context_render().
* Type: size_t*
*
* This is the number of bytes between a pixel (x, y) and (x, y + 1) on the
* target surface. It must be a multiple of the pixel size, and have space
* for the surface width as specified by MPV_RENDER_PARAM_SW_SIZE.
*
* Both stride and pointer value should be a multiple of 64 to facilitate
* fast SIMD operation. Lower alignment might trigger slower code paths,
* and in the worst case, will copy the entire target frame. If mpv is built
* with zimg (and zimg is not disabled), the performance impact might be
* less.
* In either cases, the pointer and stride must be aligned at least to the
* pixel alignment size. Otherwise, crashes and undefined behavior is
* possible on platforms which do not support unaligned accesses (either
* through normal memory access or aligned SIMD memory access instructions).
*/
MPV_RENDER_PARAM_SW_STRIDE = 19,
/*
* MPV_RENDER_API_TYPE_SW only: rendering target surface pixel data pointer,
* mandatory.
* Valid for MPV_RENDER_API_TYPE_SW & mpv_render_context_render().
* Type: void*
*
* This points to the first pixel at the left/top corner (0, 0). In
* particular, each line y starts at (pointer + stride * y). Upon rendering,
* all data between pointer and (pointer + stride * h) is overwritten.
* Whether the padding between (w, y) and (0, y + 1) is overwritten is left
* unspecified (it should not be, but unfortunately some scaler backends
* will do it anyway). It is assumed that even the padding after the last
* line (starting at bytepos(w, h) until (pointer + stride * h)) is
* writable.
*
* See MPV_RENDER_PARAM_SW_STRIDE for alignment requirements.
*/
MPV_RENDER_PARAM_SW_POINTER = 20,
} mpv_render_param_type;
/**
* For backwards compatibility with the old naming of
* MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE
*/
#define MPV_RENDER_PARAM_DRM_OSD_SIZE MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE
/**
* Used to pass arbitrary parameters to some mpv_render_* functions. The
* meaning of the data parameter is determined by the type, and each
* MPV_RENDER_PARAM_* documents what type the value must point to.
*
* Each value documents the required data type as the pointer you cast to
* void* and set on mpv_render_param.data. For example, if MPV_RENDER_PARAM_FOO
* documents the type as Something* , then the code should look like this:
*
* Something foo = {...};
* mpv_render_param param;
* param.type = MPV_RENDER_PARAM_FOO;
* param.data = & foo;
*
* Normally, the data field points to exactly 1 object. If the type is char*,
* it points to a 0-terminated string.
*
* In all cases (unless documented otherwise) the pointers need to remain
* valid during the call only. Unless otherwise documented, the API functions
* will not write to the params array or any data pointed to it.
*
* As a convention, parameter arrays are always terminated by type==0. There
* is no specific order of the parameters required. The order of the 2 fields in
* this struct is guaranteed (even after ABI changes).
*/
typedef struct mpv_render_param {
enum mpv_render_param_type type;
void *data;
} mpv_render_param;
/**
* Predefined values for MPV_RENDER_PARAM_API_TYPE.
*/
// See render_gl.h
#define MPV_RENDER_API_TYPE_OPENGL "opengl"
// See section "Software renderer"
#define MPV_RENDER_API_TYPE_SW "sw"
/**
* Flags used in mpv_render_frame_info.flags. Each value represents a bit in it.
*/
typedef enum mpv_render_frame_info_flag {
/**
* Set if there is actually a next frame. If unset, there is no next frame
* yet, and other flags and fields that require a frame to be queued will
* be unset.
*
* This is set for _any_ kind of frame, even for redraw requests.
*
* Note that when this is unset, it simply means no new frame was
* decoded/queued yet, not necessarily that the end of the video was
* reached. A new frame can be queued after some time.
*
* If the return value of mpv_render_context_render() had the
* MPV_RENDER_UPDATE_FRAME flag set, this flag will usually be set as well,
* unless the frame is rendered, or discarded by other asynchronous events.
*/
MPV_RENDER_FRAME_INFO_PRESENT = 1 << 0,
/**
* If set, the frame is not an actual new video frame, but a redraw request.
* For example if the video is paused, and an option that affects video
* rendering was changed (or any other reason), an update request can be
* issued and this flag will be set.
*
* Typically, redraw frames will not be subject to video timing.
*
* Implies MPV_RENDER_FRAME_INFO_PRESENT.
*/
MPV_RENDER_FRAME_INFO_REDRAW = 1 << 1,
/**
* If set, this is supposed to reproduce the previous frame perfectly. This
* is usually used for certain "video-sync" options ("display-..." modes).
* Typically the renderer will blit the video from a FBO. Unset otherwise.
*
* Implies MPV_RENDER_FRAME_INFO_PRESENT.
*/
MPV_RENDER_FRAME_INFO_REPEAT = 1 << 2,
/**
* If set, the player timing code expects that the user thread blocks on
* vsync (by either delaying the render call, or by making a call to
* mpv_render_context_report_swap() at vsync time).
*
* Implies MPV_RENDER_FRAME_INFO_PRESENT.
*/
MPV_RENDER_FRAME_INFO_BLOCK_VSYNC = 1 << 3,
} mpv_render_frame_info_flag;
/**
* Information about the next video frame that will be rendered. Can be
* retrieved with MPV_RENDER_PARAM_NEXT_FRAME_INFO.
*/
typedef struct mpv_render_frame_info {
/**
* A bitset of mpv_render_frame_info_flag values (i.e. multiple flags are
* combined with bitwise or).
*/
uint64_t flags;
/**
* Absolute time at which the frame is supposed to be displayed. This is in
* the same unit and base as the time returned by mpv_get_time_us(). For
* frames that are redrawn, or if vsync locked video timing is used (see
* "video-sync" option), then this can be 0. The "video-timing-offset"
* option determines how much "headroom" the render thread gets (but a high
* enough frame rate can reduce it anyway). mpv_render_context_render() will
* normally block until the time is elapsed, unless you pass it
* MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME = 0.
*/
int64_t target_time;
} mpv_render_frame_info;
/**
* Initialize the renderer state. Depending on the backend used, this will
* access the underlying GPU API and initialize its own objects.
*
* You must free the context with mpv_render_context_free(). Not doing so before
* the mpv core is destroyed may result in memory leaks or crashes.
*
* Currently, only at most 1 context can exists per mpv core (it represents the
* main video output).
*
* You should pass the following parameters:
* - MPV_RENDER_PARAM_API_TYPE to select the underlying backend/GPU API.
* - Backend-specific init parameter, like MPV_RENDER_PARAM_OPENGL_INIT_PARAMS.
* - Setting MPV_RENDER_PARAM_ADVANCED_CONTROL and following its rules is
* strongly recommended.
* - If you want to use hwdec, possibly hwdec interop resources.
*
* @param res set to the context (on success) or NULL (on failure). The value
* is never read and always overwritten.
* @param mpv handle used to get the core (the mpv_render_context won't depend
* on this specific handle, only the core referenced by it)
* @param params an array of parameters, terminated by type==0. It's left
* unspecified what happens with unknown parameters. At least
* MPV_RENDER_PARAM_API_TYPE is required, and most backends will
* require another backend-specific parameter.
* @return error code, including but not limited to:
* MPV_ERROR_UNSUPPORTED: the OpenGL version is not supported
* (or required extensions are missing)
* MPV_ERROR_NOT_IMPLEMENTED: an unknown API type was provided, or
* support for the requested API was not
* built in the used libmpv binary.
* MPV_ERROR_INVALID_PARAMETER: at least one of the provided parameters was
* not valid.
*/
MPV_EXPORT int mpv_render_context_create(mpv_render_context **res, mpv_handle *mpv,
mpv_render_param *params);
/**
* Attempt to change a single parameter. Not all backends and parameter types
* support all kinds of changes.
*
* @param ctx a valid render context
* @param param the parameter type and data that should be set
* @return error code. If a parameter could actually be changed, this returns
* success, otherwise an error code depending on the parameter type
* and situation.
*/
MPV_EXPORT int mpv_render_context_set_parameter(mpv_render_context *ctx,
mpv_render_param param);
/**
* Retrieve information from the render context. This is NOT a counterpart to
* mpv_render_context_set_parameter(), because you generally can't read
* parameters set with it, and this function is not meant for this purpose.
* Instead, this is for communicating information from the renderer back to the
* user. See mpv_render_param_type; entries which support this function
* explicitly mention it, and for other entries you can assume it will fail.
*
* You pass param with param.type set and param.data pointing to a variable
* of the required data type. The function will then overwrite that variable
* with the returned value (at least on success).
*
* @param ctx a valid render context
* @param param the parameter type and data that should be retrieved
* @return error code. If a parameter could actually be retrieved, this returns
* success, otherwise an error code depending on the parameter type
* and situation. MPV_ERROR_NOT_IMPLEMENTED is used for unknown
* param.type, or if retrieving it is not supported.
*/
MPV_EXPORT int mpv_render_context_get_info(mpv_render_context *ctx,
mpv_render_param param);
typedef void (*mpv_render_update_fn)(void *cb_ctx);
/**
* Set the callback that notifies you when a new video frame is available, or
* if the video display configuration somehow changed and requires a redraw.
* Similar to mpv_set_wakeup_callback(), you must not call any mpv API from
* the callback, and all the other listed restrictions apply (such as not
* exiting the callback by throwing exceptions).
*
* This can be called from any thread, except from an update callback. In case
* of the OpenGL backend, no OpenGL state or API is accessed.
*
* Calling this will raise an update callback immediately.
*
* @param callback callback(callback_ctx) is called if the frame should be
* redrawn
* @param callback_ctx opaque argument to the callback
*/
MPV_EXPORT void mpv_render_context_set_update_callback(mpv_render_context *ctx,
mpv_render_update_fn callback,
void *callback_ctx);
/**
* The API user is supposed to call this when the update callback was invoked
* (like all mpv_render_* functions, this has to happen on the render thread,
* and _not_ from the update callback itself).
*
* This is optional if MPV_RENDER_PARAM_ADVANCED_CONTROL was not set (default).
* Otherwise, it's a hard requirement that this is called after each update
* callback. If multiple update callback happened, and the function could not
* be called sooner, it's OK to call it once after the last callback.
*
* If an update callback happens during or after this function, the function
* must be called again at the soonest possible time.
*
* If MPV_RENDER_PARAM_ADVANCED_CONTROL was set, this will do additional work
* such as allocating textures for the video decoder.
*
* @return a bitset of mpv_render_update_flag values (i.e. multiple flags are
* combined with bitwise or). Typically, this will tell the API user
* what should happen next. E.g. if the MPV_RENDER_UPDATE_FRAME flag is
* set, mpv_render_context_render() should be called. If flags unknown
* to the API user are set, or if the return value is 0, nothing needs
* to be done.
*/
MPV_EXPORT uint64_t mpv_render_context_update(mpv_render_context *ctx);
/**
* Flags returned by mpv_render_context_update(). Each value represents a bit
* in the function's return value.
*/
typedef enum mpv_render_update_flag {
/**
* A new video frame must be rendered. mpv_render_context_render() must be
* called.
*/
MPV_RENDER_UPDATE_FRAME = 1 << 0,
} mpv_render_context_flag;
/**
* Render video.
*
* Typically renders the video to a target surface provided via mpv_render_param
* (the details depend on the backend in use). Options like "panscan" are
* applied to determine which part of the video should be visible and how the
* video should be scaled. You can change these options at runtime by using the
* mpv property API.
*
* The renderer will reconfigure itself every time the target surface
* configuration (such as size) is changed.
*
* This function implicitly pulls a video frame from the internal queue and
* renders it. If no new frame is available, the previous frame is redrawn.
* The update callback set with mpv_render_context_set_update_callback()
* notifies you when a new frame was added. The details potentially depend on
* the backends and the provided parameters.
*
* Generally, libmpv will invoke your update callback some time before the video
* frame should be shown, and then lets this function block until the supposed
* display time. This will limit your rendering to video FPS. You can prevent
* this by setting the "video-timing-offset" global option to 0. (This applies
* only to "audio" video sync mode.)
*
* You should pass the following parameters:
* - Backend-specific target object, such as MPV_RENDER_PARAM_OPENGL_FBO.
* - Possibly transformations, such as MPV_RENDER_PARAM_FLIP_Y.
*
* @param ctx a valid render context
* @param params an array of parameters, terminated by type==0. Which parameters
* are required depends on the backend. It's left unspecified what
* happens with unknown parameters.
* @return error code
*/
MPV_EXPORT int mpv_render_context_render(mpv_render_context *ctx, mpv_render_param *params);
/**
* Tell the renderer that a frame was flipped at the given time. This is
* optional, but can help the player to achieve better timing.
*
* Note that calling this at least once informs libmpv that you will use this
* function. If you use it inconsistently, expect bad video playback.
*
* If this is called while no video is initialized, it is ignored.
*
* @param ctx a valid render context
*/
MPV_EXPORT void mpv_render_context_report_swap(mpv_render_context *ctx);
/**
* Destroy the mpv renderer state.
*
* If video is still active (e.g. a file playing), video will be disabled
* forcefully.
*
* @param ctx a valid render context. After this function returns, this is not
* a valid pointer anymore. NULL is also allowed and does nothing.
*/
MPV_EXPORT void mpv_render_context_free(mpv_render_context *ctx);
#ifdef MPV_CPLUGIN_DYNAMIC_SYM
MPV_DEFINE_SYM_PTR(mpv_render_context_create)
#define mpv_render_context_create pfn_mpv_render_context_create
MPV_DEFINE_SYM_PTR(mpv_render_context_set_parameter)
#define mpv_render_context_set_parameter pfn_mpv_render_context_set_parameter
MPV_DEFINE_SYM_PTR(mpv_render_context_get_info)
#define mpv_render_context_get_info pfn_mpv_render_context_get_info
MPV_DEFINE_SYM_PTR(mpv_render_context_set_update_callback)
#define mpv_render_context_set_update_callback pfn_mpv_render_context_set_update_callback
MPV_DEFINE_SYM_PTR(mpv_render_context_update)
#define mpv_render_context_update pfn_mpv_render_context_update
MPV_DEFINE_SYM_PTR(mpv_render_context_render)
#define mpv_render_context_render pfn_mpv_render_context_render
MPV_DEFINE_SYM_PTR(mpv_render_context_report_swap)
#define mpv_render_context_report_swap pfn_mpv_render_context_report_swap
MPV_DEFINE_SYM_PTR(mpv_render_context_free)
#define mpv_render_context_free pfn_mpv_render_context_free
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,211 @@
/* Copyright (C) 2018 the mpv developers
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef MPV_CLIENT_API_RENDER_GL_H_
#define MPV_CLIENT_API_RENDER_GL_H_
#include "render.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* OpenGL backend
* --------------
*
* This header contains definitions for using OpenGL with the render.h API.
*
* OpenGL interop
* --------------
*
* The OpenGL backend has some special rules, because OpenGL itself uses
* implicit per-thread contexts, which causes additional API problems.
*
* This assumes the OpenGL context lives on a certain thread controlled by the
* API user. All mpv_render_* APIs have to be assumed to implicitly use the
* OpenGL context if you pass a mpv_render_context using the OpenGL backend,
* unless specified otherwise.
*
* The OpenGL context is indirectly accessed through the OpenGL function
* pointers returned by the get_proc_address callback in mpv_opengl_init_params.
* Generally, mpv will not load the system OpenGL library when using this API.
*
* OpenGL state
* ------------
*
* OpenGL has a large amount of implicit state. All the mpv functions mentioned
* above expect that the OpenGL state is reasonably set to OpenGL standard
* defaults. Likewise, mpv will attempt to leave the OpenGL context with
* standard defaults. The following state is excluded from this:
*
* - the glViewport state
* - the glScissor state (but GL_SCISSOR_TEST is in its default value)
* - glBlendFuncSeparate() state (but GL_BLEND is in its default value)
* - glClearColor() state
* - mpv may overwrite the callback set with glDebugMessageCallback()
* - mpv always disables GL_DITHER at init
*
* Messing with the state could be avoided by creating shared OpenGL contexts,
* but this is avoided for the sake of compatibility and interoperability.
*
* On OpenGL 2.1, mpv will strictly call functions like glGenTextures() to
* create OpenGL objects. You will have to do the same. This ensures that
* objects created by mpv and the API users don't clash. Also, legacy state
* must be either in its defaults, or not interfere with core state.
*
* API use
* -------
*
* The mpv_render_* API is used. That API supports multiple backends, and this
* section documents specifics for the OpenGL backend.
*
* Use mpv_render_context_create() with MPV_RENDER_PARAM_API_TYPE set to
* MPV_RENDER_API_TYPE_OPENGL, and MPV_RENDER_PARAM_OPENGL_INIT_PARAMS provided.
*
* Call mpv_render_context_render() with MPV_RENDER_PARAM_OPENGL_FBO to render
* the video frame to an FBO.
*
* Hardware decoding
* -----------------
*
* Hardware decoding via this API is fully supported, but requires some
* additional setup. (At least if direct hardware decoding modes are wanted,
* instead of copying back surface data from GPU to CPU RAM.)
*
* There may be certain requirements on the OpenGL implementation:
*
* - Windows: ANGLE is required (although in theory GL/DX interop could be used)
* - Intel/Linux: EGL is required, and also the native display resource needs
* to be provided (e.g. MPV_RENDER_PARAM_X11_DISPLAY for X11 and
* MPV_RENDER_PARAM_WL_DISPLAY for Wayland)
* - nVidia/Linux: Both GLX and EGL should work (GLX is required if vdpau is
* used, e.g. due to old drivers.)
* - macOS: CGL is required (CGLGetCurrentContext() returning non-NULL)
* - iOS: EAGL is required (EAGLContext.currentContext returning non-nil)
*
* Once these things are setup, hardware decoding can be enabled/disabled at
* any time by setting the "hwdec" property.
*/
/**
* For initializing the mpv OpenGL state via MPV_RENDER_PARAM_OPENGL_INIT_PARAMS.
*/
typedef struct mpv_opengl_init_params {
/**
* This retrieves OpenGL function pointers, and will use them in subsequent
* operation.
* Usually, you can simply call the GL context APIs from this callback (e.g.
* glXGetProcAddressARB or wglGetProcAddress), but some APIs do not always
* return pointers for all standard functions (even if present); in this
* case you have to compensate by looking up these functions yourself when
* libmpv wants to resolve them through this callback.
* libmpv will not normally attempt to resolve GL functions on its own, nor
* does it link to GL libraries directly.
*/
void *(*get_proc_address)(void *ctx, const char *name);
/**
* Value passed as ctx parameter to get_proc_address().
*/
void *get_proc_address_ctx;
} mpv_opengl_init_params;
/**
* For MPV_RENDER_PARAM_OPENGL_FBO.
*/
typedef struct mpv_opengl_fbo {
/**
* Framebuffer object name. This must be either a valid FBO generated by
* glGenFramebuffers() that is complete and color-renderable, or 0. If the
* value is 0, this refers to the OpenGL default framebuffer.
*/
int fbo;
/**
* Valid dimensions. This must refer to the size of the framebuffer. This
* must always be set.
*/
int w, h;
/**
* Underlying texture internal format (e.g. GL_RGBA8), or 0 if unknown. If
* this is the default framebuffer, this can be an equivalent.
*/
int internal_format;
} mpv_opengl_fbo;
/**
* Deprecated. For MPV_RENDER_PARAM_DRM_DISPLAY.
*/
typedef struct mpv_opengl_drm_params {
int fd;
int crtc_id;
int connector_id;
struct _drmModeAtomicReq **atomic_request_ptr;
int render_fd;
} mpv_opengl_drm_params;
/**
* For MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE.
*/
typedef struct mpv_opengl_drm_draw_surface_size {
/**
* size of the draw plane surface in pixels.
*/
int width, height;
} mpv_opengl_drm_draw_surface_size;
/**
* For MPV_RENDER_PARAM_DRM_DISPLAY_V2.
*/
typedef struct mpv_opengl_drm_params_v2 {
/**
* DRM fd (int). Set to -1 if invalid.
*/
int fd;
/**
* Currently used crtc id
*/
int crtc_id;
/**
* Currently used connector id
*/
int connector_id;
/**
* Pointer to a drmModeAtomicReq pointer that is being used for the renderloop.
* This pointer should hold a pointer to the atomic request pointer
* The atomic request pointer is usually changed at every renderloop.
*/
struct _drmModeAtomicReq **atomic_request_ptr;
/**
* DRM render node. Used for VAAPI interop.
* Set to -1 if invalid.
*/
int render_fd;
} mpv_opengl_drm_params_v2;
/**
* For backwards compatibility with the old naming of mpv_opengl_drm_draw_surface_size
*/
#define mpv_opengl_drm_osd_size mpv_opengl_drm_draw_surface_size
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,247 @@
/* Copyright (C) 2017 the mpv developers
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef MPV_CLIENT_API_STREAM_CB_H_
#define MPV_CLIENT_API_STREAM_CB_H_
#include "client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Warning: this API is not stable yet.
*
* Overview
* --------
*
* This API can be used to make mpv read from a stream with a custom
* implementation. This interface is inspired by funopen on BSD and
* fopencookie on linux. The stream is backed by user-defined callbacks
* which can implement customized open, read, seek, size and close behaviors.
*
* Usage
* -----
*
* Register your stream callbacks with the mpv_stream_cb_add_ro() function. You
* have to provide a mpv_stream_cb_open_ro_fn callback to it (open_fn argument).
*
* Once registered, you can `loadfile myprotocol://myfile`. Your open_fn will be
* invoked with the URI and you must fill out the provided mpv_stream_cb_info
* struct. This includes your stream callbacks (like read_fn), and an opaque
* cookie, which will be passed as the first argument to all the remaining
* stream callbacks.
*
* Note that your custom callbacks must not invoke libmpv APIs as that would
* cause a deadlock. (Unless you call a different mpv_handle than the one the
* callback was registered for, and the mpv_handles refer to different mpv
* instances.)
*
* Stream lifetime
* ---------------
*
* A stream remains valid until its close callback has been called. It's up to
* libmpv to call the close callback, and the libmpv user cannot close it
* directly with the stream_cb API.
*
* For example, if you consider your custom stream to become suddenly invalid
* (maybe because the underlying stream died), libmpv will continue using your
* stream. All you can do is returning errors from each callback, until libmpv
* gives up and closes it.
*
* Protocol registration and lifetime
* ----------------------------------
*
* Protocols remain registered until the mpv instance is terminated. This means
* in particular that it can outlive the mpv_handle that was used to register
* it, but once mpv_terminate_destroy() is called, your registered callbacks
* will not be called again.
*
* Protocol unregistration is finished after the mpv core has been destroyed
* (e.g. after mpv_terminate_destroy() has returned).
*
* If you do not call mpv_terminate_destroy() yourself (e.g. plugin-style code),
* you will have to deal with the registration or even streams outliving your
* code. Here are some possible ways to do this:
* - call mpv_terminate_destroy(), which destroys the core, and will make sure
* all streams are closed once this function returns
* - you refcount all resources your stream "cookies" reference, so that it
* doesn't matter if streams live longer than expected
* - create "cancellation" semantics: after your protocol has been unregistered,
* notify all your streams that are still opened, and make them drop all
* referenced resources - then return errors from the stream callbacks as
* long as the stream is still opened
*
*/
/**
* Read callback used to implement a custom stream. The semantics of the
* callback match read(2) in blocking mode. Short reads are allowed (you can
* return less bytes than requested, and libmpv will retry reading the rest
* with another call). If no data can be immediately read, the callback must
* block until there is new data. A return of 0 will be interpreted as final
* EOF, although libmpv might retry the read, or seek to a different position.
*
* @param cookie opaque cookie identifying the stream,
* returned from mpv_stream_cb_open_fn
* @param buf buffer to read data into
* @param size of the buffer
* @return number of bytes read into the buffer
* @return 0 on EOF
* @return -1 on error
*/
typedef int64_t (*mpv_stream_cb_read_fn)(void *cookie, char *buf, uint64_t nbytes);
/**
* Seek callback used to implement a custom stream.
*
* Note that mpv will issue a seek to position 0 immediately after opening. This
* is used to test whether the stream is seekable (since seekability might
* depend on the URI contents, not just the protocol). Return
* MPV_ERROR_UNSUPPORTED if seeking is not implemented for this stream. This
* seek also serves to establish the fact that streams start at position 0.
*
* This callback can be NULL, in which it behaves as if always returning
* MPV_ERROR_UNSUPPORTED.
*
* @param cookie opaque cookie identifying the stream,
* returned from mpv_stream_cb_open_fn
* @param offset target absolute stream position
* @return the resulting offset of the stream
* MPV_ERROR_UNSUPPORTED or MPV_ERROR_GENERIC if the seek failed
*/
typedef int64_t (*mpv_stream_cb_seek_fn)(void *cookie, int64_t offset);
/**
* Size callback used to implement a custom stream.
*
* Return MPV_ERROR_UNSUPPORTED if no size is known.
*
* This callback can be NULL, in which it behaves as if always returning
* MPV_ERROR_UNSUPPORTED.
*
* @param cookie opaque cookie identifying the stream,
* returned from mpv_stream_cb_open_fn
* @return the total size in bytes of the stream
*/
typedef int64_t (*mpv_stream_cb_size_fn)(void *cookie);
/**
* Close callback used to implement a custom stream.
*
* @param cookie opaque cookie identifying the stream,
* returned from mpv_stream_cb_open_fn
*/
typedef void (*mpv_stream_cb_close_fn)(void *cookie);
/**
* Cancel callback used to implement a custom stream.
*
* This callback is used to interrupt any current or future read and seek
* operations. It will be called from a separate thread than the demux
* thread, and should not block.
*
* This callback can be NULL.
*
* Available since API 1.106.
*
* @param cookie opaque cookie identifying the stream,
* returned from mpv_stream_cb_open_fn
*/
typedef void (*mpv_stream_cb_cancel_fn)(void *cookie);
/**
* See mpv_stream_cb_open_ro_fn callback.
*/
typedef struct mpv_stream_cb_info {
/**
* Opaque user-provided value, which will be passed to the other callbacks.
* The close callback will be called to release the cookie. It is not
* interpreted by mpv. It doesn't even need to be a valid pointer.
*
* The user sets this in the mpv_stream_cb_open_ro_fn callback.
*/
void *cookie;
/**
* Callbacks set by the user in the mpv_stream_cb_open_ro_fn callback. Some
* of them are optional, and can be left unset.
*
* The following callbacks are mandatory: read_fn, close_fn
*/
mpv_stream_cb_read_fn read_fn;
mpv_stream_cb_seek_fn seek_fn;
mpv_stream_cb_size_fn size_fn;
mpv_stream_cb_close_fn close_fn;
mpv_stream_cb_cancel_fn cancel_fn; /* since API 1.106 */
} mpv_stream_cb_info;
/**
* Open callback used to implement a custom read-only (ro) stream. The user
* must set the callback fields in the passed info struct. The cookie field
* also can be set to store state associated to the stream instance.
*
* Note that the info struct is valid only for the duration of this callback.
* You can't change the callbacks or the pointer to the cookie at a later point.
*
* Each stream instance created by the open callback can have different
* callbacks.
*
* The close_fn callback will terminate the stream instance. The pointers to
* your callbacks and cookie will be discarded, and the callbacks will not be
* called again.
*
* @param user_data opaque user data provided via mpv_stream_cb_add()
* @param uri name of the stream to be opened (with protocol prefix)
* @param info fields which the user should fill
* @return 0 on success, MPV_ERROR_LOADING_FAILED if the URI cannot be opened.
*/
typedef int (*mpv_stream_cb_open_ro_fn)(void *user_data, char *uri,
mpv_stream_cb_info *info);
/**
* Add a custom stream protocol. This will register a protocol handler under
* the given protocol prefix, and invoke the given callbacks if an URI with the
* matching protocol prefix is opened.
*
* The "ro" is for read-only - only read-only streams can be registered with
* this function.
*
* The callback remains registered until the mpv core is registered.
*
* If a custom stream with the same name is already registered, then the
* MPV_ERROR_INVALID_PARAMETER error is returned.
*
* @param protocol protocol prefix, for example "foo" for "foo://" URIs
* @param user_data opaque pointer passed into the mpv_stream_cb_open_fn
* callback.
* @return error code
*/
MPV_EXPORT int mpv_stream_cb_add_ro(mpv_handle *ctx, const char *protocol, void *user_data,
mpv_stream_cb_open_ro_fn open_fn);
#ifdef MPV_CPLUGIN_DYNAMIC_SYM
MPV_DEFINE_SYM_PTR(mpv_stream_cb_add_ro)
#define mpv_stream_cb_add_ro pfn_mpv_stream_cb_add_ro
#endif
#ifdef __cplusplus
}
#endif
#endif
+69
View File
@@ -0,0 +1,69 @@
#define UTIL_EXTERN
#include "jni_utils.h"
#include <jni.h>
#include <cstdlib>
#include "utf8_convert.h"
jstring new_java_string(JNIEnv* env, const char* utf8) {
if (!utf8) return NULL;
const std::u16string u16 = plezy::utf8::ToUtf16(utf8);
return env->NewString(reinterpret_cast<const jchar*>(u16.data()), static_cast<jsize>(u16.size()));
}
std::string java_string_to_utf8(JNIEnv* env, jstring jstr) {
if (!jstr) return std::string();
const jsize len = env->GetStringLength(jstr);
const jchar* chars = env->GetStringChars(jstr, NULL);
if (!chars) return std::string();
std::string out = plezy::utf8::FromUtf16(reinterpret_cast<const char16_t*>(chars), static_cast<size_t>(len));
env->ReleaseStringChars(jstr, chars);
return out;
}
bool acquire_jni_env(JavaVM* vm, JNIEnv** env) {
int ret = vm->GetEnv((void**)env, JNI_VERSION_1_6);
if (ret == JNI_EDETACHED)
return vm->AttachCurrentThread(env, NULL) == 0;
else
return ret == JNI_OK;
}
void init_methods_cache(JNIEnv* env) {
static bool methods_initialized = false;
if (methods_initialized) return;
// Plain assignments straight from env->FindClass, promoted to global refs
// on the following line, keep every Get*MethodID owner traceable for
// scripts/checks/check_shrinker_rules.py.
java_Integer = env->FindClass("java/lang/Integer");
java_Integer = reinterpret_cast<jclass>(env->NewGlobalRef(java_Integer));
java_Integer_init = env->GetMethodID(java_Integer, "<init>", "(I)V");
java_Double = env->FindClass("java/lang/Double");
java_Double = reinterpret_cast<jclass>(env->NewGlobalRef(java_Double));
java_Double_init = env->GetMethodID(java_Double, "<init>", "(D)V");
java_Boolean = env->FindClass("java/lang/Boolean");
java_Boolean = reinterpret_cast<jclass>(env->NewGlobalRef(java_Boolean));
java_Boolean_init = env->GetMethodID(java_Boolean, "<init>", "(Z)V");
mpv_MpvPlayer = env->FindClass("com/edde746/plezy/libmpv/MpvPlayer");
mpv_MpvPlayer = reinterpret_cast<jclass>(env->NewGlobalRef(mpv_MpvPlayer));
mpv_MpvPlayer_onPropertyChanged_S =
env->GetStaticMethodID(mpv_MpvPlayer, "onPropertyChanged", "(Ljava/lang/String;)V");
mpv_MpvPlayer_onPropertyChanged_Sb =
env->GetStaticMethodID(mpv_MpvPlayer, "onPropertyChanged", "(Ljava/lang/String;Z)V");
mpv_MpvPlayer_onPropertyChanged_Sl =
env->GetStaticMethodID(mpv_MpvPlayer, "onPropertyChanged", "(Ljava/lang/String;J)V");
mpv_MpvPlayer_onPropertyChanged_Sd =
env->GetStaticMethodID(mpv_MpvPlayer, "onPropertyChanged", "(Ljava/lang/String;D)V");
mpv_MpvPlayer_onPropertyChanged_SS =
env->GetStaticMethodID(mpv_MpvPlayer, "onPropertyChanged", "(Ljava/lang/String;Ljava/lang/String;)V");
mpv_MpvPlayer_onEvent = env->GetStaticMethodID(mpv_MpvPlayer, "onEvent", "(I)V");
mpv_MpvPlayer_onEndFile = env->GetStaticMethodID(mpv_MpvPlayer, "onEndFile", "(I)V");
mpv_MpvPlayer_onLogMessage =
env->GetStaticMethodID(mpv_MpvPlayer, "onLogMessage", "(Ljava/lang/String;ILjava/lang/String;)V");
methods_initialized = true;
}
+30
View File
@@ -0,0 +1,30 @@
#pragma once
#include <jni.h>
#include <string>
#define jni_func_name(name) Java_com_edde746_plezy_libmpv_MpvPlayer_##name
#define jni_func(return_type, name, ...) \
JNIEXPORT return_type JNICALL jni_func_name(name)(JNIEnv * env, jobject obj, ##__VA_ARGS__)
bool acquire_jni_env(JavaVM* vm, JNIEnv** env);
void init_methods_cache(JNIEnv* env);
// Standard-UTF-8 string crossings; see utf8_convert.h for why NewStringUTF /
// GetStringUTFChars are wrong for mpv data. `utf8` may be NULL (-> NULL).
jstring new_java_string(JNIEnv* env, const char* utf8);
// `jstr` may be NULL (-> empty).
std::string java_string_to_utf8(JNIEnv* env, jstring jstr);
#ifndef UTIL_EXTERN
#define UTIL_EXTERN extern
#endif
UTIL_EXTERN jclass java_Integer, java_Double, java_Boolean;
UTIL_EXTERN jmethodID java_Integer_init, java_Double_init, java_Boolean_init;
UTIL_EXTERN jclass mpv_MpvPlayer;
UTIL_EXTERN jmethodID mpv_MpvPlayer_onPropertyChanged_S, mpv_MpvPlayer_onPropertyChanged_Sb,
mpv_MpvPlayer_onPropertyChanged_Sl, mpv_MpvPlayer_onPropertyChanged_Sd, mpv_MpvPlayer_onPropertyChanged_SS,
mpv_MpvPlayer_onEvent, mpv_MpvPlayer_onEndFile, mpv_MpvPlayer_onLogMessage;
+13
View File
@@ -0,0 +1,13 @@
#include "log.h"
#include "globals.h"
#include "jni_utils.h"
void die(const char* msg) {
ALOGE("%s", msg);
JNIEnv* env = nullptr;
if (g_vm && acquire_jni_env(g_vm, &env) && env) {
jclass cls = env->FindClass("java/lang/RuntimeException");
if (cls) env->ThrowNew(cls, msg);
}
}
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <android/log.h>
#define DEBUG 1
#define LOG_TAG "mpv"
#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#if DEBUG
#define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
#else
#define ALOGV(...) (void)0
#endif
void die(const char* msg);
#define CHECK_MPV_INIT() \
do { \
if (__builtin_expect(!g_mpv, 0)) { \
die("libmpv is not initialized"); \
return; \
} \
} while (0)
#define CHECK_MPV_INIT_RET(val) \
do { \
if (__builtin_expect(!g_mpv, 0)) { \
die("libmpv is not initialized"); \
return val; \
} \
} while (0)
+157
View File
@@ -0,0 +1,157 @@
#include <jni.h>
#include <mpv/client.h>
#include <pthread.h>
#include <atomic>
#include <clocale>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <mutex>
#include <string>
#include <vector>
extern "C" {
#include <libavcodec/jni.h>
}
#include "event.h"
#include "jni_utils.h"
#include "log.h"
#define ARRAYLEN(a) (sizeof(a) / sizeof(a[0]))
void render_cleanup(JNIEnv* env);
static void* destroy_mpv_thread(void* arg) {
mpv_handle* handle = (mpv_handle*)arg;
mpv_terminate_destroy(handle);
return NULL;
}
// Fire-and-forget mpv_terminate_destroy on a detached thread.
// Safe because the event thread has been joined and g_mpv cleared —
// no other code references this handle.
static void async_destroy(mpv_handle* handle) {
pthread_t tid;
if (pthread_create(&tid, NULL, destroy_mpv_thread, handle) == 0) {
pthread_detach(tid);
} else {
// Fallback: destroy synchronously if thread creation fails
mpv_terminate_destroy(handle);
}
}
extern "C" {
jni_func(void, nativeCreate, jobject appctx);
jni_func(void, nativeInit);
jni_func(void, nativeDestroy);
jni_func(void, nativeCommand, jobjectArray jarray);
};
JavaVM* g_vm;
mpv_handle* g_mpv;
std::atomic<bool> g_event_thread_request_exit(false);
static pthread_t event_thread_id;
static std::mutex g_lifecycle_mutex;
static void prepare_environment(JNIEnv* env, jobject appctx) {
setlocale(LC_NUMERIC, "C");
if (!env->GetJavaVM(&g_vm) && g_vm) av_jni_set_java_vm(g_vm, NULL);
jobject global_appctx = env->NewGlobalRef(appctx);
if (global_appctx) av_jni_set_android_app_ctx(global_appctx, NULL);
init_methods_cache(env);
}
jni_func(void, nativeCreate, jobject appctx) {
std::lock_guard<std::mutex> lock(g_lifecycle_mutex);
prepare_environment(env, appctx);
mpv_handle* leaked_mpv = NULL;
if (g_mpv) {
ALOGE("destroying leaked mpv instance");
leaked_mpv = g_mpv;
g_event_thread_request_exit = true;
mpv_wakeup(leaked_mpv);
pthread_join(event_thread_id, NULL);
g_mpv = NULL;
render_cleanup(env);
}
g_mpv = mpv_create();
if (!g_mpv) {
die("context init failed");
if (leaked_mpv) mpv_terminate_destroy(leaked_mpv);
return;
}
mpv_request_log_messages(g_mpv, "v");
// Async teardown of leaked handle — doesn't block caller
if (leaked_mpv) async_destroy(leaked_mpv);
}
jni_func(void, nativeInit) {
if (!g_mpv) {
die("mpv is not created");
return;
}
if (mpv_initialize(g_mpv) < 0) {
die("mpv init failed");
return;
}
g_event_thread_request_exit = false;
if (pthread_create(&event_thread_id, NULL, event_thread, NULL) != 0) {
die("thread create failed");
return;
}
pthread_setname_np(event_thread_id, "event_thread");
}
jni_func(void, nativeDestroy) {
std::lock_guard<std::mutex> lock(g_lifecycle_mutex);
if (!g_mpv) {
ALOGV("mpv destroy called but it's already destroyed");
return;
}
mpv_handle* local_mpv = g_mpv;
g_event_thread_request_exit = true;
mpv_wakeup(local_mpv);
pthread_join(event_thread_id, NULL);
g_mpv = NULL;
render_cleanup(env);
// Async teardown — nativeDestroy returns immediately
async_destroy(local_mpv);
}
jni_func(void, nativeCommand, jobjectArray jarray) {
CHECK_MPV_INIT();
const char* arguments[128] = {0};
int len = env->GetArrayLength(jarray);
if (len >= (int)ARRAYLEN(arguments)) {
die("too many command arguments");
return;
}
std::vector<std::string> storage;
storage.reserve(len);
for (int i = 0; i < len; ++i) {
jstring jarg = (jstring)env->GetObjectArrayElement(jarray, i);
storage.push_back(java_string_to_utf8(env, jarg));
arguments[i] = storage.back().c_str();
env->DeleteLocalRef(jarg);
}
mpv_command(g_mpv, arguments);
}
+115
View File
@@ -0,0 +1,115 @@
#include <jni.h>
#include <mpv/client.h>
#include <cstdlib>
#include <string>
#include "globals.h"
#include "jni_utils.h"
#include "log.h"
extern "C" {
jni_func(jint, nativeSetOptionString, jstring option, jstring value);
jni_func(jobject, nativeGetPropertyInt, jstring property);
jni_func(void, nativeSetPropertyInt, jstring property, jint value);
jni_func(jobject, nativeGetPropertyDouble, jstring property);
jni_func(void, nativeSetPropertyDouble, jstring property, jdouble value);
jni_func(jobject, nativeGetPropertyBoolean, jstring property);
jni_func(void, nativeSetPropertyBoolean, jstring property, jboolean value);
jni_func(jstring, nativeGetPropertyString, jstring jproperty);
jni_func(void, nativeSetPropertyString, jstring jproperty, jstring jvalue);
jni_func(void, nativeObserveProperty, jstring property, jint format);
}
jni_func(jint, nativeSetOptionString, jstring joption, jstring jvalue) {
CHECK_MPV_INIT_RET(0);
const char* option = env->GetStringUTFChars(joption, NULL);
const std::string value = java_string_to_utf8(env, jvalue);
int result = mpv_set_option_string(g_mpv, option, value.c_str());
env->ReleaseStringUTFChars(joption, option);
return result;
}
static int common_get_property(JNIEnv* env, jstring jproperty, mpv_format format, void* output) {
CHECK_MPV_INIT_RET(-1);
const char* prop = env->GetStringUTFChars(jproperty, NULL);
int result = mpv_get_property(g_mpv, prop, format, output);
if (result < 0) ALOGE("mpv_get_property(%s) format %d returned error %s", prop, format, mpv_error_string(result));
env->ReleaseStringUTFChars(jproperty, prop);
return result;
}
static int common_set_property(JNIEnv* env, jstring jproperty, mpv_format format, void* value) {
CHECK_MPV_INIT_RET(-1);
const char* prop = env->GetStringUTFChars(jproperty, NULL);
int result = mpv_set_property(g_mpv, prop, format, value);
if (result < 0)
ALOGE("mpv_set_property(%s, %p) format %d returned error %s", prop, value, format, mpv_error_string(result));
env->ReleaseStringUTFChars(jproperty, prop);
return result;
}
jni_func(jobject, nativeGetPropertyInt, jstring jproperty) {
int64_t value = 0;
if (common_get_property(env, jproperty, MPV_FORMAT_INT64, &value) < 0) return NULL;
return env->NewObject(java_Integer, java_Integer_init, (jint)value);
}
jni_func(jobject, nativeGetPropertyDouble, jstring jproperty) {
double value = 0;
if (common_get_property(env, jproperty, MPV_FORMAT_DOUBLE, &value) < 0) return NULL;
return env->NewObject(java_Double, java_Double_init, (jdouble)value);
}
jni_func(jobject, nativeGetPropertyBoolean, jstring jproperty) {
int value = 0;
if (common_get_property(env, jproperty, MPV_FORMAT_FLAG, &value) < 0) return NULL;
return env->NewObject(java_Boolean, java_Boolean_init, (jboolean)value);
}
jni_func(jstring, nativeGetPropertyString, jstring jproperty) {
char* value;
if (common_get_property(env, jproperty, MPV_FORMAT_STRING, &value) < 0) return NULL;
jstring jvalue = new_java_string(env, value);
mpv_free(value);
return jvalue;
}
jni_func(void, nativeSetPropertyInt, jstring jproperty, jint jvalue) {
int64_t value = static_cast<int64_t>(jvalue);
common_set_property(env, jproperty, MPV_FORMAT_INT64, &value);
}
jni_func(void, nativeSetPropertyDouble, jstring jproperty, jdouble jvalue) {
double value = static_cast<double>(jvalue);
common_set_property(env, jproperty, MPV_FORMAT_DOUBLE, &value);
}
jni_func(void, nativeSetPropertyBoolean, jstring jproperty, jboolean jvalue) {
int value = jvalue == JNI_TRUE ? 1 : 0;
common_set_property(env, jproperty, MPV_FORMAT_FLAG, &value);
}
jni_func(void, nativeSetPropertyString, jstring jproperty, jstring jvalue) {
const std::string value = java_string_to_utf8(env, jvalue);
const char* value_ptr = value.c_str();
common_set_property(env, jproperty, MPV_FORMAT_STRING, &value_ptr);
}
jni_func(void, nativeObserveProperty, jstring property, jint format) {
CHECK_MPV_INIT();
const char* prop = env->GetStringUTFChars(property, NULL);
int result = mpv_observe_property(g_mpv, 0, prop, (mpv_format)format);
if (result < 0) ALOGE("mpv_observe_property(%s) format %d returned error %s", prop, format, mpv_error_string(result));
env->ReleaseStringUTFChars(property, prop);
}
+79
View File
@@ -0,0 +1,79 @@
#include <jni.h>
#include <mpv/client.h>
#include "globals.h"
#include "jni_utils.h"
#include "log.h"
extern "C" {
jni_func(void, nativeAttachSurface, jobject surface_);
jni_func(void, nativeDetachSurface);
jni_func(void, nativeAttachOsdSurface, jobject surface_);
jni_func(void, nativeDetachOsdSurface);
};
static jobject surface;
jni_func(void, nativeAttachSurface, jobject surface_) {
CHECK_MPV_INIT();
surface = env->NewGlobalRef(surface_);
if (!surface) {
die("invalid surface provided");
return;
}
int64_t wid = reinterpret_cast<intptr_t>(surface);
int result = mpv_set_option(g_mpv, "wid", MPV_FORMAT_INT64, &wid);
if (result < 0) ALOGE("mpv_set_option(wid) returned error %s", mpv_error_string(result));
}
jni_func(void, nativeDetachSurface) {
CHECK_MPV_INIT();
int64_t wid = 0;
int result = mpv_set_option(g_mpv, "wid", MPV_FORMAT_INT64, &wid);
if (result < 0) ALOGE("mpv_set_option(wid) returned error %s", mpv_error_string(result));
env->DeleteGlobalRef(surface);
surface = NULL;
}
static jobject osd_surface;
// The OSD plane of vo=mediacodec. Same lifetime rules as the video surface:
// the global ref must outlive the VO, so detach only after vo has been unset.
jni_func(void, nativeAttachOsdSurface, jobject surface_) {
CHECK_MPV_INIT();
osd_surface = env->NewGlobalRef(surface_);
if (!osd_surface) {
die("invalid osd surface provided");
return;
}
int64_t wid = reinterpret_cast<intptr_t>(osd_surface);
int result = mpv_set_option(g_mpv, "vo-mediacodec-osd-surface", MPV_FORMAT_INT64, &wid);
if (result < 0) ALOGE("mpv_set_option(vo-mediacodec-osd-surface) returned error %s", mpv_error_string(result));
}
jni_func(void, nativeDetachOsdSurface) {
CHECK_MPV_INIT();
if (!osd_surface) return;
int64_t wid = 0;
int result = mpv_set_option(g_mpv, "vo-mediacodec-osd-surface", MPV_FORMAT_INT64, &wid);
if (result < 0) ALOGE("mpv_set_option(vo-mediacodec-osd-surface) returned error %s", mpv_error_string(result));
env->DeleteGlobalRef(osd_surface);
osd_surface = NULL;
}
void render_cleanup(JNIEnv* env) {
if (surface) {
env->DeleteGlobalRef(surface);
surface = NULL;
}
if (osd_surface) {
env->DeleteGlobalRef(osd_surface);
osd_surface = NULL;
}
}
+126
View File
@@ -0,0 +1,126 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <string>
// UTF-8 <-> UTF-16 transcoding for the JNI boundary.
//
// mpv speaks standard UTF-8. JNI's NewStringUTF/GetStringUTFChars speak
// *modified* UTF-8: supplementary-plane characters are CESU-8 surrogate pairs
// and NUL is 0xC0 0x80. Feeding one encoding to the other corrupts emoji in
// file names and titles, and malformed bytes from mpv (log lines, ID3 tags,
// system-encoded paths) abort under CheckJNI. Both directions therefore go
// through UTF-16 with NewString/GetStringChars; malformed input is replaced
// with U+FFFD one unit at a time, matching shared/cpp/sanitize_utf8.h on
// desktop. Header-only and JNI-free so the host test harness can exercise it.
namespace plezy {
namespace utf8 {
// Decodes one scalar value at `s`. Returns the number of bytes consumed, or 0
// when `s` does not start a well-formed sequence (Unicode Table 3-7).
inline size_t DecodeOne(const unsigned char* s, size_t len, uint32_t* cp) {
const unsigned char c = s[0];
if (c < 0x80) {
*cp = c;
return 1;
}
size_t need;
unsigned char lo = 0x80, hi = 0xBF;
if (c >= 0xC2 && c <= 0xDF) {
need = 2;
*cp = c & 0x1F;
} else if (c >= 0xE0 && c <= 0xEF) {
need = 3;
*cp = c & 0x0F;
if (c == 0xE0) lo = 0xA0;
if (c == 0xED) hi = 0x9F; // no surrogates
} else if (c >= 0xF0 && c <= 0xF4) {
need = 4;
*cp = c & 0x07;
if (c == 0xF0) lo = 0x90;
if (c == 0xF4) hi = 0x8F; // <= U+10FFFF
} else {
return 0;
}
if (len < need) return 0;
for (size_t i = 1; i < need; ++i) {
const unsigned char b = s[i];
if (b < lo || b > hi) return 0;
lo = 0x80;
hi = 0xBF;
*cp = (*cp << 6) | (b & 0x3F);
}
return need;
}
// Standard UTF-8 -> UTF-16. Malformed bytes become U+FFFD.
inline std::u16string ToUtf16(const char* input, size_t len) {
std::u16string out;
if (!input) return out;
out.reserve(len);
const unsigned char* s = reinterpret_cast<const unsigned char*>(input);
size_t pos = 0;
while (pos < len) {
uint32_t cp;
const size_t n = DecodeOne(s + pos, len - pos, &cp);
if (n == 0) {
out.push_back(u'\uFFFD');
pos += 1;
continue;
}
pos += n;
if (cp < 0x10000) {
out.push_back(static_cast<char16_t>(cp));
} else {
cp -= 0x10000;
out.push_back(static_cast<char16_t>(0xD800 | (cp >> 10)));
out.push_back(static_cast<char16_t>(0xDC00 | (cp & 0x3FF)));
}
}
return out;
}
inline std::u16string ToUtf16(const char* input) {
return input ? ToUtf16(input, std::char_traits<char>::length(input)) : std::u16string();
}
// UTF-16 -> standard UTF-8. Lone surrogates become U+FFFD.
inline std::string FromUtf16(const char16_t* input, size_t len) {
std::string out;
if (!input) return out;
out.reserve(len * 3);
for (size_t i = 0; i < len; ++i) {
uint32_t cp = input[i];
if (cp >= 0xD800 && cp <= 0xDBFF) {
if (i + 1 < len && input[i + 1] >= 0xDC00 && input[i + 1] <= 0xDFFF) {
cp = 0x10000 + ((cp - 0xD800) << 10) + (input[i + 1] - 0xDC00);
++i;
} else {
cp = 0xFFFD;
}
} else if (cp >= 0xDC00 && cp <= 0xDFFF) {
cp = 0xFFFD;
}
if (cp < 0x80) {
out.push_back(static_cast<char>(cp));
} else if (cp < 0x800) {
out.push_back(static_cast<char>(0xC0 | (cp >> 6)));
out.push_back(static_cast<char>(0x80 | (cp & 0x3F)));
} else if (cp < 0x10000) {
out.push_back(static_cast<char>(0xE0 | (cp >> 12)));
out.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3F)));
out.push_back(static_cast<char>(0x80 | (cp & 0x3F)));
} else {
out.push_back(static_cast<char>(0xF0 | (cp >> 18)));
out.push_back(static_cast<char>(0x80 | ((cp >> 12) & 0x3F)));
out.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3F)));
out.push_back(static_cast<char>(0x80 | (cp & 0x3F)));
}
}
return out;
}
} // namespace utf8
} // namespace plezy
@@ -0,0 +1,13 @@
package com.edde746.plezy.libmpv
enum class EndFileReason(val id: Int) {
Eof(0),
Stop(2),
Quit(3),
Error(4),
Redirect(5);
companion object {
fun fromId(id: Int): EndFileReason? = entries.find { it.id == id }
}
}
@@ -0,0 +1,15 @@
package com.edde746.plezy.libmpv
enum class LogLevel(internal val nativeValue: Int) {
Fatal(10),
Error(20),
Warn(30),
Info(40),
Verbose(50),
Debug(60),
Trace(70);
companion object {
internal fun fromNative(value: Int): LogLevel? = entries.find { it.nativeValue == value }
}
}
@@ -0,0 +1,7 @@
package com.edde746.plezy.libmpv
data class LogMessage(
val prefix: String,
val level: LogLevel,
val text: String
)
@@ -0,0 +1,18 @@
package com.edde746.plezy.libmpv
sealed interface MpvEvent {
data object StartFile : MpvEvent
data class EndFile(val reason: EndFileReason?) : MpvEvent
data object FileLoaded : MpvEvent
data object PlaybackRestart : MpvEvent
companion object {
// Mirrors the ids event.cpp forwards; END_FILE arrives via its own JNI path.
internal fun fromId(id: Int): MpvEvent? = when (id) {
6 -> StartFile
8 -> FileLoaded
21 -> PlaybackRestart
else -> null
}
}
}
@@ -0,0 +1,3 @@
package com.edde746.plezy.libmpv
class MpvException(message: String) : RuntimeException(message)
@@ -0,0 +1,309 @@
package com.edde746.plezy.libmpv
import android.content.Context
import android.view.Surface
import java.util.concurrent.atomic.AtomicReference
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterIsInstance
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
class MpvPlayer private constructor() : AutoCloseable {
companion object {
init {
System.loadLibrary("mpv")
System.loadLibrary("player")
}
private val instance = AtomicReference<MpvPlayer?>(null)
suspend fun create(
context: Context,
configure: MpvPlayerConfig.() -> Unit = {}
): MpvPlayer = withContext(Dispatchers.IO) {
val player = MpvPlayer()
// Atomically replace; mark old as closed so its background close() skips nativeDestroy
instance.getAndSet(player)?.also { it.closed = true }
// nativeCreate's safety net handles any leaked native session
try {
nativeCreate(context.applicationContext)
MpvPlayerConfig().apply(configure)
nativeInit()
ensureActive()
player
} catch (e: Throwable) {
instance.compareAndSet(player, null)
try {
nativeDestroy()
} catch (_: Throwable) {}
throw e
}
}
// JNI callbacks — called from native event thread
@JvmStatic
fun onPropertyChanged(name: String) {
instance.get()?.rawPropertyChanges?.trySend(PropertyChange.None(name))
}
@JvmStatic
fun onPropertyChanged(name: String, value: Boolean) {
instance.get()?.rawPropertyChanges?.trySend(PropertyChange.Flag(name, value))
}
@JvmStatic
fun onPropertyChanged(name: String, value: Long) {
instance.get()?.rawPropertyChanges?.trySend(PropertyChange.Int64(name, value))
}
@JvmStatic
fun onPropertyChanged(name: String, value: Double) {
instance.get()?.rawPropertyChanges?.trySend(PropertyChange.Double(name, value))
}
@JvmStatic
fun onPropertyChanged(name: String, value: String) {
instance.get()?.rawPropertyChanges?.trySend(PropertyChange.Str(name, value))
}
@JvmStatic
fun onEvent(eventId: Int) {
val event = MpvEvent.fromId(eventId) ?: return
instance.get()?.rawEvents?.trySend(event)
}
@JvmStatic
fun onEndFile(reason: Int) {
instance.get()?.rawEvents?.trySend(
MpvEvent.EndFile(EndFileReason.fromId(reason))
)
}
@JvmStatic
fun onLogMessage(prefix: String, level: Int, text: String) {
val logLevel = LogLevel.fromNative(level) ?: return
instance.get()?.rawLogMessages?.trySend(LogMessage(prefix, logLevel, text.trimEnd()))
}
// JNI native declarations — private to avoid internal name mangling
@JvmStatic private external fun nativeCreate(appctx: Context)
@JvmStatic private external fun nativeInit()
@JvmStatic private external fun nativeDestroy()
@JvmStatic private external fun nativeCommand(cmd: Array<out String>)
@JvmStatic private external fun nativeSetOptionString(name: String, value: String): Int
@JvmStatic private external fun nativeAttachSurface(surface: Surface)
@JvmStatic private external fun nativeDetachSurface()
@JvmStatic private external fun nativeAttachOsdSurface(surface: Surface)
@JvmStatic private external fun nativeDetachOsdSurface()
@JvmStatic private external fun nativeGetPropertyInt(name: String): Int?
@JvmStatic private external fun nativeGetPropertyDouble(name: String): Double?
@JvmStatic private external fun nativeGetPropertyBoolean(name: String): Boolean?
@JvmStatic private external fun nativeGetPropertyString(name: String): String?
@JvmStatic private external fun nativeSetPropertyInt(name: String, value: Int)
@JvmStatic private external fun nativeSetPropertyDouble(name: String, value: Double)
@JvmStatic private external fun nativeSetPropertyBoolean(name: String, value: Boolean)
@JvmStatic private external fun nativeSetPropertyString(name: String, value: String)
@JvmStatic private external fun nativeObserveProperty(name: String, format: Int)
internal fun setOptionString(name: String, value: String): Int = nativeSetOptionString(name, value)
}
// The native event thread hands everything to unbounded channels: trySend
// on them cannot fail (until close) and cannot block mpv's event loop. A
// pump per stream re-emits into the SharedFlow, whose SUSPEND overflow
// parks the pump - not the native thread - while a collector catches up.
// The previous design tryEmit-ed straight into the 64-slot SharedFlow
// buffer, which silently dropped whatever arrived during a burst; losing
// e.g. the one cplayer log line that signals a failed video chain.
private val rawEvents = Channel<MpvEvent>(Channel.UNLIMITED)
private val rawPropertyChanges = Channel<PropertyChange>(Channel.UNLIMITED)
private val rawLogMessages = Channel<LogMessage>(Channel.UNLIMITED)
private val events = MutableSharedFlow<MpvEvent>(extraBufferCapacity = 64)
private val propertyChanges = MutableSharedFlow<PropertyChange>(extraBufferCapacity = 64)
private val logMessages = MutableSharedFlow<LogMessage>(extraBufferCapacity = 64)
private val pumpScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
init {
pumpScope.launch { for (e in rawEvents) events.emit(e) }
pumpScope.launch { for (c in rawPropertyChanges) propertyChanges.emit(c) }
pumpScope.launch { for (m in rawLogMessages) logMessages.emit(m) }
}
val eventFlow: SharedFlow<MpvEvent> = events.asSharedFlow()
val propertyFlow: SharedFlow<PropertyChange> = propertyChanges.asSharedFlow()
val logFlow: SharedFlow<LogMessage> = logMessages.asSharedFlow()
// Commands
suspend fun command(vararg args: String) {
checkNotClosed()
withContext(Dispatchers.IO) { nativeCommand(args) }
}
// Surface — not suspend, called from SurfaceHolder.Callback
fun attachSurface(surface: Surface) {
checkNotClosed()
nativeAttachSurface(surface)
}
fun detachSurface() {
checkNotClosed()
nativeDetachSurface()
}
/** OSD/subtitle plane for `vo=mediacodec`; attach before selecting the VO. */
fun attachOsdSurface(surface: Surface) {
checkNotClosed()
nativeAttachOsdSurface(surface)
}
fun detachOsdSurface() {
checkNotClosed()
nativeDetachOsdSurface()
}
// Property getters
suspend fun getInt(name: String): Int? {
checkNotClosed()
return withContext(Dispatchers.IO) { nativeGetPropertyInt(name) }
}
suspend fun getDouble(name: String): Double? {
checkNotClosed()
return withContext(Dispatchers.IO) { nativeGetPropertyDouble(name) }
}
suspend fun getFlag(name: String): Boolean? {
checkNotClosed()
return withContext(Dispatchers.IO) { nativeGetPropertyBoolean(name) }
}
suspend fun getString(name: String): String? {
checkNotClosed()
return withContext(Dispatchers.IO) { nativeGetPropertyString(name) }
}
// Property setters
suspend fun setProperty(name: String, value: Int) {
checkNotClosed()
withContext(Dispatchers.IO) { nativeSetPropertyInt(name, value) }
}
suspend fun setProperty(name: String, value: Double) {
checkNotClosed()
withContext(Dispatchers.IO) { nativeSetPropertyDouble(name, value) }
}
suspend fun setProperty(name: String, value: Boolean) {
checkNotClosed()
withContext(Dispatchers.IO) { nativeSetPropertyBoolean(name, value) }
}
suspend fun setProperty(name: String, value: String) {
checkNotClosed()
withContext(Dispatchers.IO) { nativeSetPropertyString(name, value) }
}
// Property observation
fun observeProperty(name: String, format: PropertyFormat): Flow<PropertyChange> {
checkNotClosed()
nativeObserveProperty(name, format.nativeValue)
return propertyFlow.filter { it.name == name }
}
fun observeFlag(name: String): Flow<Boolean> {
checkNotClosed()
nativeObserveProperty(name, PropertyFormat.Flag.nativeValue)
return propertyFlow
.filterIsInstance<PropertyChange.Flag>()
.filter { it.name == name }
.map { it.value }
}
fun observeInt(name: String): Flow<Long> {
checkNotClosed()
nativeObserveProperty(name, PropertyFormat.Int64.nativeValue)
return propertyFlow
.filterIsInstance<PropertyChange.Int64>()
.filter { it.name == name }
.map { it.value }
}
fun observeDouble(name: String): Flow<Double> {
checkNotClosed()
nativeObserveProperty(name, PropertyFormat.Double.nativeValue)
return propertyFlow
.filterIsInstance<PropertyChange.Double>()
.filter { it.name == name }
.map { it.value }
}
fun observeString(name: String): Flow<String> {
checkNotClosed()
nativeObserveProperty(name, PropertyFormat.String.nativeValue)
return propertyFlow
.filterIsInstance<PropertyChange.Str>()
.filter { it.name == name }
.map { it.value }
}
// Lifecycle
@Volatile
private var closed = false
override fun close() {
if (closed) return
closed = true
// Only destroy native if we're still the active player.
// If create() already replaced us, nativeCreate's safety net handles native cleanup.
if (instance.compareAndSet(this, null)) {
nativeDestroy()
}
// After nativeDestroy no callback can produce: closing the channels
// lets each pump drain what is already queued and then complete.
rawEvents.close()
rawPropertyChanges.close()
rawLogMessages.close()
}
private fun checkNotClosed() {
check(!closed) { "MpvPlayer has been closed" }
}
}
@@ -0,0 +1,10 @@
package com.edde746.plezy.libmpv
class MpvPlayerConfig internal constructor() {
fun setOption(name: String, value: String) {
val result = MpvPlayer.setOptionString(name, value)
if (result < 0) {
throw MpvException("Failed to set option '$name' to '$value': error $result")
}
}
}
@@ -0,0 +1,11 @@
package com.edde746.plezy.libmpv
sealed interface PropertyChange {
val name: String
data class None(override val name: String) : PropertyChange
data class Flag(override val name: String, val value: Boolean) : PropertyChange
data class Int64(override val name: String, val value: Long) : PropertyChange
data class Double(override val name: String, val value: kotlin.Double) : PropertyChange
data class Str(override val name: String, val value: String) : PropertyChange
}
@@ -0,0 +1,9 @@
package com.edde746.plezy.libmpv
enum class PropertyFormat(internal val nativeValue: Int) {
None(0),
String(1),
Flag(3),
Int64(4),
Double(5)
}
+1
View File
@@ -25,3 +25,4 @@ plugins {
include(":app")
include(":libass")
include(":libmpv")
+5 -5
View File
@@ -283,7 +283,7 @@
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "MPVKit" */,
6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "mpv-build" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
@@ -797,12 +797,12 @@
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "MPVKit" */ = {
6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "mpv-build" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/edde746/MPVKit";
repositoryURL = "https://github.com/edde746/mpv-build";
requirement = {
kind = revision;
revision = b8b922ec74b84ac3a496e29e226a3a3e91491045;
revision = dafa7762af20052031a7b512c9761a5d8bde327d;
};
};
/* End XCRemoteSwiftPackageReference section */
@@ -810,7 +810,7 @@
/* Begin XCSwiftPackageProductDependency section */
6A8A46202EDB320D0057B88C /* MPVKit */ = {
isa = XCSwiftPackageProductDependency;
package = 6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "MPVKit" */;
package = 6A8A461F2EDB320D0057B88C /* XCRemoteSwiftPackageReference "mpv-build" */;
productName = MPVKit;
};
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
@@ -28,11 +28,11 @@
}
},
{
"identity" : "mpvkit",
"identity" : "mpv-build",
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/MPVKit",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "b8b922ec74b84ac3a496e29e226a3a3e91491045"
"revision" : "dafa7762af20052031a7b512c9761a5d8bde327d"
}
},
{
@@ -28,11 +28,11 @@
}
},
{
"identity" : "mpvkit",
"identity" : "mpv-build",
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/MPVKit",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "b8b922ec74b84ac3a496e29e226a3a3e91491045"
"revision" : "dafa7762af20052031a7b512c9761a5d8bde327d"
}
},
{
+15 -35
View File
@@ -2,8 +2,8 @@ import 'dart:convert';
import '../models/plex/plex_home.dart';
import '../models/plex/plex_home_user.dart';
import '../profiles/plex_home_service.dart';
import '../profiles/profile.dart';
import '../profiles/plex_home_cache_codec.dart';
import '../profiles/profile_registry.dart';
import '../services/plex_auth_service.dart';
import '../services/server_registry.dart';
@@ -20,24 +20,23 @@ import 'plex_account_setup.dart';
///
/// Plex Home users are NOT persisted here — the bootstrap copies the
/// legacy `homeUsersCache` into the per-connection
/// `plex_home_users_{connectionId}` SharedPreferences slot so
/// [PlexHomeService] picks it up on cold start.
/// `plex_home_users_{connectionId}` SharedPreferences slot and asks
/// [PlexHomeService] to reload (or fetch) it.
class ConnectionBootstrap {
ConnectionBootstrap({
required this.storage,
required this.connectionRegistry,
required this.serverRegistry,
required this.profileRegistry,
Future<List<PlexHomeUser>> Function(String accountToken)? plexHomeUserFetcher,
required this.plexHome,
Future<Map<String, dynamic>> Function(String accountToken)? plexUserInfoFetcher,
}) : _plexHomeUserFetcher = plexHomeUserFetcher ?? fetchPlexHomeUsers,
_plexUserInfoFetcher = plexUserInfoFetcher ?? _fetchPlexUserInfo;
}) : _plexUserInfoFetcher = plexUserInfoFetcher ?? _fetchPlexUserInfo;
final StorageService storage;
final ConnectionRegistry connectionRegistry;
final ServerRegistry serverRegistry;
final ProfileRegistry profileRegistry;
final Future<List<PlexHomeUser>> Function(String accountToken) _plexHomeUserFetcher;
final PlexHomeService plexHome;
final Future<Map<String, dynamic>> Function(String accountToken) _plexUserInfoFetcher;
static const String _keyProfileMigrationV1Done = 'profile_migration_v1_done';
@@ -63,6 +62,9 @@ class ConnectionBootstrap {
final prepared = await _preparePlexVirtualProfile(account);
if (!prepared) {
if (migratedAccount != null && hadLegacyPlexToken) {
// A failed/empty fetch may have left an empty cache slot on disk
// for the id we are about to drop; don't leave it orphaned.
await storage.clearPlexHomeUsersCache(migratedAccount.id);
await connectionRegistry.remove(migratedAccount.id);
}
appLogger.w('Migration: could not hydrate Plex Home profiles for ${account.id}; will retry later');
@@ -147,9 +149,12 @@ class ConnectionBootstrap {
/// profile. Plex users are never persisted as local Plezy profiles.
Future<bool> _preparePlexVirtualProfile(PlexAccountConnection account) async {
final copied = await _migrateLegacyPlexHomeUsersCache(account.id);
var users = copied ? _readPlexHomeUsersCache(account.id) : null;
users ??= await _fetchAndCachePlexHomeUsers(account);
final hydratedUsers = users;
if (copied) {
await plexHome.reloadFromStorage();
} else {
await plexHome.refresh(account);
}
final hydratedUsers = plexHome.current[account.id] ?? const [];
if (hydratedUsers.isEmpty) return false;
final legacyActiveUuid = storage.getCurrentUserUUID();
@@ -196,31 +201,6 @@ class ConnectionBootstrap {
}
}
List<PlexHomeUser>? _readPlexHomeUsersCache(String connectionId) {
final raw = storage.getPlexHomeUsersCacheJson(connectionId);
if (raw == null || raw.isEmpty) return null;
try {
return decodePlexHomeUsersCache(raw);
} catch (e, st) {
appLogger.w('Migration: failed to read Plex Home cache for $connectionId', error: e, stackTrace: st);
return null;
}
}
Future<List<PlexHomeUser>> _fetchAndCachePlexHomeUsers(PlexAccountConnection account) async {
try {
final users = await _plexHomeUserFetcher(account.accountToken);
if (users.isNotEmpty) {
await storage.savePlexHomeUsersCache(account.id, encodePlexHomeUsersCache(users));
appLogger.i('Migration: fetched ${users.length} Plex Home users for ${account.id}');
}
return users;
} catch (e, st) {
appLogger.w('Migration: Plex Home fetch failed for ${account.id}', error: e, stackTrace: st);
return const [];
}
}
Future<void> _migrateLegacyPlexHomeUsersCacheForExistingAccount(PlexAccountConnection? account) async {
if (storage.prefs.getString('home_users_cache') == null) return;
var target = account;
@@ -0,0 +1,61 @@
import 'package:flutter/widgets.dart';
/// Keeps a subtree from taking focus while the [ModalRoute] it lives in is
/// covered by another route, and hands focus back when it is uncovered.
///
/// Flutter only marks a covered route's scope `skipTraversal`; any descendant
/// may still call `requestFocus()` and win. That is harmless on a single
/// navigator, where every screen's `ModalRoute.of(context).isCurrent` guard
/// tells the truth. It breaks with a nested navigator: a route pushed on the
/// *root* navigator (the profile picker, the PIN dialog) covers the whole
/// nested stack, yet each nested route still reports `isCurrent == true` and
/// its focus self-heals — sidebar reveal, library grid load, TV browse rail —
/// yank the remote off the visible route, which on tvOS reads as a dead
/// remote (#2034, #2239).
///
/// The boundary restores the invariant once, at the navigator boundary,
/// instead of at every reclaim site: while the enclosing route is not current
/// the subtree is [ExcludeFocus]ed, so every `requestFocus()` below it is a
/// no-op. On uncover it re-requests the subtree's own [FocusScope], whose
/// focus history still leads back to the leaf that had focus before the
/// cover; Flutter's own restoration cannot, because the covering route's pop
/// culls the excluded scope from the route scope's history before the
/// exclusion lifts.
class CoveredRouteFocusBoundary extends StatefulWidget {
const CoveredRouteFocusBoundary({super.key, required this.child});
final Widget child;
@override
State<CoveredRouteFocusBoundary> createState() => _CoveredRouteFocusBoundaryState();
}
class _CoveredRouteFocusBoundaryState extends State<CoveredRouteFocusBoundary> {
final _scope = FocusScopeNode(debugLabel: 'CoveredRouteFocusBoundary');
bool _covered = false;
@override
void dispose() {
_scope.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
// ModalRoute.of subscribes to the route's status, so this rebuilds on
// every isCurrent flip. Outside any route the subtree is never covered.
final covered = !(ModalRoute.of(context)?.isCurrent ?? true);
if (_covered && !covered) {
// The exclusion lifts in this build's didUpdateWidget, after the pop
// already parked focus on the route scope; restore once it has.
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && !_scope.hasFocus) _scope.requestFocus();
});
}
_covered = covered;
return ExcludeFocus(
excluding: covered,
child: FocusScope(node: _scope, child: widget.child),
);
}
}
+14
View File
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../services/device_performance.dart';
import '../theme/mono_tokens.dart';
import '../utils/platform_detector.dart';
class FocusTheme {
FocusTheme._();
@@ -24,6 +25,19 @@ class FocusTheme {
return Theme.of(context).extension<MonoTokens>()?.fast ?? const Duration(milliseconds: 150);
}
/// How long a TV row (or the hub list) glides after one D-pad focus step.
///
/// Apple TV keeps the ~500ms ease-out measured from the native focus
/// engine's scrollable containers (issue #2006): Siri Remote swipes chain
/// steps into one continuous glide and users expect that inertia. D-pad
/// platforms have no such reference: Leanback's `GridLayoutManager` prices a
/// one-card step at roughly 100-150ms, so a 500ms glide there trails the
/// focus border on every press and reads as input lag next to the launcher.
/// Successive presses (including hold-repeats) retarget the animation from
/// wherever the row currently is, so a fast series still glides continuously.
static Duration navigationScrollDuration() =>
PlatformDetector.isAppleTV() ? const Duration(milliseconds: 500) : const Duration(milliseconds: 150);
/// [radii] overrides [borderRadius] when per-corner radii are needed
/// (M3E grouped cards: large outer / small inner corners).
static BoxDecoration focusDecoration(
+40
View File
@@ -86,6 +86,11 @@ class TvTextInputController {
/// Focus the field without opening either native or Flutter text input for
/// this focus entry.
void focusInputWithoutOpening() => _host?._focusWithoutKeyboard();
/// Focus the field and open its text input, as an explicit Select would —
/// for a field the app creates on the user's behalf (a new editor row) that
/// should be typed into at once, without a second press.
void focusAndOpenTextInput() => _host?._focusAndOpenTextInput();
}
String _describeTextInputKey(KeyEvent event) {
@@ -1167,6 +1172,41 @@ class _FocusableTextInputHostState extends State<_FocusableTextInputHost> {
});
}
/// Focus the field and open text input as an explicit Select would. Clears
/// per-focus suppression first so a field configured with
/// [TvTextInputAutoOpenBehavior.never] still opens.
void _focusAndOpenTextInput() {
_suppressTvKeyboardAutoOpen = false;
_suppressNativeTextInputForCurrentFocus = false;
final focusNode = _installedFocusNode ?? _effectiveFocusNode;
if (focusNode.hasFocus) {
_openTextInputForFocusedField();
return;
}
focusNode.requestFocus();
// Focus lands in FocusManager's microtask. Activating before that would be
// undone by the focus sync this frame's build already scheduled, which
// deactivates an unfocused field.
scheduleMicrotask(() {
if (mounted && focusNode.hasFocus) _openTextInputForFocusedField();
});
}
void _openTextInputForFocusedField() {
if (widget.input._usesNativeTvKeyboard) {
_activateNativeTextInput();
} else if (widget.input._hasTvKeyboard && !_tvKeyboardOpen && !_tvKeyboardOpenScheduled) {
// The overlay is a navigator route; push it once the focus request has
// landed so the route's focus scope does not race the field's.
_tvKeyboardOpenScheduled = true;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
_tvKeyboardOpenScheduled = false;
_openTvKeyboard();
});
}
}
void _setNativeTextInputFocused(bool focused) {
if (_reportedNativeTextInputFocused == focused) {
_logTvTextInput('Host.setNativeTextInputFocused no-op focused=$focused');
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Defolt keyfiyyət",
"cellularQualityTitle": "Mobil şəbəkədə defolt keyfiyyət",
"cellularQualitySameAsDefault": "Defolt keyfiyyətlə eyni",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Musiqi keyfiyyəti",
"subtitleStyling": "Altyazı tənzimləmələri",
"subtitleStylingDescription": "Altyazı görünüşünü özünüləşdirin",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Səsi tənzimləmək üçün sağ kənarda yuxarı və ya aşağı sürüşdürün",
"gesturePinchToZoom": "Çimdiklə yaxınlaşdır",
"gesturePinchToZoomDescription": "Yaxınlaşdırmaq və ya uzaqlaşdırmaq üçün videoda çimdik hərəkəti edin",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "İdarəetmələr",
"rememberPlayerChanges": "Pleyer dəyişikliklərini yadda saxla",
"rememberPlayerChangesDescription": "Oxutma zamanı edilən dəyişikliklərin harada saxlanacağı və yenidən tətbiq ediləcəyi",
@@ -851,6 +855,9 @@
"presetDeleted": "Ön ayar silindi",
"confirmDeletePreset": "Bu ön ayarı silmək istədiyinizə əminsiniz?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# şərh",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context və gpu-api Linux-da nəzərə alınmır: daxili video həmişə video müstəvisində vo=libmpv vasitəsilə göstərilir və gpu-next (ArtCNN kimi hesablama şeyderlərinə lazımdır) daxili işləyə bilməz."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Təşkilatçı",
"hostBadge": "TƏŞKİLATÇI",
"youAreHost": "Təşkilatçı sizsiniz",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Başqaları ilə izlənilir",
"endSession": "Seansı bitir",
"leaveSession": "Seansdan çıx",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} fasilə etdi",
"participantResumed": "${name} davam etdirdi",
"participantSeeked": "${name} oynatma mövqeyini dəyişdi",
"participantChangedSpeed": "",
"participantBuffering": "${name} buferləyir",
"participantNeedsUpdate": "${name} köhnə tətbiq versiyasındadır",
"resumingWithout": "${name} olmadan davam edilir",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Keyfiyyət profili",
"rootFolder": "Kök qovluq",
"languageProfile": "Dil profili",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Sorğu göndərildi",
"requestFailed": "Sorğu uğursuz oldu: ${error}",
"requestsLoadFailed": "Seçimlər yüklənə bilmədi",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Bloklanmış",
"couldNotReach": "${url} ünvanına çatmaq olmadı: ${error}",
"noInstanceAtUrl": "${url} ünvanında Seerr instansiyası yoxdur (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "https://seerr.example.com kimi server ünvanı daxil edin",
"quickConnectUnsupported": "Bu Seerr nüsxəsi Sürətli Qoşulmanı dəstəkləmir. Seerr 3.4 və ya daha yeni versiya tələb olunur.",
"notInitialized": "Bu Seerr instansiyasının ilkin quraşdırılması tamamlanmayıb",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Качество по подразбиране",
"cellularQualityTitle": "Качество по подразбиране при мобилни данни",
"cellularQualitySameAsDefault": "Същото като качеството по подразбиране",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Качество на музиката",
"subtitleStyling": "Стил на субтитрите",
"subtitleStylingDescription": "Настройване на вида на субтитрите",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Плъзни нагоре или надолу по десния ръб, за да регулираш силата на звука",
"gesturePinchToZoom": "Стискане за мащабиране",
"gesturePinchToZoomDescription": "Стисни видеото, за да увеличиш или намалиш мащаба",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Контроли",
"rememberPlayerChanges": "Запомняне на промените в плейъра",
"rememberPlayerChangesDescription": "Къде се записва и откъде се прилага отново промяна, направена по време на възпроизвеждане",
@@ -851,6 +855,9 @@
"presetDeleted": "Пресетът е изтрит",
"confirmDeletePreset": "Сигурни ли сте, че искате да изтриете този пресет?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context и gpu-api се игнорират на Linux: вграденото видео винаги се рендерира през vo=libmpv върху видео равнината, а gpu-next (който е нужен за compute шейдъри като ArtCNN) не може да работи вградено."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Организатор",
"hostBadge": "ОРГАНИЗАТОР",
"youAreHost": "Вие сте организаторът",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Гледате с други",
"endSession": "Край на сесията",
"leaveSession": "Напусни сесията",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} постави на пауза",
"participantResumed": "${name} продължи",
"participantSeeked": "${name} промени позицията на възпроизвеждане",
"participantChangedSpeed": "",
"participantBuffering": "${name} буферира",
"participantNeedsUpdate": "${name} е с по-стара версия на приложението — синхронизирането не е налично",
"resumingWithout": "Продължаване без ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Профил за качество",
"rootFolder": "Основна папка",
"languageProfile": "Езиков профил",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Заявката е изпратена",
"requestFailed": "Заявката се провали: ${error}",
"requestsLoadFailed": "Неуспешно зареждане на опциите за заявка",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "В списъка с блокирани",
"couldNotReach": "Неуспешна връзка с ${url}: ${error}",
"noInstanceAtUrl": "На ${url} няма инстанция на Seerr (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Въведете адрес на сървър като https://seerr.example.com",
"quickConnectUnsupported": "Тази Seerr инстанция не поддържа Quick Connect. Изисква се Seerr 3.4 или по-нова версия.",
"notInitialized": "Тази инстанция на Seerr не е завършила първоначалната настройка",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Standardkvalitet",
"cellularQualityTitle": "Standardkvalitet på mobildata",
"cellularQualitySameAsDefault": "Samme som standardkvalitet",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Musikkvalitet",
"subtitleStyling": "Undertekststil",
"subtitleStylingDescription": "Tilpas underteksters udseende",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Stryg op eller ned i højre kant for at justere lydstyrken",
"gesturePinchToZoom": "Klem for at zoome",
"gesturePinchToZoomDescription": "Klem på videoen for at zoome ind eller ud",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Kontroller",
"rememberPlayerChanges": "Husk afspillerændringer",
"rememberPlayerChangesDescription": "Hvor en ændring under afspilning gemmes og anvendes igen",
@@ -851,6 +855,9 @@
"presetDeleted": "Forudindstilling slettet",
"confirmDeletePreset": "Er du sikker på, at du vil slette denne forudindstilling?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context og gpu-api ignoreres på Linux: indlejret video renderes altid via vo=libmpv på videoplanen, og gpu-next (som compute-shaders som ArtCNN kræver) kan ikke køre indlejret."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Vært",
"hostBadge": "VÆRT",
"youAreHost": "Du er vært",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Ser med andre",
"endSession": "Afslut session",
"leaveSession": "Forlad session",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} satte på pause",
"participantResumed": "${name} genoptog",
"participantSeeked": "${name} ændrede afspilningspositionen",
"participantChangedSpeed": "",
"participantBuffering": "${name} bufferer",
"participantNeedsUpdate": "${name} bruger en ældre appversion — synkronisering er ikke tilgængelig",
"resumingWithout": "Fortsætter uden ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Kvalitetsprofil",
"rootFolder": "Rodmappe",
"languageProfile": "Sprogprofil",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Anmodning sendt",
"requestFailed": "Anmodning mislykkedes: ${error}",
"requestsLoadFailed": "Kunne ikke indlæse anmodningsmuligheder",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "På blokeringslisten",
"couldNotReach": "Kunne ikke nå ${url}: ${error}",
"noInstanceAtUrl": "Ingen Seerr-instans på ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Indtast en serveradresse som https://seerr.example.com",
"quickConnectUnsupported": "Denne Seerr-instans understøtter ikke Quick Connect. Den kræver Seerr 3.4 eller nyere.",
"notInitialized": "Denne Seerr-instans har ikke fuldført førstegangsopsætningen",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Standardqualität",
"cellularQualityTitle": "Standardqualität im Mobilfunknetz",
"cellularQualitySameAsDefault": "Wie Standardqualität",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Musikqualität",
"subtitleStyling": "Untertitel-Stil",
"subtitleStylingDescription": "Aussehen von Untertiteln anpassen",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Wische am rechten Rand nach oben oder unten, um die Lautstärke anzupassen",
"gesturePinchToZoom": "Zum Zoomen kneifen",
"gesturePinchToZoomDescription": "Kneife auf dem Video, um hinein- oder herauszuzoomen",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Steuerung",
"rememberPlayerChanges": "Playeränderungen merken",
"rememberPlayerChangesDescription": "Wo eine während der Wiedergabe vorgenommene Änderung gespeichert und erneut angewendet wird",
@@ -851,6 +855,9 @@
"presetDeleted": "Voreinstellung gelöscht",
"confirmDeletePreset": "Diese Voreinstellung wirklich löschen?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context und gpu-api werden unter Linux ignoriert: eingebettetes Video wird immer über vo=libmpv auf der Videoebene gerendert, und gpu-next (das Compute-Shader wie ArtCNN benötigen) kann nicht eingebettet ausgeführt werden."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Host",
"hostBadge": "HOST",
"youAreHost": "Du bist der Host",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Mit anderen schauen",
"endSession": "Sitzung beenden",
"leaveSession": "Sitzung verlassen",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} hat pausiert",
"participantResumed": "${name} hat fortgesetzt",
"participantSeeked": "${name} hat die Wiedergabeposition geändert",
"participantChangedSpeed": "",
"participantBuffering": "${name} puffert",
"participantNeedsUpdate": "${name} verwendet eine ältere Appversion — Synchronisierung nicht verfügbar",
"resumingWithout": "Fortfahren ohne ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Qualitätsprofil",
"rootFolder": "Stammordner",
"languageProfile": "Sprachprofil",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Anfrage gesendet",
"requestFailed": "Anfrage fehlgeschlagen: ${error}",
"requestsLoadFailed": "Anfrageoptionen konnten nicht geladen werden",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Auf der Sperrliste",
"couldNotReach": "${url} nicht erreichbar: ${error}",
"noInstanceAtUrl": "Keine Seerr-Instanz unter ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Gib eine Serveradresse ein, z. B. https://seerr.example.com",
"quickConnectUnsupported": "Diese Seerr-Instanz unterstützt Quick Connect nicht. Dafür ist Seerr 3.4 oder neuer erforderlich.",
"notInitialized": "Die Ersteinrichtung dieser Seerr-Instanz wurde noch nicht abgeschlossen",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Default Quality",
"cellularQualityTitle": "Default Quality on Cellular",
"cellularQualitySameAsDefault": "Same as Default Quality",
"directPlayCoveredQuality": "Play Smaller Videos at Original Quality",
"directPlayCoveredQualityDescription": "Direct play videos already within the quality limit instead of transcoding them",
"musicQualityTitle": "Music Quality",
"subtitleStyling": "Subtitle Styling",
"subtitleStylingDescription": "Customize subtitle appearance",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Swipe up or down on the right edge to adjust volume",
"gesturePinchToZoom": "Pinch to Zoom",
"gesturePinchToZoomDescription": "Pinch on the video to zoom in or out",
"rememberBrightnessLevel": "Remember Brightness Level",
"rememberBrightnessLevelDescription": "Start playback at the brightness set by the last swipe",
"controls": "Controls",
"rememberPlayerChanges": "Remember Player Changes",
"rememberPlayerChangesDescription": "Where a change made during playback is saved and reapplied from",
@@ -851,6 +855,9 @@
"presetDeleted": "Preset deleted",
"confirmDeletePreset": "Are you sure you want to delete this preset?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "option=value",
"addLine": "Add line",
"removeLine": "Remove line",
"embeddedVoHint": "vo, gpu-context and gpu-api are ignored on Linux: embedded video always renders through vo=libmpv on the video plane, and gpu-next (which compute shaders like ArtCNN need) cannot run embedded."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Host",
"hostBadge": "HOST",
"youAreHost": "You are the host",
"makeHost": "Make host",
"makeHostQuestion": "Transfer host?",
"makeHostConfirm": "${name} will control playback and drive the session for everyone.",
"transfer": "Transfer",
"hostChangedTo": "${name} is now the host",
"youAreNowHost": "You are now the host",
"hostTransferFailed": "Couldn't make ${name} the host",
"watchingWithOthers": "Watching with others",
"endSession": "End Session",
"leaveSession": "Leave Session",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} paused",
"participantResumed": "${name} resumed",
"participantSeeked": "${name} changed the playback position",
"participantChangedSpeed": "${name} set the speed to ${speed}",
"participantBuffering": "${name} is buffering",
"participantNeedsUpdate": "${name} is on an older app version — sync unavailable",
"resumingWithout": "Resuming without ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Quality profile",
"rootFolder": "Root folder",
"languageProfile": "Language profile",
"tags": "Tags",
"noTags": "No tags",
"defaultOption": "${name} (Default)",
"animeNote": "This series is an anime.",
"requestSubmitted": "Request submitted",
"requestFailed": "Request failed: ${error}",
"requestsLoadFailed": "Couldn't load request options",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Blocklisted",
"couldNotReach": "Could not reach ${url}: ${error}",
"noInstanceAtUrl": "No Seerr instance at ${url} (HTTP ${status})",
"behindAuthProxy": "An authenticating reverse proxy (SSO or HTTP auth) answered instead of Seerr. Plezy cannot sign in through it: let Seerr's /api/v1 path bypass the proxy for this app, or use an address that reaches Seerr directly.",
"invalidUrl": "Enter a server address like https://seerr.example.com",
"quickConnectUnsupported": "This Seerr instance does not support Quick Connect. It needs Seerr 3.4 or newer.",
"notInitialized": "This Seerr instance has not completed first-run setup",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Calidad predeterminada",
"cellularQualityTitle": "Calidad predeterminada en datos móviles",
"cellularQualitySameAsDefault": "Igual que la calidad predeterminada",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Calidad de música",
"subtitleStyling": "Estilo de subtítulos",
"subtitleStylingDescription": "Personalizar la apariencia de los subtítulos",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Desliza hacia arriba o abajo en el borde derecho para ajustar el volumen",
"gesturePinchToZoom": "Pellizcar para hacer zoom",
"gesturePinchToZoomDescription": "Pellizca el video para acercar o alejar",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Controles",
"rememberPlayerChanges": "Recordar cambios del reproductor",
"rememberPlayerChangesDescription": "Dónde se guarda y se vuelve a aplicar un cambio realizado durante la reproducción",
@@ -851,6 +855,9 @@
"presetDeleted": "Preajuste eliminado",
"confirmDeletePreset": "¿Estás seguro de que quieres eliminar este preajuste?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context y gpu-api se ignoran en Linux: el vídeo integrado siempre se renderiza mediante vo=libmpv en el plano de vídeo, y gpu-next (que los shaders de cómputo como ArtCNN necesitan) no puede ejecutarse integrado."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Anfitrión",
"hostBadge": "ANFITRIÓN",
"youAreHost": "Eres el anfitrión",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Viendo contenido con otras personas",
"endSession": "Finalizar sesión",
"leaveSession": "Salir de la sesión",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} pausó",
"participantResumed": "${name} reanudó",
"participantSeeked": "${name} cambió la posición de reproducción",
"participantChangedSpeed": "",
"participantBuffering": "${name} está almacenando en búfer",
"participantNeedsUpdate": "${name} usa una versión anterior de la aplicación — sincronización no disponible",
"resumingWithout": "Reanudando sin ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Perfil de calidad",
"rootFolder": "Carpeta raíz",
"languageProfile": "Perfil de idioma",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Solicitud enviada",
"requestFailed": "La solicitud falló: ${error}",
"requestsLoadFailed": "No se pudieron cargar las opciones de solicitud",
@@ -2074,6 +2093,7 @@
"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})",
"behindAuthProxy": "",
"invalidUrl": "Introduce una dirección de servidor como https://seerr.example.com",
"quickConnectUnsupported": "Esta instancia de Seerr no admite Quick Connect. Necesita Seerr 3.4 o más reciente.",
"notInitialized": "Esta instancia de Seerr no ha completado la configuración inicial",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Qualité par défaut",
"cellularQualityTitle": "Qualité par défaut sur les données mobiles",
"cellularQualitySameAsDefault": "Identique à la qualité par défaut",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Qualité de la musique",
"subtitleStyling": "Style des sous-titres",
"subtitleStylingDescription": "Personnaliser lapparence des sous-titres",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Balayez vers le haut ou le bas sur le bord droit pour régler le volume",
"gesturePinchToZoom": "Pincer pour zoomer",
"gesturePinchToZoomDescription": "Pincez la vidéo pour zoomer ou dézoomer",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Commandes",
"rememberPlayerChanges": "Mémoriser les modifications du lecteur",
"rememberPlayerChangesDescription": "Où une modification effectuée pendant la lecture est enregistrée et réappliquée",
@@ -851,6 +855,9 @@
"presetDeleted": "Préréglage supprimé",
"confirmDeletePreset": "Êtes-vous sûr de vouloir supprimer ce préréglage ?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context et gpu-api sont ignorés sous Linux : la vidéo intégrée est toujours rendue via vo=libmpv sur le plan vidéo, et gpu-next (dont les shaders de calcul comme ArtCNN ont besoin) ne peut pas fonctionner en mode intégré."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Hôte",
"hostBadge": "HÔTE",
"youAreHost": "Vous êtes l'hôte",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Regarder avec d'autres personnes",
"endSession": "Terminer la session",
"leaveSession": "Quitter la session",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} a mis en pause",
"participantResumed": "${name} a repris",
"participantSeeked": "${name} a changé la position de lecture",
"participantChangedSpeed": "",
"participantBuffering": "La lecture de ${name} est en cours de mise en mémoire tampon",
"participantNeedsUpdate": "${name} utilise une ancienne version de lapp — synchronisation indisponible",
"resumingWithout": "Reprise sans ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Profil de qualité",
"rootFolder": "Dossier racine",
"languageProfile": "Profil de langue",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Demande envoyée",
"requestFailed": "Échec de la demande : ${error}",
"requestsLoadFailed": "Impossible de charger les options de demande",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Sur la liste de blocage",
"couldNotReach": "Impossible de joindre ${url} : ${error}",
"noInstanceAtUrl": "Aucune instance Seerr à ladresse ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Saisissez une adresse de serveur comme https://seerr.example.com",
"quickConnectUnsupported": "Cette instance Seerr ne prend pas en charge Quick Connect. Elle nécessite Seerr 3.4 ou version ultérieure.",
"notInitialized": "La configuration initiale de cette instance Seerr nest pas terminée",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Alapértelmezett minőség",
"cellularQualityTitle": "Alapértelmezett minőség mobilhálózaton",
"cellularQualitySameAsDefault": "Ugyanaz, mint az alapértelmezett minőség",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Zene minősége",
"subtitleStyling": "Feliratok stílusa",
"subtitleStylingDescription": "Feliratok megjelenésének testreszabása",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Húzd felfelé vagy lefelé a jobb szélén a hangerő beállításához",
"gesturePinchToZoom": "Csípés a nagyításhoz",
"gesturePinchToZoomDescription": "Csípj a videóra a nagyításhoz vagy kicsinyítéshez",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Vezérlők",
"rememberPlayerChanges": "Lejátszó módosításainak megjegyzése",
"rememberPlayerChangesDescription": "A lejátszás közben végzett módosítások mentési és újbóli alkalmazási helye",
@@ -851,6 +855,9 @@
"presetDeleted": "Előbeállítás törölve",
"confirmDeletePreset": "Biztosan törölni szeretnéd ezt az előbeállítást?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# megjegyzés",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "A vo, gpu-context és gpu-api beállítások Linuxon figyelmen kívül maradnak: a beágyazott videó mindig a vo=libmpv-n keresztül jelenik meg a videósíkon, a gpu-next (amelyre az ArtCNN-hez hasonló compute shadereknek szükségük van) pedig nem futhat beágyazva."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Házigazda",
"hostBadge": "HÁZIGAZDA",
"youAreHost": "Te vagy a házigazda",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Nézés másokkal",
"endSession": "Munkamenet befejezése",
"leaveSession": "Munkamenet elhagyása",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} szüneteltette a lejátszást",
"participantResumed": "${name} folytatta a lejátszást",
"participantSeeked": "${name} módosította a lejátszási pozíciót",
"participantChangedSpeed": "",
"participantBuffering": "${name} pufferel",
"participantNeedsUpdate": "${name} régebbi alkalmazásverziót használ — a szinkronizálás nem érhető el",
"resumingWithout": "Folytatás a következő nélkül: ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Minőségi profil",
"rootFolder": "Gyökérmappa",
"languageProfile": "Nyelvi profil",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Igénylés elküldve",
"requestFailed": "Az igénylés nem sikerült: ${error}",
"requestsLoadFailed": "Nem sikerült betölteni az igénylési opciókat",
@@ -2074,6 +2093,7 @@
"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})",
"behindAuthProxy": "",
"invalidUrl": "Adj meg egy szervercímet, például: https://seerr.example.com",
"quickConnectUnsupported": "Ez a Seerr-példány nem támogatja a Quick Connectet. Seerr 3.4 vagy újabb verzió szükséges.",
"notInitialized": "Ennek a Seerr-példánynak a kezdeti beállítása még nem fejeződött be",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Qualità predefinita",
"cellularQualityTitle": "Qualità predefinita sulla rete mobile",
"cellularQualitySameAsDefault": "Come la qualità predefinita",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Qualità musicale",
"subtitleStyling": "Stile sottotitoli",
"subtitleStylingDescription": "Personalizza l'aspetto dei sottotitoli",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Scorri verso l'alto o il basso sul bordo destro per regolare il volume",
"gesturePinchToZoom": "Pizzica per lo zoom",
"gesturePinchToZoomDescription": "Pizzica il video per ingrandire o ridurre",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Controlli",
"rememberPlayerChanges": "Ricorda le modifiche del lettore",
"rememberPlayerChangesDescription": "Dove viene salvata e riapplicata una modifica effettuata durante la riproduzione",
@@ -851,6 +855,9 @@
"presetDeleted": "Preset eliminato",
"confirmDeletePreset": "Sei sicuro di voler eliminare questo preset?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context e gpu-api vengono ignorati su Linux: il video incorporato viene sempre renderizzato tramite vo=libmpv sul piano video e gpu-next (che gli shader di calcolo come ArtCNN richiedono) non può essere eseguito in modalità incorporata."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Host",
"hostBadge": "HOST",
"youAreHost": "Sei l'host",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "In visione con altri partecipanti",
"endSession": "Termina la sessione",
"leaveSession": "Abbandona la sessione",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} ha messo in pausa",
"participantResumed": "${name} ha ripreso",
"participantSeeked": "${name} ha cambiato la posizione di riproduzione",
"participantChangedSpeed": "",
"participantBuffering": "${name} è in buffering",
"participantNeedsUpdate": "${name} usa una versione precedente dell'app — sincronizzazione non disponibile",
"resumingWithout": "Ripresa senza ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Profilo di qualità",
"rootFolder": "Cartella radice",
"languageProfile": "Profilo della lingua",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Richiesta inviata",
"requestFailed": "Richiesta non riuscita: ${error}",
"requestsLoadFailed": "Impossibile caricare le opzioni di richiesta",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Nella lista di blocco",
"couldNotReach": "Impossibile raggiungere ${url}: ${error}",
"noInstanceAtUrl": "Nessuna istanza Seerr all'indirizzo ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Inserisci un indirizzo del server come https://seerr.example.com",
"quickConnectUnsupported": "Questa istanza Seerr non supporta Quick Connect. È necessaria la versione 3.4 o successiva di Seerr.",
"notInitialized": "Questa istanza Seerr non ha completato la configurazione iniziale",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "デフォルト画質",
"cellularQualityTitle": "モバイルデータ通信時のデフォルト画質",
"cellularQualitySameAsDefault": "デフォルト画質と同じ",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "音楽の音質",
"subtitleStyling": "字幕スタイル",
"subtitleStylingDescription": "字幕の外観をカスタマイズ",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "右端を上下にスワイプして音量を調整します",
"gesturePinchToZoom": "ピンチでズーム",
"gesturePinchToZoomDescription": "動画をピンチしてズームイン・アウト",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "コントロール",
"rememberPlayerChanges": "プレーヤーの変更を記憶",
"rememberPlayerChangesDescription": "再生中に行った変更を保存し、再適用する場所",
@@ -847,6 +851,9 @@
"presetDeleted": "プリセットを削除しました",
"confirmDeletePreset": "このプリセットを削除してもよろしいですか?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "Linux では vo、gpu-context、gpu-api は無視されます。埋め込み動画は常にビデオプレーン上で vo=libmpv を通してレンダリングされ、gpu-next(ArtCNN のようなコンピュートシェーダーに必要)は埋め込みでは実行できません。"
},
"dialog": {
@@ -1575,6 +1582,13 @@
"host": "ホスト",
"hostBadge": "ホスト",
"youAreHost": "あなたはホストです",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "他の人と視聴中",
"endSession": "セッションを終了",
"leaveSession": "セッションを退出",
@@ -1607,6 +1621,7 @@
"participantPaused": "${name}が一時停止しました",
"participantResumed": "${name}が再開しました",
"participantSeeked": "${name}が再生位置を変更しました",
"participantChangedSpeed": "",
"participantBuffering": "${name}がバッファリング中",
"participantNeedsUpdate": "${name}は古いバージョンのアプリを使用しているため、同期できません",
"resumingWithout": "${name}抜きで再開",
@@ -2053,6 +2068,10 @@
"qualityProfile": "画質プロファイル",
"rootFolder": "ルートフォルダ",
"languageProfile": "言語プロファイル",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "リクエストを送信しました",
"requestFailed": "リクエストに失敗しました: ${error}",
"requestsLoadFailed": "リクエストオプションを読み込めませんでした",
@@ -2064,6 +2083,7 @@
"statusBlocklisted": "ブロックリスト登録済み",
"couldNotReach": "${url}に接続できませんでした: ${error}",
"noInstanceAtUrl": "${url}にSeerrインスタンスがありません(HTTP ${status}",
"behindAuthProxy": "",
"invalidUrl": "https://seerr.example.comのようなサーバーアドレスを入力してください",
"quickConnectUnsupported": "このSeerrインスタンスはQuick Connectに対応していません。Seerr 3.4以降が必要です。",
"notInitialized": "このSeerrインスタンスでは初回セットアップが完了していません",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Әдепкі сапа",
"cellularQualityTitle": "Мобильді желідегі әдепкі сапа",
"cellularQualitySameAsDefault": "Әдепкі сапамен бірдей",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Музыка сапасы",
"subtitleStyling": "Субтитр баптаулары",
"subtitleStylingDescription": "Субтитрлердің сыртқы келбетін теңшеу",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Оң жақ шетінде жоғары немесе төмен сырғытып, дыбыс деңгейін реттеу",
"gesturePinchToZoom": "Шымшу арқылы масштабтау",
"gesturePinchToZoomDescription": "Видеода шымшып, жақындату немесе алыстату",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Басқару элементтері",
"rememberPlayerChanges": "Ойнатқыш өзгерістерін есте сақтау",
"rememberPlayerChangesDescription": "Ойнату кезінде жасалған өзгеріс сақталатын және қайта қолданылатын орын",
@@ -851,6 +855,9 @@
"presetDeleted": "Баптау өшірілді",
"confirmDeletePreset": "Осы баптауды өшіргіңіз келетініне сенімдісіз бе?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# түсініктеме",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context және gpu-api Linux-те еленбейді: ендірілген бейне әрқашан бейне жазықтығында vo=libmpv арқылы көрсетіледі, ал gpu-next (ArtCNN сияқты compute шейдерлеріне қажет) ендірілген режимде жұмыс істей алмайды."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Ұйымдастырушы",
"hostBadge": "ҰЙЫМДАСТЫРУШЫ",
"youAreHost": "Сіз ұйымдастырушысыз",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Басқалармен бірге көрілуде",
"endSession": "Сеансты аяқтау",
"leaveSession": "Сеанстан шығу",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} кідіртті",
"participantResumed": "${name} жалғастырды",
"participantSeeked": "${name} уақытты өзгертті",
"participantChangedSpeed": "",
"participantBuffering": "${name} буферлеуде",
"participantNeedsUpdate": "${name} ескі нұсқада",
"resumingWithout": "${name} ескерусіз жалғастырылуда",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Сапа профилі",
"rootFolder": "Түпкі қапшық",
"languageProfile": "Тіл профилі",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Сұрау жіберілді",
"requestFailed": "Сұрау қатесі: ${error}",
"requestsLoadFailed": "Параметрлерді жүктеу мүмкін болмады",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Бұғаттау тізімінде",
"couldNotReach": "${url} мекенжайына қосылу мүмкін болмады: ${error}",
"noInstanceAtUrl": "${url} мекенжайында Seerr данасы жоқ (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Сервер мекенжайын енгізіңіз, мысалы: https://seerr.example.com",
"quickConnectUnsupported": "Бұл Seerr данасы Жылдам қосылуды қолдамайды. Оған Seerr 3.4 немесе одан жаңарақ нұсқа қажет.",
"notInitialized": "Бұл Seerr данасының бастапқы баптауы аяқталмаған",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "기본 화질",
"cellularQualityTitle": "셀룰러에서 기본 화질",
"cellularQualitySameAsDefault": "기본 화질과 동일",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "음악 음질",
"subtitleStyling": "자막 스타일",
"subtitleStylingDescription": "자막 모양을 사용자 지정합니다",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "오른쪽 가장자리에서 위아래로 스와이프하여 볼륨을 조절합니다",
"gesturePinchToZoom": "핀치 줌",
"gesturePinchToZoomDescription": "비디오에서 핀치하여 확대하거나 축소합니다",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "컨트롤",
"rememberPlayerChanges": "플레이어 변경 사항 기억",
"rememberPlayerChangesDescription": "재생 중 변경한 사항을 저장하고 다시 적용할 위치",
@@ -847,6 +851,9 @@
"presetDeleted": "프리셋이 삭제되었습니다",
"confirmDeletePreset": "이 프리셋을 삭제하시겠습니까?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "Linux에서는 vo, gpu-context, gpu-api가 무시됩니다. 내장 동영상은 항상 비디오 평면에서 vo=libmpv로 렌더링되며, gpu-next(ArtCNN 같은 컴퓨트 셰이더에 필요)는 내장 방식으로 실행할 수 없습니다."
},
"dialog": {
@@ -1575,6 +1582,13 @@
"host": "호스트",
"hostBadge": "호스트",
"youAreHost": "호스트입니다",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "다른 사람과 함께 시청 중",
"endSession": "세션 종료",
"leaveSession": "세션 나가기",
@@ -1607,6 +1621,7 @@
"participantPaused": "${name}님이 일시정지했습니다",
"participantResumed": "${name}님이 재생했습니다",
"participantSeeked": "${name}님이 재생 위치를 변경했습니다",
"participantChangedSpeed": "",
"participantBuffering": "${name}님이 버퍼링 중입니다",
"participantNeedsUpdate": "${name}님이 이전 버전의 앱을 사용 중입니다 — 동기화를 사용할 수 없습니다",
"resumingWithout": "${name}님 없이 재생을 재개합니다",
@@ -2053,6 +2068,10 @@
"qualityProfile": "화질 프로파일",
"rootFolder": "루트 폴더",
"languageProfile": "언어 프로파일",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "요청을 제출했습니다",
"requestFailed": "요청 실패: ${error}",
"requestsLoadFailed": "요청 옵션을 불러올 수 없습니다",
@@ -2064,6 +2083,7 @@
"statusBlocklisted": "차단 목록에 있음",
"couldNotReach": "${url}에 연결할 수 없습니다: ${error}",
"noInstanceAtUrl": "${url}에 Seerr 인스턴스가 없습니다(HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "https://seerr.example.com과 같은 서버 주소를 입력하세요",
"quickConnectUnsupported": "이 Seerr 인스턴스는 Quick Connect를 지원하지 않습니다. Seerr 3.4 이상이 필요합니다.",
"notInitialized": "이 Seerr 인스턴스는 최초 실행 설정을 완료하지 않았습니다",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Standardkvalitet",
"cellularQualityTitle": "Standardkvalitet på mobilnett",
"cellularQualitySameAsDefault": "Samme som standardkvalitet",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Musikkvalitet",
"subtitleStyling": "Undertekststil",
"subtitleStylingDescription": "Tilpass utseendet på undertekster",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Sveip opp eller ned på høyre kant for å justere volumet",
"gesturePinchToZoom": "Klyp for å zoome",
"gesturePinchToZoomDescription": "Klyp på videoen for å zoome inn eller ut",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Kontroller",
"rememberPlayerChanges": "Husk endringer i spilleren",
"rememberPlayerChangesDescription": "Hvor en endring under avspilling lagres og brukes på nytt",
@@ -851,6 +855,9 @@
"presetDeleted": "Forhåndsinnstilling slettet",
"confirmDeletePreset": "Er du sikker på at du vil slette denne forhåndsinnstillingen?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# kommentar",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context og gpu-api ignoreres på Linux: innebygd video renderes alltid via vo=libmpv på videoplanet, og gpu-next (som compute-shadere som ArtCNN trenger) kan ikke kjøre innebygd."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Vert",
"hostBadge": "VERT",
"youAreHost": "Du er verten",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Ser med andre",
"endSession": "Avslutt økt",
"leaveSession": "Forlat økt",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} satte avspillingen på pause",
"participantResumed": "${name} startet avspillingen igjen",
"participantSeeked": "${name} endret avspillingsposisjonen",
"participantChangedSpeed": "",
"participantBuffering": "${name} buffrer",
"participantNeedsUpdate": "${name} bruker en eldre appversjon — synkronisering er ikke tilgjengelig",
"resumingWithout": "Fortsetter uten ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Kvalitetsprofil",
"rootFolder": "Rotmappe",
"languageProfile": "Språkprofil",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Forespørsel sendt",
"requestFailed": "Forespørsel mislyktes: ${error}",
"requestsLoadFailed": "Kunne ikke laste forespørselsalternativer",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "På blokkeringslisten",
"couldNotReach": "Kunne ikke nå ${url}: ${error}",
"noInstanceAtUrl": "Ingen Seerr-instans på ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Skriv inn en serveradresse som https://seerr.example.com",
"quickConnectUnsupported": "Denne Seerr-instansen støtter ikke Quick Connect. Den krever Seerr 3.4 eller nyere.",
"notInitialized": "Denne Seerr-instansen har ikke fullført førstegangsoppsettet",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Standaardkwaliteit",
"cellularQualityTitle": "Standaardkwaliteit bij mobiele data",
"cellularQualitySameAsDefault": "Zelfde als standaardkwaliteit",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Muziekkwaliteit",
"subtitleStyling": "Ondertitelopmaak",
"subtitleStylingDescription": "Pas de weergave van ondertitels aan",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Veeg op de rechterrand omhoog of omlaag om het volume aan te passen",
"gesturePinchToZoom": "Knijpen om te zoomen",
"gesturePinchToZoomDescription": "Knijp op de video om in of uit te zoomen",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Bediening",
"rememberPlayerChanges": "Spelerwijzigingen onthouden",
"rememberPlayerChangesDescription": "Waar een wijziging tijdens het afspelen wordt opgeslagen en opnieuw toegepast",
@@ -851,6 +855,9 @@
"presetDeleted": "Voorinstelling verwijderd",
"confirmDeletePreset": "Weet je zeker dat je deze voorinstelling wilt verwijderen?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context en gpu-api worden genegeerd op Linux: ingebedde video wordt altijd weergegeven via vo=libmpv op het videovlak, en gpu-next (nodig voor compute-shaders zoals ArtCNN) kan niet ingebed draaien."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Host",
"hostBadge": "HOST",
"youAreHost": "Jij bent de host",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Kijken met anderen",
"endSession": "Sessie beëindigen",
"leaveSession": "Sessie verlaten",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} heeft gepauzeerd",
"participantResumed": "${name} heeft hervat",
"participantSeeked": "${name} heeft de afspeelpositie gewijzigd",
"participantChangedSpeed": "",
"participantBuffering": "${name} is aan het bufferen",
"participantNeedsUpdate": "${name} gebruikt een oudere appversie — synchronisatie niet beschikbaar",
"resumingWithout": "Hervatten zonder ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Kwaliteitsprofiel",
"rootFolder": "Hoofdmap",
"languageProfile": "Taalprofiel",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Aanvraag verzonden",
"requestFailed": "Aanvraag mislukt: ${error}",
"requestsLoadFailed": "Aanvraagopties konden niet worden geladen",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Op de blokkeerlijst",
"couldNotReach": "Kon ${url} niet bereiken: ${error}",
"noInstanceAtUrl": "Geen Seerr-instantie op ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Voer een serveradres in, zoals https://seerr.example.com",
"quickConnectUnsupported": "Deze Seerr-instantie ondersteunt Quick Connect niet. Hiervoor is Seerr 3.4 of nieuwer nodig.",
"notInitialized": "De eerste configuratie van deze Seerr-instantie is niet voltooid",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Domyślna jakość",
"cellularQualityTitle": "Domyślna jakość w sieci komórkowej",
"cellularQualitySameAsDefault": "Taka sama jak domyślna jakość",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Jakość muzyki",
"subtitleStyling": "Styl napisów",
"subtitleStylingDescription": "Dostosuj wygląd napisów",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Przesuwaj palcem w górę lub w dół na prawej krawędzi, aby regulować głośność",
"gesturePinchToZoom": "Powiększanie ściskaniem",
"gesturePinchToZoomDescription": "Ściśnij wideo palcami, aby powiększyć lub pomniejszyć",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Sterowanie",
"rememberPlayerChanges": "Zapamiętuj zmiany odtwarzacza",
"rememberPlayerChangesDescription": "Miejsce zapisywania i ponownego stosowania zmian dokonanych podczas odtwarzania",
@@ -859,6 +863,9 @@
"presetDeleted": "Usunięto ustawienie wstępne",
"confirmDeletePreset": "Czy na pewno chcesz usunąć to ustawienie wstępne?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context i gpu-api są ignorowane w systemie Linux: wbudowane wideo jest zawsze renderowane przez vo=libmpv na płaszczyźnie wideo, a gpu-next (wymagany przez shadery obliczeniowe takie jak ArtCNN) nie może działać w trybie wbudowanym."
},
"dialog": {
@@ -1605,6 +1612,13 @@
"host": "Gospodarz",
"hostBadge": "GOSPODARZ",
"youAreHost": "Jesteś gospodarzem",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Oglądasz z innymi",
"endSession": "Zakończ sesję",
"leaveSession": "Opuść sesję",
@@ -1637,6 +1651,7 @@
"participantPaused": "${name} wstrzymał",
"participantResumed": "${name} wznowił",
"participantSeeked": "${name} zmienił pozycję odtwarzania",
"participantChangedSpeed": "",
"participantBuffering": "${name} buforuje",
"participantNeedsUpdate": "${name} używa starszej wersji aplikacji — synchronizacja jest niedostępna",
"resumingWithout": "Wznawianie bez ${name}",
@@ -2083,6 +2098,10 @@
"qualityProfile": "Profil jakości",
"rootFolder": "Folder główny",
"languageProfile": "Profil językowy",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Zamówienie wysłane",
"requestFailed": "Zamówienie nie powiodło się: ${error}",
"requestsLoadFailed": "Nie udało się wczytać opcji zamówienia",
@@ -2094,6 +2113,7 @@
"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})",
"behindAuthProxy": "",
"invalidUrl": "Wprowadź adres serwera, np. https://seerr.example.com",
"quickConnectUnsupported": "Ta instancja Seerr nie obsługuje Quick Connect. Wymagany jest Seerr 3.4 lub nowszy.",
"notInitialized": "Ta instancja Seerr nie ukończyła konfiguracji początkowej",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Qualidade padrão",
"cellularQualityTitle": "Qualidade padrão nos dados móveis",
"cellularQualitySameAsDefault": "Igual à qualidade padrão",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Qualidade da música",
"subtitleStyling": "Estilo de Legendas",
"subtitleStylingDescription": "Personalizar aparência das legendas",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Deslize para cima ou para baixo na borda direita para ajustar o volume",
"gesturePinchToZoom": "Pinça para zoom",
"gesturePinchToZoomDescription": "Pince o vídeo para ampliar ou reduzir",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Controles",
"rememberPlayerChanges": "Lembrar alterações do reprodutor",
"rememberPlayerChangesDescription": "Onde uma alteração feita durante a reprodução é salva e reaplicada",
@@ -851,6 +855,9 @@
"presetDeleted": "Predefinição excluída",
"confirmDeletePreset": "Tem certeza de que deseja excluir esta predefinição?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context e gpu-api são ignorados no Linux: o vídeo incorporado é sempre renderizado via vo=libmpv no plano de vídeo, e gpu-next (necessário para shaders de computação como ArtCNN) não pode ser executado incorporado."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Anfitrião",
"hostBadge": "ANFITRIÃO",
"youAreHost": "Você é o anfitrião",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Assistindo com outras pessoas",
"endSession": "Encerrar sessão",
"leaveSession": "Sair da sessão",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} pausou",
"participantResumed": "${name} retomou",
"participantSeeked": "${name} mudou a posição da reprodução",
"participantChangedSpeed": "",
"participantBuffering": "${name} está aguardando o carregamento",
"participantNeedsUpdate": "${name} está usando uma versão mais antiga do app — sincronização indisponível",
"resumingWithout": "Retomando sem ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Perfil de qualidade",
"rootFolder": "Pasta raiz",
"languageProfile": "Perfil de idioma",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Solicitação enviada",
"requestFailed": "Falha na solicitação: ${error}",
"requestsLoadFailed": "Não foi possível carregar as opções de solicitação",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Na lista de bloqueio",
"couldNotReach": "Não foi possível acessar ${url}: ${error}",
"noInstanceAtUrl": "Nenhuma instância do Seerr em ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Insira um endereço de servidor como https://seerr.example.com",
"quickConnectUnsupported": "Esta instância do Seerr não oferece suporte a Quick Connect. Ela precisa do Seerr 3.4 ou mais recente.",
"notInitialized": "Esta instância do Seerr não concluiu a configuração inicial",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Качество по умолчанию",
"cellularQualityTitle": "Качество по умолчанию в мобильной сети",
"cellularQualitySameAsDefault": "Как качество по умолчанию",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Качество музыки",
"subtitleStyling": "Стиль субтитров",
"subtitleStylingDescription": "Настроить внешний вид субтитров",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Проведите вверх или вниз по правому краю, чтобы изменить громкость",
"gesturePinchToZoom": "Щипок для масштабирования",
"gesturePinchToZoomDescription": "Сведите или разведите пальцы на видео, чтобы изменить масштаб",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Элементы управления",
"rememberPlayerChanges": "Запоминать изменения плеера",
"rememberPlayerChangesDescription": "Где сохраняется и откуда повторно применяется изменение, сделанное во время воспроизведения",
@@ -859,6 +863,9 @@
"presetDeleted": "Пресет удалён",
"confirmDeletePreset": "Вы уверены, что хотите удалить этот пресет?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context и gpu-api игнорируются в Linux: встроенное видео всегда отображается через vo=libmpv на видеоплоскости, а gpu-next (нужный для compute-шейдеров вроде ArtCNN) не может работать во встроенном режиме."
},
"dialog": {
@@ -1605,6 +1612,13 @@
"host": "Организатор",
"hostBadge": "ОРГАНИЗАТОР",
"youAreHost": "Вы — организатор",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Совместный просмотр",
"endSession": "Завершить сессию",
"leaveSession": "Покинуть сессию",
@@ -1637,6 +1651,7 @@
"participantPaused": "${name} поставил на паузу",
"participantResumed": "${name} возобновил",
"participantSeeked": "${name} перемотал",
"participantChangedSpeed": "",
"participantBuffering": "У ${name} идёт буферизация",
"participantNeedsUpdate": "${name} использует старую версию приложения — синхронизация недоступна",
"resumingWithout": "Возобновление без ${name}",
@@ -2083,6 +2098,10 @@
"qualityProfile": "Профиль качества",
"rootFolder": "Корневая папка",
"languageProfile": "Языковой профиль",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Запрос отправлен",
"requestFailed": "Ошибка запроса: ${error}",
"requestsLoadFailed": "Не удалось загрузить параметры запроса",
@@ -2094,6 +2113,7 @@
"statusBlocklisted": "В списке блокировки",
"couldNotReach": "Не удалось связаться с ${url}: ${error}",
"noInstanceAtUrl": "По адресу ${url} нет экземпляра Seerr (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Введите адрес сервера, например https://seerr.example.com",
"quickConnectUnsupported": "Этот экземпляр Seerr не поддерживает Quick Connect. Нужна версия Seerr 3.4 или новее.",
"notInitialized": "Первоначальная настройка этого экземпляра Seerr не завершена",
+1 -1
View File
@@ -4,7 +4,7 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 22
/// Strings: 43736 (1988 per locale)
/// Strings: 43756 (1988 per locale)
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import
+86 -6
View File
@@ -633,6 +633,12 @@ class Translations$settings$en {
/// en: 'Same as Default Quality'
String get cellularQualitySameAsDefault => 'Same as Default Quality';
/// en: 'Play Smaller Videos at Original Quality'
String get directPlayCoveredQuality => 'Play Smaller Videos at Original Quality';
/// en: 'Direct play videos already within the quality limit instead of transcoding them'
String get directPlayCoveredQualityDescription => 'Direct play videos already within the quality limit instead of transcoding them';
/// en: 'Music Quality'
String get musicQualityTitle => 'Music Quality';
@@ -1203,6 +1209,12 @@ class Translations$settings$en {
/// en: 'Pinch on the video to zoom in or out'
String get gesturePinchToZoomDescription => 'Pinch on the video to zoom in or out';
/// en: 'Remember Brightness Level'
String get rememberBrightnessLevel => 'Remember Brightness Level';
/// en: 'Start playback at the brightness set by the last swipe'
String get rememberBrightnessLevelDescription => 'Start playback at the brightness set by the last swipe';
/// en: 'Controls'
String get controls => 'Controls';
@@ -2494,6 +2506,15 @@ class Translations$mpvConfig$en {
/// en: 'gpu-api=vulkan hwdec=auto # comment'
String get configPlaceholder => 'gpu-api=vulkan\nhwdec=auto\n# comment';
/// en: 'option=value'
String get lineHint => 'option=value';
/// en: 'Add line'
String get addLine => 'Add line';
/// en: 'Remove line'
String get removeLine => 'Remove line';
/// en: 'vo, gpu-context and gpu-api are ignored on Linux: embedded video always renders through vo=libmpv on the video plane, and gpu-next (which compute shaders like ArtCNN need) cannot run embedded.'
String get embeddedVoHint => 'vo, gpu-context and gpu-api are ignored on Linux: embedded video always renders through vo=libmpv on the video plane, and gpu-next (which compute shaders like ArtCNN need) cannot run embedded.';
}
@@ -4016,6 +4037,27 @@ class Translations$watchTogether$en {
/// en: 'You are the host'
String get youAreHost => 'You are the host';
/// en: 'Make host'
String get makeHost => 'Make host';
/// en: 'Transfer host?'
String get makeHostQuestion => 'Transfer host?';
/// en: '${name} will control playback and drive the session for everyone.'
String makeHostConfirm({required Object name}) => '${name} will control playback and drive the session for everyone.';
/// en: 'Transfer'
String get transfer => 'Transfer';
/// en: '${name} is now the host'
String hostChangedTo({required Object name}) => '${name} is now the host';
/// en: 'You are now the host'
String get youAreNowHost => 'You are now the host';
/// en: 'Couldn't make ${name} the host'
String hostTransferFailed({required Object name}) => 'Couldn\'t make ${name} the host';
/// en: 'Watching with others'
String get watchingWithOthers => 'Watching with others';
@@ -4112,6 +4154,9 @@ class Translations$watchTogether$en {
/// en: '${name} changed the playback position'
String participantSeeked({required Object name}) => '${name} changed the playback position';
/// en: '${name} set the speed to ${speed}'
String participantChangedSpeed({required Object name, required Object speed}) => '${name} set the speed to ${speed}';
/// en: '${name} is buffering'
String participantBuffering({required Object name}) => '${name} is buffering';
@@ -5180,6 +5225,18 @@ class Translations$seerr$en {
/// en: 'Language profile'
String get languageProfile => 'Language profile';
/// en: 'Tags'
String get tags => 'Tags';
/// en: 'No tags'
String get noTags => 'No tags';
/// en: '${name} (Default)'
String defaultOption({required Object name}) => '${name} (Default)';
/// en: 'This series is an anime.'
String get animeNote => 'This series is an anime.';
/// en: 'Request submitted'
String get requestSubmitted => 'Request submitted';
@@ -5213,6 +5270,9 @@ class Translations$seerr$en {
/// en: 'No Seerr instance at ${url} (HTTP ${status})'
String noInstanceAtUrl({required Object url, required Object status}) => 'No Seerr instance at ${url} (HTTP ${status})';
/// en: 'An authenticating reverse proxy (SSO or HTTP auth) answered instead of Seerr. Plezy cannot sign in through it: let Seerr's /api/v1 path bypass the proxy for this app, or use an address that reaches Seerr directly.'
String get behindAuthProxy => 'An authenticating reverse proxy (SSO or HTTP auth) answered instead of Seerr. Plezy cannot sign in through it: let Seerr\'s /api/v1 path bypass the proxy for this app, or use an address that reaches Seerr directly.';
/// en: 'Enter a server address like https://seerr.example.com'
String get invalidUrl => 'Enter a server address like https://seerr.example.com';
@@ -7098,6 +7158,8 @@ extension on Translations {
'settings.defaultQualityTitle' => 'Default Quality',
'settings.cellularQualityTitle' => 'Default Quality on Cellular',
'settings.cellularQualitySameAsDefault' => 'Same as Default Quality',
'settings.directPlayCoveredQuality' => 'Play Smaller Videos at Original Quality',
'settings.directPlayCoveredQualityDescription' => 'Direct play videos already within the quality limit instead of transcoding them',
'settings.musicQualityTitle' => 'Music Quality',
'settings.subtitleStyling' => 'Subtitle Styling',
'settings.subtitleStylingDescription' => 'Customize subtitle appearance',
@@ -7288,6 +7350,8 @@ extension on Translations {
'settings.gestureVolumeSwipeDescription' => 'Swipe up or down on the right edge to adjust volume',
'settings.gesturePinchToZoom' => 'Pinch to Zoom',
'settings.gesturePinchToZoomDescription' => 'Pinch on the video to zoom in or out',
'settings.rememberBrightnessLevel' => 'Remember Brightness Level',
'settings.rememberBrightnessLevelDescription' => 'Start playback at the brightness set by the last swipe',
'settings.controls' => 'Controls',
'settings.rememberPlayerChanges' => 'Remember Player Changes',
'settings.rememberPlayerChangesDescription' => 'Where a change made during playback is saved and reapplied from',
@@ -7422,12 +7486,12 @@ extension on Translations {
'fileInfo.filePresent' => 'File Present',
'fileInfo.fileReadable' => 'Readable by Server',
'fileInfo.streamPath' => 'Stream Path',
_ => null,
} ?? switch (path) {
'fileInfo.optimizedForStreaming' => 'Optimized for Streaming',
'fileInfo.has64bitOffsets' => '64-bit Offsets',
'fileInfo.protocol' => 'Protocol',
'fileInfo.mediaType' => 'Media Type',
_ => null,
} ?? switch (path) {
'fileInfo.sourceKind' => 'Source Kind',
'fileInfo.optimizedVersion' => 'Optimized Version',
'fileInfo.optimizationTarget' => 'Optimization Target',
@@ -7712,6 +7776,9 @@ extension on Translations {
'mpvConfig.presetDeleted' => 'Preset deleted',
'mpvConfig.confirmDeletePreset' => 'Are you sure you want to delete this preset?',
'mpvConfig.configPlaceholder' => 'gpu-api=vulkan\nhwdec=auto\n# comment',
'mpvConfig.lineHint' => 'option=value',
'mpvConfig.addLine' => 'Add line',
'mpvConfig.removeLine' => 'Remove line',
'mpvConfig.embeddedVoHint' => 'vo, gpu-context and gpu-api are ignored on Linux: embedded video always renders through vo=libmpv on the video plane, and gpu-next (which compute shaders like ArtCNN need) cannot run embedded.',
'dialog.confirmAction' => 'Confirm Action',
'profiles.addPlezyProfile' => 'Add Plezy profile',
@@ -7933,6 +8000,8 @@ extension on Translations {
'libraries.groupings.episodes' => 'Episodes',
'libraries.groupings.artists' => 'Artists',
'libraries.groupings.albums' => 'Albums',
_ => null,
} ?? switch (path) {
'libraries.groupings.tracks' => 'Tracks',
'libraries.groupings.folders' => 'Folders',
'libraries.filterCategories.genre' => 'Genre',
@@ -7940,8 +8009,6 @@ extension on Translations {
'libraries.filterCategories.contentRating' => 'Content Rating',
'libraries.filterCategories.tag' => 'Tag',
'libraries.filterCategories.unwatched' => 'Unwatched',
_ => null,
} ?? switch (path) {
'libraries.filterCategories.unplayed' => 'Unplayed',
'libraries.filterCategories.favorites' => 'Favorites',
'libraries.sortLabels.title' => 'Title',
@@ -8346,6 +8413,13 @@ extension on Translations {
'watchTogether.host' => 'Host',
'watchTogether.hostBadge' => 'HOST',
'watchTogether.youAreHost' => 'You are the host',
'watchTogether.makeHost' => 'Make host',
'watchTogether.makeHostQuestion' => 'Transfer host?',
'watchTogether.makeHostConfirm' => ({required Object name}) => '${name} will control playback and drive the session for everyone.',
'watchTogether.transfer' => 'Transfer',
'watchTogether.hostChangedTo' => ({required Object name}) => '${name} is now the host',
'watchTogether.youAreNowHost' => 'You are now the host',
'watchTogether.hostTransferFailed' => ({required Object name}) => 'Couldn\'t make ${name} the host',
'watchTogether.watchingWithOthers' => 'Watching with others',
'watchTogether.endSession' => 'End Session',
'watchTogether.leaveSession' => 'Leave Session',
@@ -8378,6 +8452,7 @@ extension on Translations {
'watchTogether.participantPaused' => ({required Object name}) => '${name} paused',
'watchTogether.participantResumed' => ({required Object name}) => '${name} resumed',
'watchTogether.participantSeeked' => ({required Object name}) => '${name} changed the playback position',
'watchTogether.participantChangedSpeed' => ({required Object name, required Object speed}) => '${name} set the speed to ${speed}',
'watchTogether.participantBuffering' => ({required Object name}) => '${name} is buffering',
'watchTogether.participantNeedsUpdate' => ({required Object name}) => '${name} is on an older app version — sync unavailable',
'watchTogether.resumingWithout' => ({required Object name}) => 'Resuming without ${name}',
@@ -8439,6 +8514,8 @@ extension on Translations {
'downloads.invalidEpisodeCount' => 'Enter a valid episode count.',
'downloads.keepSynced' => 'Keep synced',
'downloads.downloadOnce' => 'Download once',
_ => null,
} ?? switch (path) {
'downloads.keepNUnwatched' => ({required Object count}) => 'Keep ${count} unwatched',
'downloads.editSyncRule' => 'Edit sync rule',
'downloads.removeSyncRule' => 'Remove sync rule',
@@ -8454,8 +8531,6 @@ extension on Translations {
'downloads.syncRuleCleanupUnavailable' => 'Associated downloads could not be identified safely. Reconnect the server and try again, or remove the rule without deleting downloads.',
'downloads.syncedNewEpisodes' => ({required Object count, required Object title}) => 'Synced ${count} new episodes for ${title}',
'downloads.activeSyncRules' => 'Sync rules',
_ => null,
} ?? switch (path) {
'downloads.noSyncRules' => 'No sync rules',
'downloads.manageSyncRule' => 'Manage sync',
'downloads.editEpisodeCount' => 'Episode count',
@@ -8792,6 +8867,10 @@ extension on Translations {
'seerr.qualityProfile' => 'Quality profile',
'seerr.rootFolder' => 'Root folder',
'seerr.languageProfile' => 'Language profile',
'seerr.tags' => 'Tags',
'seerr.noTags' => 'No tags',
'seerr.defaultOption' => ({required Object name}) => '${name} (Default)',
'seerr.animeNote' => 'This series is an anime.',
'seerr.requestSubmitted' => 'Request submitted',
'seerr.requestFailed' => ({required Object error}) => 'Request failed: ${error}',
'seerr.requestsLoadFailed' => 'Couldn\'t load request options',
@@ -8803,6 +8882,7 @@ extension on Translations {
'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.behindAuthProxy' => 'An authenticating reverse proxy (SSO or HTTP auth) answered instead of Seerr. Plezy cannot sign in through it: let Seerr\'s /api/v1 path bypass the proxy for this app, or use an address that reaches Seerr directly.',
'seerr.invalidUrl' => 'Enter a server address like https://seerr.example.com',
'seerr.quickConnectUnsupported' => 'This Seerr instance does not support Quick Connect. It needs Seerr 3.4 or newer.',
'seerr.notInitialized' => 'This Seerr instance has not completed first-run setup',
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Standardkvalitet",
"cellularQualityTitle": "Standardkvalitet på mobildata",
"cellularQualitySameAsDefault": "Samma som standardkvalitet",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Musikkvalitet",
"subtitleStyling": "Utseende för undertexter",
"subtitleStylingDescription": "Anpassa undertexternas utseende",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Svep uppåt eller nedåt i högerkanten för att justera volymen",
"gesturePinchToZoom": "Nyp för att zooma",
"gesturePinchToZoomDescription": "Nyp på videon för att zooma in eller ut",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Kontroller",
"rememberPlayerChanges": "Kom ihåg spelarändringar",
"rememberPlayerChangesDescription": "Var en ändring under uppspelning sparas och tillämpas igen",
@@ -851,6 +855,9 @@
"presetDeleted": "Förval borttaget",
"confirmDeletePreset": "Är du säker på att du vill ta bort detta förval?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context och gpu-api ignoreras på Linux: inbäddad video renderas alltid via vo=libmpv på videoplanet, och gpu-next (som compute-shaders som ArtCNN behöver) kan inte köras inbäddat."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Värd",
"hostBadge": "VÄRD",
"youAreHost": "Du är värden",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Tittar med andra",
"endSession": "Avsluta session",
"leaveSession": "Lämna session",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} pausade",
"participantResumed": "${name} återupptog",
"participantSeeked": "${name} ändrade uppspelningspositionen",
"participantChangedSpeed": "",
"participantBuffering": "${name} buffrar",
"participantNeedsUpdate": "${name} använder en äldre appversion — synkronisering är inte tillgänglig",
"resumingWithout": "Återupptar utan ${name}",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Kvalitetsprofil",
"rootFolder": "Rotmapp",
"languageProfile": "Språkprofil",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Begäran skickad",
"requestFailed": "Begäran kunde inte genomföras: ${error}",
"requestsLoadFailed": "Det gick inte att läsa in alternativ för begäran",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "På blockeringslistan",
"couldNotReach": "Kunde inte nå ${url}: ${error}",
"noInstanceAtUrl": "Det finns ingen Seerr-instans på ${url} (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Ange en serveradress, t.ex. https://seerr.example.com",
"quickConnectUnsupported": "Den här Seerr-instansen stöder inte Quick Connect. Den kräver Seerr 3.4 eller nyare.",
"notInitialized": "Den här Seerr-instansen har inte slutfört den inledande konfigurationen",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Varsayılan Kalite",
"cellularQualityTitle": "Hücresel Veride Varsayılan Kalite",
"cellularQualitySameAsDefault": "Varsayılan Kaliteyle Aynı",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Müzik Kalitesi",
"subtitleStyling": "Altyazı Biçimlendirmesi",
"subtitleStylingDescription": "Altyazı görünümünü özelleştirin",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Sesi ayarlamak için sağ kenarda yukarı veya aşağı kaydırın",
"gesturePinchToZoom": "Kıstırarak Yakınlaştır",
"gesturePinchToZoomDescription": "Yakınlaştırmak veya uzaklaştırmak için videoyu kıstırın",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Kontroller",
"rememberPlayerChanges": "Oynatıcı değişikliklerini hatırla",
"rememberPlayerChangesDescription": "Oynatma sırasında yapılan değişikliklerin kaydedilip yeniden uygulanacağı yer",
@@ -851,6 +855,9 @@
"presetDeleted": "Önayar silindi",
"confirmDeletePreset": "Bu önayarı silmek istediğinizden emin misiniz?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# yorum",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "vo, gpu-context ve gpu-api Linux'ta yok sayılır: gömülü video her zaman video düzleminde vo=libmpv üzerinden işlenir ve gpu-next (ArtCNN gibi compute shader'ların ihtiyaç duyduğu) gömülü olarak çalışamaz."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Kurucu",
"hostBadge": "KURUCU",
"youAreHost": "Kurucu sizsiniz",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Başkalarıyla birlikte izleniyor",
"endSession": "Oturumu Bitir",
"leaveSession": "Oturumdan Ayrıl",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} duraklattı",
"participantResumed": "${name} devam ettirdi",
"participantSeeked": "${name} oynatma konumunu değiştirdi",
"participantChangedSpeed": "",
"participantBuffering": "${name} arabelleğe alıyor",
"participantNeedsUpdate": "${name} eski bir uygulama sürümünde — eşitleme kullanılamıyor",
"resumingWithout": "${name} olmadan devam ediliyor",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Kalite profili",
"rootFolder": "Kök klasör",
"languageProfile": "Dil profili",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "İstek gönderildi",
"requestFailed": "İstek başarısız oldu: ${error}",
"requestsLoadFailed": "İstek seçenekleri yüklenemedi",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Engelleme listesinde",
"couldNotReach": "${url} adresine ulaşılamadı: ${error}",
"noInstanceAtUrl": "${url} adresinde Seerr örneği bulunamadı (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "https://seerr.example.com gibi bir sunucu adresi girin",
"quickConnectUnsupported": "Bu Seerr örneği Quick Connect'i desteklemiyor. Seerr 3.4 veya daha yenisini gerektiriyor.",
"notInitialized": "Bu Seerr örneği ilk çalıştırma kurulumunu tamamlamadı",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "Standart sifat",
"cellularQualityTitle": "Mobil tarmoqda standart sifat",
"cellularQualitySameAsDefault": "Standart sifat bilan bir xil",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "Musiqa sifati",
"subtitleStyling": "Subtitr sozlamalari",
"subtitleStylingDescription": "Subtitrlar koʻrinishini moslashtiring",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "Ovozni sozlash uchun oʻng chekkada yuqoriga yoki pastga suring",
"gesturePinchToZoom": "Chimchilab masshtablash",
"gesturePinchToZoomDescription": "Videoni yaqinlashtirish yoki uzoqlashtirish uchun chimchilang",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "Boshqaruv elementlari",
"rememberPlayerChanges": "Pleyer oʻzgarishlarini eslab qolish",
"rememberPlayerChangesDescription": "Ijro vaqtida qilingan oʻzgarish qayerda saqlanishi va qayta qoʻllanishi",
@@ -851,6 +855,9 @@
"presetDeleted": "Sozlama oʻchirildi",
"confirmDeletePreset": "Ushbu sozlamani oʻchirishga ishonchingiz komilmi?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# izoh",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "Linux-da vo, gpu-context va gpu-api e'tiborga olinmaydi: ichki video har doim video tekisligida vo=libmpv orqali ko'rsatiladi va gpu-next (ArtCNN kabi compute shaderlar uchun zarur) ichki rejimda ishlay olmaydi."
},
"dialog": {
@@ -1585,6 +1592,13 @@
"host": "Tashkilotchi",
"hostBadge": "TASHKILOTCHI",
"youAreHost": "Siz tashkilotchisiz",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "Boshqalar bilan tomosha qilinmoqda",
"endSession": "Seansni yakunlash",
"leaveSession": "Seansdan chiqish",
@@ -1617,6 +1631,7 @@
"participantPaused": "${name} toʻxtatdi",
"participantResumed": "${name} davom ettirdi",
"participantSeeked": "${name} vaqtni oʻzgartirdi",
"participantChangedSpeed": "",
"participantBuffering": "${name} buferlamoqda",
"participantNeedsUpdate": "${name} eski versiyada",
"resumingWithout": "${name} hisobga olinmasdan davom ettirilmoqda",
@@ -2063,6 +2078,10 @@
"qualityProfile": "Sifat profili",
"rootFolder": "Asosiy jild",
"languageProfile": "Til profili",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "Soʻrov yuborildi",
"requestFailed": "Soʻrov xatoligi: ${error}",
"requestsLoadFailed": "Parametrlarni yuklab boʻlmadi",
@@ -2074,6 +2093,7 @@
"statusBlocklisted": "Bloklangan roʻyxatda",
"couldNotReach": "${url} manziliga ulanib boʻlmadi: ${error}",
"noInstanceAtUrl": "${url} manzilida Seerr nusxasi yoʻq (HTTP ${status})",
"behindAuthProxy": "",
"invalidUrl": "Server manzilini kiriting, masalan: https://seerr.example.com",
"quickConnectUnsupported": "Bu Seerr nusxasi Tezkor ulanishni qoʻllab-quvvatlamaydi. Buning uchun Seerr 3.4 yoki undan yangi versiya kerak.",
"notInitialized": "Bu Seerr nusxasining dastlabki sozlamasi yakunlanmagan",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "預設畫質",
"cellularQualityTitle": "行動網路上的預設畫質",
"cellularQualitySameAsDefault": "與預設畫質相同",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "音樂品質",
"subtitleStyling": "字幕樣式",
"subtitleStylingDescription": "調整字幕外觀",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "在螢幕右側邊緣上下滑動以調整音量",
"gesturePinchToZoom": "雙指縮放",
"gesturePinchToZoomDescription": "在影片上雙指捏合以放大或縮小",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "控制",
"rememberPlayerChanges": "記住播放器變更",
"rememberPlayerChangesDescription": "播放期間所做的變更要儲存並從何處重新套用",
@@ -847,6 +851,9 @@
"presetDeleted": "預設組已刪除",
"confirmDeletePreset": "確定要刪除此預設組嗎?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# 註解",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "在 Linux 上會忽略 vo、gpu-context 和 gpu-api:嵌入式影片一律透過影片平面上的 vo=libmpv 轉譯,而 gpu-nextArtCNN 等計算著色器需要它)無法以嵌入式方式執行。"
},
"dialog": {
@@ -1575,6 +1582,13 @@
"host": "主持人",
"hostBadge": "主持人",
"youAreHost": "您是主持人",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "與他人一起觀看",
"endSession": "結束工作階段",
"leaveSession": "離開工作階段",
@@ -1607,6 +1621,7 @@
"participantPaused": "${name} 暫停了播放",
"participantResumed": "${name} 恢復了播放",
"participantSeeked": "${name} 變更了播放位置",
"participantChangedSpeed": "",
"participantBuffering": "${name} 正在緩衝",
"participantNeedsUpdate": "${name} 正在使用舊版應用程式,無法進行同步",
"resumingWithout": "不等待 ${name},繼續播放",
@@ -2053,6 +2068,10 @@
"qualityProfile": "畫質設定檔(Quality Profile",
"rootFolder": "根目錄資料夾",
"languageProfile": "語言設定檔(Language Profile",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "請求已送出",
"requestFailed": "請求失敗:${error}",
"requestsLoadFailed": "無法載入請求選項",
@@ -2064,6 +2083,7 @@
"statusBlocklisted": "已加入封鎖清單",
"couldNotReach": "無法連線至 ${url}${error}",
"noInstanceAtUrl": "在 ${url} 找不到 Seerr 執行個體(HTTP ${status}",
"behindAuthProxy": "",
"invalidUrl": "請輸入伺服器位址,例如 https://seerr.example.com",
"quickConnectUnsupported": "此 Seerr 執行個體不支援 Quick Connect。需要 Seerr 3.4 或更新版本。",
"notInitialized": "此 Seerr 執行個體尚未完成首次執行設定",
+20
View File
@@ -198,6 +198,8 @@
"defaultQualityTitle": "默认画质",
"cellularQualityTitle": "移动网络默认画质",
"cellularQualitySameAsDefault": "与默认画质相同",
"directPlayCoveredQuality": "",
"directPlayCoveredQualityDescription": "",
"musicQualityTitle": "音乐音质",
"subtitleStyling": "字幕样式",
"subtitleStylingDescription": "调整字幕外观",
@@ -388,6 +390,8 @@
"gestureVolumeSwipeDescription": "在屏幕右边缘上下滑动以调节音量",
"gesturePinchToZoom": "双指缩放",
"gesturePinchToZoomDescription": "在视频上双指捏合以放大或缩小",
"rememberBrightnessLevel": "",
"rememberBrightnessLevelDescription": "",
"controls": "控制",
"rememberPlayerChanges": "记住播放器更改",
"rememberPlayerChangesDescription": "播放期间所做的更改保存并重新应用的位置",
@@ -847,6 +851,9 @@
"presetDeleted": "预设已删除",
"confirmDeletePreset": "确定要删除此预设吗?",
"configPlaceholder": "gpu-api=vulkan\nhwdec=auto\n# comment",
"lineHint": "",
"addLine": "",
"removeLine": "",
"embeddedVoHint": "Linux 上会忽略 vo、gpu-context 和 gpu-api:嵌入式视频始终通过视频平面上的 vo=libmpv 渲染,而 gpu-nextArtCNN 等计算着色器需要它)无法以嵌入式方式运行。"
},
"dialog": {
@@ -1575,6 +1582,13 @@
"host": "主持人",
"hostBadge": "主持人",
"youAreHost": "你是主持人",
"makeHost": "",
"makeHostQuestion": "",
"makeHostConfirm": "",
"transfer": "",
"hostChangedTo": "",
"youAreNowHost": "",
"hostTransferFailed": "",
"watchingWithOthers": "与他人一起观看",
"endSession": "结束会话",
"leaveSession": "离开会话",
@@ -1607,6 +1621,7 @@
"participantPaused": "${name} 暂停了播放",
"participantResumed": "${name} 恢复了播放",
"participantSeeked": "${name} 更改了播放位置",
"participantChangedSpeed": "",
"participantBuffering": "${name} 正在缓冲",
"participantNeedsUpdate": "${name} 正在使用较旧版本的应用,无法同步",
"resumingWithout": "不再等待 ${name},继续播放",
@@ -2053,6 +2068,10 @@
"qualityProfile": "画质配置",
"rootFolder": "根目录",
"languageProfile": "语言配置",
"tags": "",
"noTags": "",
"defaultOption": "",
"animeNote": "",
"requestSubmitted": "请求已提交",
"requestFailed": "请求失败:${error}",
"requestsLoadFailed": "无法加载请求选项",
@@ -2064,6 +2083,7 @@
"statusBlocklisted": "已加入屏蔽列表",
"couldNotReach": "无法连接到 ${url}${error}",
"noInstanceAtUrl": "${url} 上没有 Seerr 实例(HTTP ${status}",
"behindAuthProxy": "",
"invalidUrl": "输入服务器地址,例如 https://seerr.example.com",
"quickConnectUnsupported": "此 Seerr 实例不支持 Quick Connect。需要 Seerr 3.4 或更高版本。",
"notInitialized": "此 Seerr 实例尚未完成首次运行设置",
+30 -25
View File
@@ -33,6 +33,7 @@ import 'screens/auth_screen.dart';
import 'screens/profile/pin_entry_dialog.dart';
import 'screens/profile/profile_switch_screen.dart';
import 'services/storage_service.dart';
import 'services/assistive_technology_service.dart';
import 'services/device_performance.dart';
import 'services/video_decode_capabilities.dart';
import 'services/macos_window_service.dart';
@@ -50,7 +51,6 @@ import 'services/gamepad_service.dart';
import 'services/trackers/tracker_coordinator.dart';
import 'providers/account_preferences_controller.dart';
import 'services/account_preferences_repository.dart';
import 'providers/user_profile_provider.dart';
import 'providers/multi_server_provider.dart';
import 'providers/theme_provider.dart';
import 'providers/download_provider.dart';
@@ -59,6 +59,7 @@ import 'providers/offline_watch_provider.dart';
import 'providers/shader_provider.dart';
import 'utils/snackbar_helper.dart';
import 'services/multi_server_manager.dart';
import 'services/library_events/library_event_service.dart';
import 'services/offline_watch_sync_service.dart';
import 'services/data_aggregation_service.dart';
import 'services/credential_vault.dart';
@@ -137,6 +138,9 @@ void main() {
// Keep the accessibility tree available to Maestro and other UI automation
// without adding release-build overhead.
if (kDebugMode) binding.ensureSemantics();
// Android: skip the per-frame semantics pass when the only bound
// accessibility service cannot read it (launcher hooks, key remappers).
AssistiveTechnologyService.instance.ensureStarted();
_installZeroOffsetPointerGuard(); // Workaround for iPadOS 26.1+ modal dismissal bug
// On tvOS, Flutter's generated plugin registrant doesn't run (no tvOS
@@ -1229,6 +1233,7 @@ class MainApp extends StatefulWidget {
class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
late final MultiServerManager _serverManager;
late final DataAggregationService _aggregationService;
late final LibraryEventService _libraryEventService;
late final AppDatabase _appDatabase;
late final DownloadManagerService _downloadManager;
late final OfflineWatchSyncService _offlineWatchSyncService;
@@ -1270,6 +1275,7 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
_serverManager = MultiServerManager();
_aggregationService = DataAggregationService(_serverManager);
_libraryEventService = LibraryEventService(_serverManager);
_appDatabase = widget.appDatabase;
PlexApiCache.initialize(_appDatabase);
@@ -1319,6 +1325,7 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
_removeConnectivitySyncListener();
_memoryCheckTimer?.cancel();
_libraryEventService.dispose();
_downloadManager.dispose();
// Quitting straight from the player is a real stop: the trackers that own
// their own watched semantics need the terminal report before the process
@@ -1343,6 +1350,7 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
_memoryCheckTimer?.cancel();
_appLifecycleListener.dispose();
if (!_shutdownStarted) {
_libraryEventService.dispose();
_downloadManager.dispose();
_serverManager.dispose();
}
@@ -1509,6 +1517,9 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
// App came back to foreground - trigger sync check
_offlineWatchSyncService.onAppResumed();
unawaited(TrackerCoordinator.instance.flushWriteQueue());
// Re-arm the per-server library push channels torn down on pause
// (and any that exhausted their reconnect attempts).
_libraryEventService.resume();
// Re-probe servers — mobile OS may have dropped TCP connections during doze/sleep.
// On desktop, resumed fires on every window focus (alt-tab), so apply a cooldown
// to avoid piling up network probes from rapid alt-tabbing.
@@ -1519,14 +1530,21 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
if (now.difference(_lastResumeProbe) >= cooldown) {
_lastResumeProbe = now;
// Await health check before reconnecting so stale "online" servers
// get marked offline and included in the reconnection sweep.
// get marked offline and included in the reconnection sweep. Servers
// that stayed online but were failed over onto a remote endpoint
// while local ones exist get re-raced: a same-interface sleep/wake
// never fires the connectivity event that would otherwise do it.
unawaited(() async {
await _serverManager.checkServerHealth();
await _serverManager.reconnectOfflineServers();
await _serverManager.reoptimizeDemotedServers(reason: 'resume');
}());
}
case AppLifecycleState.paused:
case AppLifecycleState.detached:
// Backgrounded: drop the library push sockets — they are
// foreground-only, and the stale-resume refresh covers the gap.
_libraryEventService.suspend();
// Database is session-scoped and must survive suspend/resume.
// Closing here would kill the Drift isolate channel while services
// (sync, downloads, cache) still hold references to the executor.
@@ -1736,20 +1754,6 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
ProxyProvider<AccountPreferencesController, AccountPreferencesRepository>(
update: (_, controller, _) => controller.repository,
),
ChangeNotifierProxyProvider2<ActiveProfileProvider, ConnectionRegistry, UserProfileProvider>(
create: (context) => UserProfileProvider(storageService: context.read<StorageService>()),
update: (context, activeProfile, connections, previous) {
final provider = previous!;
provider.attach(
connections: connections,
activeProfile: activeProfile,
profileConnections: context.read<ProfileConnectionRegistry>(),
serverManager: context.read<MultiServerProvider>().serverManager,
accountPreferences: context.read<AccountPreferencesController>(),
);
return provider;
},
),
ChangeNotifierProvider(create: (context) => ThemeProvider()),
// Shader presets are app-global — deliberately outside the
// profile-scoped session in ProfileSessionScreen.
@@ -1863,9 +1867,15 @@ class FormFactorScale extends StatelessWidget {
}
if (!PlatformDetector.isAutomotive()) return child;
// Car system bars can sit on the left or right, are opaque, and may be
// impossible to hide (OEM policy). Nothing is worth drawing under them,
// and the mobile screens only honour top/bottom insets, so consume the
// horizontal ones here, once, for every route (car app quality AR-1).
// Inside the scaled MediaQuery so the SafeArea reads the scaled padding.
final insetChild = SafeArea(top: false, bottom: false, child: child);
return SettingValueBuilder<double>(
pref: SettingsService.automotiveUiScale,
builder: (context, scale, _) => _scaledSurface(child: child, scale: scale, zeroInsets: false),
builder: (context, scale, _) => _scaledSurface(child: insetChild, scale: scale, zeroInsets: false),
);
}
@@ -1946,15 +1956,9 @@ class _SetupScreenState extends State<SetupScreen> with MountedSetStateMixin {
void initState() {
super.initState();
_loadSavedCredentials();
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
// The app's first screen: undo any orientation lock a previous run's
// full-screen player left behind, and re-apply it whenever the form
// factor signals (Theme.platform / MediaQuery size) change.
OrientationHelper.restoreDefaultOrientations(context);
// full-screen player left behind.
unawaited(OrientationHelper.restoreDefaultOrientations());
}
void _setStatus(String message) {
@@ -2017,6 +2021,7 @@ class _SetupScreenState extends State<SetupScreen> with MountedSetStateMixin {
connectionRegistry: connRegistry,
serverRegistry: registry,
profileRegistry: profileRegistry,
plexHome: context.read<PlexHomeService>(),
);
await bootstrap.run();
final pruned = await ProfileConnectionCleanup(
-6
View File
@@ -259,15 +259,9 @@ class AccountPreferences implements MediaServerUserProfile {
@override
String? get defaultAudioLanguage => preferredAudioLanguage;
@override
List<String>? get defaultAudioLanguages => null;
@override
String? get defaultSubtitleLanguage => preferredSubtitleLanguage;
@override
List<String>? get defaultSubtitleLanguages => null;
@override
SubtitlePlaybackMode? get subtitleMode => subtitlePlaybackMode;
}
+72
View File
@@ -0,0 +1,72 @@
import 'ids.dart';
/// One coalesced "this server's library content changed" signal from a
/// server push channel (#1646).
///
/// Deliberately coarse for additions and updates: raw notifications arrive
/// mid-scan when backends disagree about what an id even means (Plex emits
/// per-state timeline floods, MediaBrowser batches server-side), and every
/// consumer responds by refetching its own views anyway. The one exact
/// carve-out is [removedItemIds]: a removal names an item the app may be
/// displaying right now, so those ids ride along for in-place drops through
/// `DeletionNotifier` — the same split Plex Web uses (deletions patch stores
/// directly; additions go through container refetch).
class LibraryChangeEvent {
/// Server whose library changed.
final ServerId serverId;
/// Backend-native ids of the affected libraries (Plex section ids,
/// MediaBrowser collection-folder ids). Empty when the backend did not say.
final Set<String> libraryIds;
/// Backend-native ids of removed items, when the backend named them (Plex
/// settled `type: -1` timeline entries, MediaBrowser `ItemsRemoved`).
final Set<String> removedItemIds;
/// Advisory flags describing what the change contained. A backend that
/// cannot distinguish (Plex settles adds and metadata updates identically)
/// sets the closest superset.
final bool itemsAdded;
final bool itemsRemoved;
final bool itemsUpdated;
const LibraryChangeEvent({
required this.serverId,
this.libraryIds = const {},
this.removedItemIds = const {},
this.itemsAdded = false,
this.itemsRemoved = false,
this.itemsUpdated = false,
});
bool get hasChanges => itemsAdded || itemsRemoved || itemsUpdated;
@override
String toString() =>
'LibraryChangeEvent($serverId, libraries: $libraryIds, '
'added: $itemsAdded, removed: $itemsRemoved (${removedItemIds.length} ids), updated: $itemsUpdated)';
}
/// A live push subscription to one server's library-change notifications.
///
/// Implementations own the websocket, keepalive, parsing, per-backend
/// debouncing, and reconnect backoff; [LibraryEventService] owns *which*
/// channels run (server online/offline, app foreground/background). Connect
/// failures degrade silently — the stale-refresh paths remain the fallback —
/// so a reverse proxy without websocket upgrade support must never surface
/// an error to the user.
abstract class LibraryEventChannel {
/// Coalesced change events. Broadcast; never errors.
Stream<LibraryChangeEvent> get events;
/// Begin connecting (idempotent while running). Failures retry with
/// bounded backoff, then go quiet until the next [start].
void start();
/// Drop the connection and all retry state. Safe to call repeatedly;
/// [start] may be called again afterwards.
void stop();
/// [stop] plus closing [events]. The channel is unusable afterwards.
void dispose();
}
+7
View File
@@ -98,12 +98,18 @@ int fallbackPageTotal({required int offset, required int itemCount, int? request
/// back shorter than [pageSize]. The short-page break is for backends whose
/// total is unreliable; leave it off when the total is authoritative.
///
/// [onPage] receives the accumulated items after each intermediate page —
/// i.e. only when another request will follow — so callers can render while
/// pagination continues. It never fires for single-page listings or the final
/// page; the returned list covers those.
///
/// [abort] is checked before and after every request. Errors propagate.
Future<List<T>> drainPages<T>(
Future<LibraryPage<T>> Function(int start, int size) fetchPage, {
required int pageSize,
AbortController? abort,
bool stopOnShortPage = false,
void Function(List<T> accumulated)? onPage,
}) async {
final all = <T>[];
var start = 0;
@@ -116,6 +122,7 @@ Future<List<T>> drainPages<T>(
start += page.items.length;
if (start >= page.totalCount) break;
if (stopOnShortPage && page.items.length < pageSize) break;
onPage?.call(all);
}
return all;
}
+17 -5
View File
@@ -5,6 +5,7 @@ import '../models/livetv_dvr.dart';
import '../models/livetv_program.dart';
import '../models/media_grab_operation.dart';
import '../models/media_subscription.dart';
import '../models/transcode_quality_preset.dart';
/// Program info captured when a live session starts. Plex's tune response
/// carries the airing program; Jellyfin streams the channel without a
@@ -85,8 +86,11 @@ abstract class LiveTvPlaybackSession {
/// Re-establish playback after stream death. Plex re-tunes (the previous
/// capture session expires while the player exhausts its reconnect
/// attempts) applying the degradation flags; Jellyfin returns itself so
/// its negotiated HLS URL is re-opened. Returns `null` on failure.
/// attempts) applying the degradation flags. Jellyfin re-negotiates a
/// forced transcode when a direct-play session is asked to drop
/// [directStream] — releasing the direct session's live stream — and
/// otherwise returns itself so its negotiated HLS URL is re-opened.
/// Returns `null` on failure.
Future<LiveTvPlaybackSession?> recover({required bool directStream, required bool directStreamAudio});
}
@@ -160,9 +164,17 @@ abstract class LiveTvSupport {
/// Start a playback session for [channelKey] — the single entry the player
/// uses for initial launch and channel switching. Plex requires [dvrKey]
/// (tune + transcode-session setup); Jellyfin ignores it and negotiates an
/// HLS transcode URL. Returns `null` when the channel can't be started.
Future<LiveTvPlaybackSession?> startPlayback(String channelKey, {String? dvrKey});
/// (tune + transcode-session setup); Jellyfin ignores it. [quality] is the
/// viewer's preset: on `original` Jellyfin asks the server for direct play
/// with no bitrate ceiling and falls back to an uncapped transcode, while a
/// capped preset forces a transcode at that ceiling. Plex does not consume
/// [quality] yet — its live path still hardcodes a transcode (#2072).
/// Returns `null` when the channel can't be started.
Future<LiveTvPlaybackSession?> startPlayback(
String channelKey, {
String? dvrKey,
TranscodeQualityPreset quality = TranscodeQualityPreset.original,
});
/// Source URI to stamp into [FavoriteChannel] entries. Plex uses
/// `server://{machineId}/{providerId}` so its cloud-synced favorites are
+26
View File
@@ -76,6 +76,22 @@ enum MediaBrowserDialect {
MediaBrowserDialect.emby => const [8920, 8096],
};
/// Path of the realtime notification websocket. Same protocol on both
/// dialects (`?api_key=&deviceId=`, `ForceKeepAlive`/`KeepAlive`,
/// `LibraryChanged`); only the route differs. Verified against Jellyfin
/// 10.11 (`/socket`) and Emby 4.9.5 (`/embywebsocket`).
String get webSocketPath => switch (this) {
MediaBrowserDialect.jellyfin => '/socket',
MediaBrowserDialect.emby => '/embywebsocket',
};
/// Emby only routes `LibraryChanged` frames to sessions that registered
/// device capabilities. Measured on Emby 4.9.5: a websocket authenticated
/// with `api_key` received `RefreshProgress` but no `LibraryChanged` until
/// the device POSTed `/Sessions/Capabilities/Full`; Jellyfin 10.11 pushes
/// to every authenticated socket without it.
bool get requiresSessionCapabilitiesForLibraryEvents => this == MediaBrowserDialect.emby;
/// `/QuickConnect/*` plus `POST /Users/AuthenticateWithQuickConnect`.
bool get supportsQuickConnect => this == MediaBrowserDialect.jellyfin;
@@ -91,6 +107,16 @@ enum MediaBrowserDialect {
/// Emby 404s; chapter-name fallback still applies.
bool get supportsMediaSegments => this == MediaBrowserDialect.jellyfin;
/// Before taking the first entry of a `TranscodingProfile.VideoCodec` list,
/// the server rotates codecs the admin has not enabled
/// (`AllowHevcEncoding`/`AllowAv1Encoding`, both off by default) to the
/// back — Jellyfin's `EncodingHelper.ShiftVideoCodecsIfNeeded`. Emby has
/// no such step and no AV1 encoder at all: it hands `av1` straight to
/// ffmpeg and the HLS request fails with 500 `No video encoder found for
/// 'av1'` (#2230). Neither server checks actual encoder availability, so a
/// leading codec must be one the dialect is known to emit.
bool get rotatesDisabledTranscodeCodecs => this == MediaBrowserDialect.jellyfin;
/// `GET /Audio/{id}/Lyrics` (Jellyfin 10.9+). Never call this on Emby: the
/// route resolves to audio streaming with `Lyrics` as the container and
/// spawns an ffmpeg process that fails with a 500.
+13 -6
View File
@@ -75,24 +75,31 @@ class MediaHub {
}
}
bool _isContinueWatchingKey(String rawKey) {
// Per-key memo: every card build and D-pad step re-asks these, and the
// answer needs two regex passes over a key. The set of distinct hub keys a
// session sees is small, so the maps stay small too.
final Map<String, bool> _continueWatchingKeys = <String, bool>{};
final Map<String, bool> _continueWatchingActionKeys = <String, bool>{};
final RegExp _hubKeySeparators = RegExp(r'[^a-z0-9]+');
bool _isContinueWatchingKey(String rawKey) => _continueWatchingKeys.putIfAbsent(rawKey, () {
final compactKey = _compactHubKey(rawKey);
if (compactKey == 'continuewatching') return true;
final tokens = _hubKeyTokens(rawKey);
return tokens.contains('inprogress') || _hasTailToken(tokens, 'continue');
}
});
bool _usesContinueWatchingActionKey(String rawKey) {
bool _usesContinueWatchingActionKey(String rawKey) => _continueWatchingActionKeys.putIfAbsent(rawKey, () {
final tokens = _hubKeyTokens(rawKey);
return _hasTailToken(tokens, 'nextup') || tokens.contains('ondeck');
}
});
List<String> _hubKeyTokens(String rawKey) {
return rawKey.toLowerCase().split(RegExp(r'[^a-z0-9]+')).where((part) => part.isNotEmpty).toList(growable: false);
return rawKey.toLowerCase().split(_hubKeySeparators).where((part) => part.isNotEmpty).toList(growable: false);
}
String _compactHubKey(String rawKey) => rawKey.toLowerCase().replaceAll(RegExp(r'[^a-z0-9]+'), '');
String _compactHubKey(String rawKey) => rawKey.toLowerCase().replaceAll(_hubKeySeparators, '');
bool _hasTailToken(List<String> tokens, String token) => tokens.isNotEmpty && tokens.last == token;
-3
View File
@@ -177,8 +177,6 @@ sealed class MediaItem with _$MediaItem {
@JsonKey(fromJson: _mediaItemVersionsFromJson) List<MediaVersion>? mediaVersions,
String? libraryId,
String? libraryTitle,
String? audioLanguage,
String? subtitleLanguage,
String? trailerKey,
@JsonKey(fromJson: flexibleInt) int? playlistItemId,
@JsonKey(fromJson: flexibleInt) int? playQueueItemId,
@@ -266,7 +264,6 @@ sealed class MediaItem with _$MediaItem {
@JsonKey(fromJson: _mediaItemVersionsFromJson) List<MediaVersion>? mediaVersions,
String? libraryId,
String? libraryTitle,
String? audioLanguage,
/// Jellyfin playlist entry id used by playlist write endpoints.
String? playlistItemId,
File diff suppressed because one or more lines are too long
-6
View File
@@ -67,8 +67,6 @@ PlexMediaItem _$PlexMediaItemFromJson(Map<String, dynamic> json) =>
mediaVersions: _mediaItemVersionsFromJson(json['mediaVersions']),
libraryId: json['libraryId'] as String?,
libraryTitle: json['libraryTitle'] as String?,
audioLanguage: json['audioLanguage'] as String?,
subtitleLanguage: json['subtitleLanguage'] as String?,
trailerKey: json['trailerKey'] as String?,
playlistItemId: flexibleInt(json['playlistItemId']),
playQueueItemId: flexibleInt(json['playQueueItemId']),
@@ -135,8 +133,6 @@ Map<String, dynamic> _$PlexMediaItemToJson(PlexMediaItem instance) =>
'mediaVersions': ?instance.mediaVersions?.map((e) => e.toJson()).toList(),
'libraryId': ?instance.libraryId,
'libraryTitle': ?instance.libraryTitle,
'audioLanguage': ?instance.audioLanguage,
'subtitleLanguage': ?instance.subtitleLanguage,
'trailerKey': ?instance.trailerKey,
'playlistItemId': ?instance.playlistItemId,
'playQueueItemId': ?instance.playQueueItemId,
@@ -207,7 +203,6 @@ JellyfinMediaItem _$JellyfinMediaItemFromJson(Map<String, dynamic> json) =>
mediaVersions: _mediaItemVersionsFromJson(json['mediaVersions']),
libraryId: json['libraryId'] as String?,
libraryTitle: json['libraryTitle'] as String?,
audioLanguage: json['audioLanguage'] as String?,
playlistItemId: json['playlistItemId'] as String?,
serverId: json['serverId'] as String?,
serverName: json['serverName'] as String?,
@@ -270,7 +265,6 @@ Map<String, dynamic> _$JellyfinMediaItemToJson(JellyfinMediaItem instance) =>
'mediaVersions': ?instance.mediaVersions?.map((e) => e.toJson()).toList(),
'libraryId': ?instance.libraryId,
'libraryTitle': ?instance.libraryTitle,
'audioLanguage': ?instance.audioLanguage,
'playlistItemId': ?instance.playlistItemId,
'serverId': ?instance.serverId,
'serverName': ?instance.serverName,
+8
View File
@@ -11,6 +11,7 @@ import 'artist_discography.dart';
import 'download_resolution.dart';
import 'ids.dart';
import 'library_filter_result.dart';
import 'library_change_event.dart';
import 'library_first_character.dart';
import 'library_query.dart';
import 'live_tv_support.dart';
@@ -116,6 +117,13 @@ abstract class MediaServerClient {
/// Release HTTP resources and any other long-lived state. Idempotent.
void close();
/// Open a fresh push channel for this server's library-change
/// notifications, or `null` when the backend has none wired
/// ([ServerCapabilities.libraryChangeEvents]). The caller owns the returned
/// channel's start/stop/dispose lifecycle — `LibraryEventService` in
/// production.
LibraryEventChannel? createLibraryEventChannel() => null;
/// Probe the server with a lightweight auth-required round-trip and
/// classify the outcome. Implementations must surface 401/403 as
/// [HealthStatus.authError] so the manager can flag a revoked token
+11 -16
View File
@@ -20,8 +20,9 @@ enum SubtitlePlaybackMode {
}
/// Backend-neutral subset of a server-stored user profile, scoped to the
/// fields the player needs for auto-track selection. Each backend exposes
/// these on its own concrete type ([PlexUserProfile], [JellyfinUserProfile]).
/// fields the player needs for auto-track selection. [AccountPreferences] is
/// the implementation, so playback reads the same cache the Account
/// preferences screen writes.
///
/// Language strings are server-shaped (Plex returns 639-2/B like "fre",
/// Jellyfin returns 639-2/T like "fra"); [LanguageCodes.getVariations]
@@ -31,23 +32,17 @@ abstract class MediaServerUserProfile {
/// language preferences. False means "keep the file's default track".
bool get autoSelectAudio;
/// Primary preferred audio language. May be null when the user has no
/// preference set.
/// Preferred audio language. May be null when the user has no preference
/// set. Plex also stores a ranked list, but PMS applies that itself when
/// stamping `selected`; the client only needs the primary as a fallback.
String? get defaultAudioLanguage;
/// Additional ranked audio language preferences. Plex exposes a list,
/// Jellyfin only the primary; Jellyfin implementations return null.
List<String>? get defaultAudioLanguages;
/// Primary preferred subtitle language. May be null.
/// Preferred subtitle language. May be null.
String? get defaultSubtitleLanguage;
/// Additional ranked subtitle language preferences. Same Plex/Jellyfin
/// difference as the audio list.
List<String>? get defaultSubtitleLanguages;
/// Server-side subtitle mode when exposed by the backend. Plex does not map
/// cleanly to Jellyfin's mode enum, so it returns null and keeps existing
/// Plex-selected-stream behavior.
/// Server-side subtitle mode when the backend leaves auto-selection to the
/// client (MediaBrowser). Plex exposes `autoSelectSubtitle` too, but PMS
/// applies it itself when stamping `selected` on streams, so
/// [TrackSelectionService] ignores the mode for Plex items.
SubtitlePlaybackMode? get subtitleMode => null;
}
+12
View File
@@ -376,11 +376,22 @@ class PlaybackExtras {
return RegExp(source, caseSensitive: false);
}
/// Longest chapter that may become a chapter-derived intro marker.
///
/// Detected intros (Plex, Intro Skipper) fall well inside two minutes; a
/// movie's first chapter titled "Opening Credits" or "Introduction" runs
/// five to ten minutes of actual picture, and skipping it skips the film
/// (#2235). Applies only to markers minted here from chapter titles, never
/// to server-supplied markers, and never to credits, which are legitimately
/// long on movies.
static const maxChapterIntroDuration = Duration(minutes: 3);
/// Returns [PlaybackExtras] using real markers when available, filling any
/// missing marker types from chapter titles matching intro/credits patterns.
/// [forceChapterFallback] prefers chapter-derived markers for any type they
/// provide. When real markers exist, reclassifies markers with unknown types
/// against the patterns so non-standard type strings get recognized.
/// Chapter-derived intros longer than [maxChapterIntroDuration] are dropped.
factory PlaybackExtras.withChapterFallback({
required List<MediaChapter> chapters,
required List<MediaMarker> markers,
@@ -411,6 +422,7 @@ class PlaybackExtras {
final end = ch.endTimeOffset ?? (i + 1 < chapters.length ? chapters[i + 1].startTimeOffset : null);
if (end == null) continue;
if (type == 'intro' && end - start > maxChapterIntroDuration.inMilliseconds) continue;
synthetic.add(MediaMarker(id: ch.id, type: type, startTimeOffset: start, endTimeOffset: end));
}
+9
View File
@@ -12,8 +12,16 @@ class MediaStream {
final String? languageCode;
final String? title;
final String? displayTitle;
/// The server's current pick for this user (Plex `selected`, Jellyfin's
/// default-stream index). Distinct from [isDefault]: Plex marks the
/// container's default track separately, and the player's selection ladder
/// ranks the two differently.
final bool selected;
/// The container's own default flag (Plex `default`, Jellyfin `IsDefault`).
final bool isDefault;
// Audio
final int? channels;
@@ -41,6 +49,7 @@ class MediaStream {
this.title,
this.displayTitle,
this.selected = false,
this.isDefault = false,
this.channels,
this.frameRate,
this.hdr = false,
+13
View File
@@ -61,6 +61,14 @@ class ServerCapabilities {
/// (`POST /playQueues?type=audio&uri=...station...`).
final bool instantMix;
/// Server pushes library-content change notifications over a websocket the
/// app can subscribe to (#1646). Plex: `/:/websockets/notifications`
/// timeline entries; Jellyfin/Emby: `LibraryChanged` on the session socket.
/// Whether a *specific* server's socket is reachable (reverse proxies may
/// not upgrade) is a runtime concern handled by [LibraryEventService]'s
/// silent degradation.
final bool libraryChangeEvents;
const ServerCapabilities({
this.liveTv = false,
this.liveTvDvr = false,
@@ -74,6 +82,7 @@ class ServerCapabilities {
this.scrubThumbnails = false,
this.folderGrouping = false,
this.instantMix = false,
this.libraryChangeEvents = false,
});
/// Defaults for a fully-featured Plex server.
@@ -90,6 +99,7 @@ class ServerCapabilities {
scrubThumbnails: true,
folderGrouping: true,
instantMix: true,
libraryChangeEvents: true,
);
/// Defaults for a Jellyfin server.
@@ -113,6 +123,7 @@ class ServerCapabilities {
scrubThumbnails: true,
folderGrouping: true,
instantMix: true,
libraryChangeEvents: true,
);
/// Defaults for an Emby server.
@@ -142,6 +153,7 @@ class ServerCapabilities {
scrubThumbnails: true,
folderGrouping: true,
instantMix: true,
libraryChangeEvents: true,
);
/// Every flag here is fixed per backend *kind* except [videoTranscoding],
@@ -162,6 +174,7 @@ class ServerCapabilities {
scrubThumbnails: scrubThumbnails,
folderGrouping: folderGrouping,
instantMix: instantMix,
libraryChangeEvents: libraryChangeEvents,
);
}
}
@@ -4,6 +4,7 @@ import '../media/media_item.dart';
import '../media/media_kind.dart';
import '../media/media_server_client.dart';
import '../services/plex_client.dart';
import '../services/plex_constants.dart';
import '../utils/app_logger.dart';
import '../utils/language_codes.dart';
import 'metadata_edit_models.dart';
@@ -82,7 +83,8 @@ class PlexMetadataEditAdapter extends MetadataEditAdapter {
final success = await client.updateMetadata(
sectionId: sectionId,
ratingKey: draft.sourceItem.id,
typeNumber: _plexTypeNumberForKind(draft.sourceItem.kind),
// supportsKind restricts drafts to the four video kinds.
typeNumber: PlexMetadataType.forKind(draft.sourceItem.kind) ?? 0,
title: _changedString(draft, 'title'),
titleSort: _changedString(draft, 'titleSort'),
originalTitle: _changedString(draft, 'originalTitle'),
@@ -329,14 +331,6 @@ class PlexMetadataEditAdapter extends MetadataEditAdapter {
String? _prefKey(String fieldId) => fieldId.startsWith('pref:') ? fieldId.substring(5) : null;
}
int _plexTypeNumberForKind(MediaKind kind) => switch (kind) {
MediaKind.movie => 1,
MediaKind.show => 2,
MediaKind.season => 3,
MediaKind.episode => 4,
_ => 0,
};
const _plexLocaleCodes = [
'ar-SA',
'bg-BG',
+6 -2
View File
@@ -175,9 +175,13 @@ mixin DebouncedMediaSearch<T extends StatefulWidget> on State<T> {
/// The results list both screens render: padded, without keep-alives or
/// semantic indexes. One child per entry of [searchResults] unless the
/// caller renders a filtered view and passes its own [childCount].
Widget buildResultsSliver(NullableIndexedWidgetBuilder itemBuilder, {int? childCount}) {
Widget buildResultsSliver(
NullableIndexedWidgetBuilder itemBuilder, {
int? childCount,
EdgeInsetsGeometry padding = const EdgeInsets.all(16),
}) {
return SliverPadding(
padding: const EdgeInsets.all(16),
padding: padding,
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
itemBuilder,
+82
View File
@@ -203,6 +203,88 @@ mixin PaginatedItemLoader<T, W extends StatefulWidget> on State<W> {
totalSize = (totalSize - 1).clamp(0, totalSize);
}
/// Refetch the loaded span in place — the sparse-grid equivalent of Plex
/// Web's `repopulateRange`. The old items stay rendered while the fetch
/// runs; on success the span is replaced wholesale and [totalSize] adopts
/// the server's new count, so server-side additions materialize at their
/// sorted positions and removals disappear with no clearing and no
/// skeleton flash. On failure the old content stays untouched
/// (best-effort background refresh; the staleness paths recover).
///
/// [anchorId] (resolved through [idOf]) reports where a caller-chosen item
/// moved, so the caller can compensate the scroll offset and keep it
/// visually stationary. A null result means nothing was applied.
///
/// [maxSpan] bounds the refetched request: a sparse map holding disjoint
/// clusters (initial pages plus an alpha-jump target) would otherwise span
/// nearly the whole library in one call. When the span exceeds it, entries
/// outside a [maxSpan]-wide window centered on [windowCenter] are dropped
/// first — they degrade to ordinary unloaded slots the scroll path
/// refetches on demand. Callers that cache per-index state (focus nodes)
/// evict theirs to the same window.
Future<({int? anchorOldIndex, int? anchorNewIndex})?> repopulateLoadedRange({
required String Function(T item) idOf,
String? anchorId,
int? maxSpan,
int? windowCenter,
}) async {
if (!mounted || loadedItems.isEmpty || totalSize == 0) return null;
var indices = loadedItems.keys.toList()..sort();
if (maxSpan != null && indices.last - indices.first + 1 > maxSpan) {
final center = (windowCenter ?? indices.first).clamp(indices.first, indices.last);
final lo = center - maxSpan ~/ 2;
loadedItems.removeWhere((index, _) => index < lo || index >= lo + maxSpan);
if (loadedItems.isEmpty) return null;
indices = loadedItems.keys.toList()..sort();
}
final start = indices.first;
final size = indices.last - start + 1;
int? anchorOldIndex;
if (anchorId != null) {
for (final entry in loadedItems.entries) {
if (idOf(entry.value) == anchorId) {
anchorOldIndex = entry.key;
break;
}
}
}
// Supersede in-flight fetches: their merges would interleave stale pages
// into the repopulated span.
_requestId++;
_cancelToken?.abort();
_cancelToken = AbortController();
_retryTimer?.cancel();
_loadingRanges.clear();
_scheduledRetry = null;
final generation = _requestId;
final LibraryPage<T> page;
try {
page = await fetchPage(start, size, _cancelToken);
} catch (_) {
return null;
}
if (generation != _requestId || !mounted) return null;
int? anchorNewIndex;
if (anchorId != null) {
for (var i = 0; i < page.items.length; i++) {
if (idOf(page.items[i]) == anchorId) {
anchorNewIndex = start + i;
break;
}
}
}
setState(() {
loadedItems.removeWhere((index, _) => index >= start && index < start + size);
for (var i = 0; i < page.items.length; i++) {
loadedItems[start + i] = page.items[i];
}
totalSize = page.totalCount;
loadedItems.removeWhere((index, _) => index >= totalSize);
});
onPageLoaded(start, page.items);
return (anchorOldIndex: anchorOldIndex, anchorNewIndex: anchorNewIndex);
}
/// Discard the "fetch in flight" markers. In-flight network requests keep
/// running but are no longer considered for dedupe — the next
/// [ensureRangeLoaded] / [prefetchAhead] will re-scan the visible range.
@@ -1,50 +0,0 @@
import '../../media/media_server_user_profile.dart';
/// Jellyfin user playback preferences, sourced from `User.Configuration`
/// (returned by `/Users/{userId}` or `/Users/Me`). Jellyfin exposes only a
/// single ranked audio/subtitle language, so the multi-list accessors on
/// [MediaServerUserProfile] return null.
class JellyfinUserProfile implements MediaServerUserProfile {
@override
final bool autoSelectAudio;
@override
final String? defaultAudioLanguage;
@override
final String? defaultSubtitleLanguage;
/// Server-reported subtitle mode (None / Default / Always / OnlyForced /
/// Smart).
@override
final SubtitlePlaybackMode? subtitleMode;
const JellyfinUserProfile({
required this.autoSelectAudio,
this.defaultAudioLanguage,
this.defaultSubtitleLanguage,
this.subtitleMode,
});
@override
List<String>? get defaultAudioLanguages => null;
@override
List<String>? get defaultSubtitleLanguages => null;
/// Build from `/Users/Me` (or `/Users/{userId}`) response — pulls the
/// `Configuration` block; missing values fall back to server defaults
/// (auto-select on, no language preference).
factory JellyfinUserProfile.fromUserDto(Map<String, dynamic> json) {
final config = json['Configuration'] as Map<String, dynamic>? ?? const {};
final audio = config['AudioLanguagePreference'] as String?;
final subtitle = config['SubtitleLanguagePreference'] as String?;
final playDefault = config['PlayDefaultAudioTrack'] as bool? ?? true;
return JellyfinUserProfile(
autoSelectAudio: playDefault,
defaultAudioLanguage: (audio == null || audio.isEmpty) ? null : audio,
defaultSubtitleLanguage: (subtitle == null || subtitle.isEmpty) ? null : subtitle,
subtitleMode: SubtitlePlaybackMode.fromServerValue(config['SubtitleMode']),
);
}
}

Some files were not shown because too many files have changed in this diff Show More