Expand description
Device-profile policy: turning what a device reports about its audio output into the constraints we send Jellyfin.
The platform layer reports raw facts (what MediaCodecList enumerates, how
many channels the current audio route accepts); deciding what those facts
mean for a DeviceProfile is domain logic and lives here, on the Rust side
of the boundary, where it is testable without a device.
Constants§
- EXTERNAL_
SUBTITLE_ 🔒FORMATS - Subtitle formats we can render ourselves, delivered as an external sidecar track rather than painted into the video.
- FALLBACK_
AUDIO_ 🔒CHANNELS - Channel count assumed when the platform cannot tell us — every audio route can voice stereo, so it is the only safe floor.
- FALLBACK_
AUDIO_ 🔒CODEC - The codec claimed when a device reports nothing we can use. Every renderer decodes AAC, and claiming something is what makes the server transcode to it rather than give up.
- MAX_
SUPPORTED_ 🔒AUDIO_ CHANNELS - Upper bound we are willing to claim. Jellyfin profiles top out at 7.1, and a nonsense reading from a driver should not become a nonsense profile.
- NO_
SUBTITLE_ STREAM - Jellyfin’s sentinel for “negotiate no subtitle stream at all”.
- SUBTITLE_
QUERY_ 🔒KEYS - Query keys through which a stream URL can carry a subtitle decision.
- WEBVIEW_
AUDIO_ 🔒CODECS - Audio codecs the webview’s
<video>element can decode.
Functions§
- audio_
forces_ transcode - Decide whether we must transcode regardless of what the server negotiated,
given the source’s audio streams as
(codec, is_default)in source order. - clamp_
max_ audio_ channels - Decide the
MaxAudioChannelsto advertise, given what the current audio route reported. - max_
audio_ channels - The channel cap for this device, reading the platform’s report where one exists.
- playback_
subtitle_ stream_ index - The
SubtitleStreamIndexto negotiate with: always “none”. - served_
audio_ codec - The codec of the audio track the server will actually serve, given the
source’s audio streams as
(codec, is_default)in source order: the default, or the first when none is marked. - subtitle_
forces_ burn_ in - Whether asking the server to serve this subtitle codec forces it to burn the subtitle into the picture.
- subtitle_
profiles - The
SubtitleProfileentries to advertise, as(format, method). - subtitle_
supports_ external_ delivery - Whether a subtitle in this format can reach the app as a sidecar it draws
itself — the same verdict as
subtitle_forces_burn_in, from the reader’s side, and the one a subtitle picker needs. - video_
audio_ codecs - Narrow a detected audio-codec list to what the renderer that will actually play the video can decode.
- webview_
can_ decode_ audio - Whether the webview
<video>element can decode this audio codec. - without_
server_ chosen_ subtitle - Rewrite a stream URL so it asks for no subtitle, whoever built it.