21 lines
10 KiB
HTML
21 lines
10 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Device-profile policy: turning what a device reports about its audio output into the constraints we send Jellyfin."><title>jellytau_lib::repository::device_profile - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="jellytau_lib" data-themes="" data-resource-suffix="" data-rustdoc-version="1.97.1 (8bab26f4f 2026-07-14)" data-channel="1.97.1" data-search-js="search-fd9372ac.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-fcd733ba.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module device_profile</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../jellytau_lib/index.html">jellytau_<wbr>lib</a><span class="version">0.10.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module device_<wbr>profile</a></h2><h3><a href="#constants">Module Items</a></h3><ul class="block"><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In jellytau_<wbr>lib::<wbr>repository</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">jellytau_lib</a>::<wbr><a href="../index.html">repository</a></div><h1>Module <span>device_<wbr>profile</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/jellytau_lib/repository/device_profile.rs.html#1-550">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Device-profile policy: turning what a device <em>reports</em> about its audio
|
||
output into the constraints we send Jellyfin.</p>
|
||
<p>The platform layer reports raw facts (what <code>MediaCodecList</code> enumerates, how
|
||
many channels the current audio route accepts); deciding what those facts
|
||
mean for a <code>DeviceProfile</code> is domain logic and lives here, on the Rust side
|
||
of the boundary, where it is testable without a device.</p>
|
||
</div></details><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.EXTERNAL_SUBTITLE_FORMATS.html" title="constant jellytau_lib::repository::device_profile::EXTERNAL_SUBTITLE_FORMATS">EXTERNAL_<wbr>SUBTITLE_<wbr>FORMATS</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Subtitle formats we can render ourselves, delivered as an external sidecar
|
||
track rather than painted into the video.</dd><dt><a class="constant" href="constant.FALLBACK_AUDIO_CHANNELS.html" title="constant jellytau_lib::repository::device_profile::FALLBACK_AUDIO_CHANNELS">FALLBACK_<wbr>AUDIO_<wbr>CHANNELS</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Channel count assumed when the platform cannot tell us — every audio route
|
||
can voice stereo, so it is the only safe floor.</dd><dt><a class="constant" href="constant.FALLBACK_AUDIO_CODEC.html" title="constant jellytau_lib::repository::device_profile::FALLBACK_AUDIO_CODEC">FALLBACK_<wbr>AUDIO_<wbr>CODEC</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>The codec claimed when a device reports nothing we can use. Every renderer
|
||
decodes AAC, and claiming <em>something</em> is what makes the server transcode to
|
||
it rather than give up.</dd><dt><a class="constant" href="constant.MAX_SUPPORTED_AUDIO_CHANNELS.html" title="constant jellytau_lib::repository::device_profile::MAX_SUPPORTED_AUDIO_CHANNELS">MAX_<wbr>SUPPORTED_<wbr>AUDIO_<wbr>CHANNELS</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>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.</dd><dt><a class="constant" href="constant.NO_SUBTITLE_STREAM.html" title="constant jellytau_lib::repository::device_profile::NO_SUBTITLE_STREAM">NO_<wbr>SUBTITLE_<wbr>STREAM</a></dt><dd>Jellyfin’s sentinel for “negotiate no subtitle stream at all”.</dd><dt><a class="constant" href="constant.SUBTITLE_QUERY_KEYS.html" title="constant jellytau_lib::repository::device_profile::SUBTITLE_QUERY_KEYS">SUBTITLE_<wbr>QUERY_<wbr>KEYS</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Query keys through which a stream URL can carry a subtitle decision.</dd><dt><a class="constant" href="constant.WEBVIEW_AUDIO_CODECS.html" title="constant jellytau_lib::repository::device_profile::WEBVIEW_AUDIO_CODECS">WEBVIEW_<wbr>AUDIO_<wbr>CODECS</a><span title="Restricted Visibility"> 🔒</span> </dt><dd>Audio codecs the webview’s <code><video></code> element can decode.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.audio_forces_transcode.html" title="fn jellytau_lib::repository::device_profile::audio_forces_transcode">audio_<wbr>forces_<wbr>transcode</a></dt><dd>Decide whether we must transcode <em>regardless of what the server negotiated</em>,
|
||
given the source’s audio streams as <code>(codec, is_default)</code> in source order.</dd><dt><a class="fn" href="fn.clamp_max_audio_channels.html" title="fn jellytau_lib::repository::device_profile::clamp_max_audio_channels">clamp_<wbr>max_<wbr>audio_<wbr>channels</a></dt><dd>Decide the <code>MaxAudioChannels</code> to advertise, given what the current audio
|
||
route reported.</dd><dt><a class="fn" href="fn.max_audio_channels.html" title="fn jellytau_lib::repository::device_profile::max_audio_channels">max_<wbr>audio_<wbr>channels</a></dt><dd>The channel cap for this device, reading the platform’s report where one
|
||
exists.</dd><dt><a class="fn" href="fn.playback_subtitle_stream_index.html" title="fn jellytau_lib::repository::device_profile::playback_subtitle_stream_index">playback_<wbr>subtitle_<wbr>stream_<wbr>index</a></dt><dd>The <code>SubtitleStreamIndex</code> to negotiate with: always “none”.</dd><dt><a class="fn" href="fn.served_audio_codec.html" title="fn jellytau_lib::repository::device_profile::served_audio_codec">served_<wbr>audio_<wbr>codec</a></dt><dd>The codec of the audio track the server will actually serve, given the
|
||
source’s audio streams as <code>(codec, is_default)</code> in source order: the default,
|
||
or the first when none is marked.</dd><dt><a class="fn" href="fn.subtitle_forces_burn_in.html" title="fn jellytau_lib::repository::device_profile::subtitle_forces_burn_in">subtitle_<wbr>forces_<wbr>burn_<wbr>in</a></dt><dd>Whether asking the server to serve this subtitle codec forces it to burn the
|
||
subtitle into the picture.</dd><dt><a class="fn" href="fn.subtitle_profiles.html" title="fn jellytau_lib::repository::device_profile::subtitle_profiles">subtitle_<wbr>profiles</a></dt><dd>The <code>SubtitleProfile</code> entries to advertise, as <code>(format, method)</code>.</dd><dt><a class="fn" href="fn.subtitle_supports_external_delivery.html" title="fn jellytau_lib::repository::device_profile::subtitle_supports_external_delivery">subtitle_<wbr>supports_<wbr>external_<wbr>delivery</a></dt><dd>Whether a subtitle in this format can reach the app as a sidecar it draws
|
||
itself — the same verdict as <a href="fn.subtitle_forces_burn_in.html" title="fn jellytau_lib::repository::device_profile::subtitle_forces_burn_in"><code>subtitle_forces_burn_in</code></a>, from the reader’s
|
||
side, and the one a subtitle picker needs.</dd><dt><a class="fn" href="fn.video_audio_codecs.html" title="fn jellytau_lib::repository::device_profile::video_audio_codecs">video_<wbr>audio_<wbr>codecs</a></dt><dd>Narrow a detected audio-codec list to what the renderer that will actually
|
||
play the <strong>video</strong> can decode.</dd><dt><a class="fn" href="fn.webview_can_decode_audio.html" title="fn jellytau_lib::repository::device_profile::webview_can_decode_audio">webview_<wbr>can_<wbr>decode_<wbr>audio</a></dt><dd>Whether the webview <code><video></code> element can decode this audio codec.</dd><dt><a class="fn" href="fn.without_server_chosen_subtitle.html" title="fn jellytau_lib::repository::device_profile::without_server_chosen_subtitle">without_<wbr>server_<wbr>chosen_<wbr>subtitle</a></dt><dd>Rewrite a stream URL so it asks for no subtitle, whoever built it.</dd></dl></section></div></main></body></html> |