Skip to content

Detail and Home hero: name HDR and Dolby Vision beside the resolution - #1348

Merged
GLinnik21 merged 4 commits into
plxnative:mainfrom
tiper:up/hdr-badge
Nov 19, 2026
Merged

GLinnik21 merged 4 commits into
plxnative:mainfrom
tiper:up/hdr-badge

Conversation

@tiper

@tiper tiper commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The identity line said "4K" for an HDR or Dolby Vision film and nothing more: the poster caption’s Video quality part was the only place the app worded the dynamic range. The detail page and Home’s hero now draw one more keyline chip right after the resolution: "Dolby Vision" for a file that carries it, and "HDR" for any other HDR video (HDR10, HDR10+, HLG).

The detail page reads it from route::detail_played_video, the file Play starts, which the resolution chip also reads (#1457): it names what this set will present, so a Profile 8.1 file on a set without Dolby Vision, or with it Off, reads HDR. The hero reads it from its listing row, which now carries whether its HDR stream is Dolby Vision alongside the HDR flag it already had (ListingFacts, PmsMovie), so the hero only shows a chip when the row includes the video stream. The poster caption is unchanged and still reads “HDR” for both.

Both go through fmt::dynamic_range and the shared identity row, so the chip takes part in the text run’s budget and elision like the others.

@GLinnik21

Copy link
Copy Markdown
Collaborator

Could you please post screenshots?

@tiper

tiper commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

These are from the desktop simulator against the Plex mock, so the titles and art are placeholders.

Detail page with Dolby Vision, HDR10 and SDR:
plex-detail-sdr-1080p-20261112T164932-335f
plex-detail-hdr10-4k-20261112T164931-c2b5
plex-detail-dolby-vision-4k

Home hero with Dolby Vision and HDR10:
plex-home-hero-hdr10-4k
plex-home-hero-dolby-vision-4k

You can now tell at a glance whether a title is HDR or Dolby Vision before you hit Play, on Home and on the detail page alike, without opening the Video quality caption.

The identity line said "4K" for an HDR or Dolby Vision film and nothing more: the poster caption's Video quality part was the only place the app worded the dynamic range. The detail page now draws one more keyline chip right after the resolution, "Dolby Vision" for a file that carries it and "HDR" for any other HDR video (the facts the page already holds, of the same default version the resolution chip describes). Home's hero draws "HDR" in the same place when its row says so; a listing row knows only that its video is HDR, so a Dolby Vision title reads "HDR" there, as it does under a poster.

Both go through the shared identity row, so the chip takes part in the text run's budget and elision like the others.

Signed-off-by: Tiago Pereira <[email protected]>
The hero read "HDR" for a Dolby Vision title because a listing row knew only that its video is HDR. The row now also carries whether that stream is Dolby Vision, along the lane the HDR fact already travels (ListingFacts, PmsMovie), and the hero words both through fmt::dynamic_range.

Signed-off-by: Tiago Pereira <[email protected]>
@fraygox

fraygox commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Reviewed the combined diff against current main (8e8330ab0) — LGTM, nothing I'd change before merge.

  • Both surfaces word the chip through fmt::dynamic_range and draw it through the shared identity row, so it takes part in the same budget and elision as the other chips.
  • Detail and the hero agree on what counts as Dolby Vision (DOVIPresent), including the Profile 5 case with no colorTrc, and the detail chip describes the same version as the resolution chip.
  • dolby_vision is serde(default) and excluded from the frozen initial.rs encoding, so older recordings still load and no recorded hash moves.
  • Still merges cleanly into main; no new callers of hero_metadata have landed since the branch was cut.

Two non-blocking thoughts, fine as follow-ups or to ignore:

  1. The chip names what the file carries, not what will play: with Dolby Vision set to Off (or on a set without it) the page still says "Dolby Vision" while playback uses the HDR10 layer. That matches how the resolution chip behaves, so I think it's the right default — just flagging it as a deliberate choice.
  2. The poster caption still says "HDR" for a Dolby Vision title. The row carries the flag now, so that could follow if wanted.

@GLinnik21 GLinnik21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving: the change itself is good. The badge is worded by fmt::dynamic_range and drawn in the shared identity row, both surfaces read DOVIPresent the same way, and the new field stays out of the frozen encoding.

It now conflicts with main in detail/mod.rs, and the conflict needs a decision, not just keeping both sides:

  • Since #1379, the detail page's facts row and badges describe the version Play starts (detail_play_version), not the page's first media. The resolution chip already follows that version.
  • Since #1421, which version Play starts depends on Dolby Vision. On a set without Dolby Vision, or with it turned Off, a Profile 5 copy listed first gives way to an HDR10 or SDR copy of the same class.

So when you resolve the conflict, the HDR / Dolby Vision chip should describe the same version as the resolution chip, using that version's own HDR and Dolby Vision. Fall back to the page's values only when there is no such version, the same way the resolution chip falls back. If both chips keep reading d.hdr / d.dovi, a title with several versions could show "4K" for one file and "Dolby Vision" for another. Following the play version also mostly answers fraygox's first point: where an HDR10 copy exists, the page names the file that will actually play.

Please run CI again after merging main too. #1420, a large UI refactor, landed since this branch was cut.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

A follow-up to my review: please don't resolve the conflict by adding a third hand-written fallback. The facts of "the file Play starts" should come from one place, and the detail chip should read them from there.

Why. version_play_starts (media/src/route/plan.rs) already decides which version plays, for both Play and the detail page. What is still spread out is the fallback to the page's own facts when it returns None: detail/mod.rs does it by hand for the resolution, detail/hero.rs (played_hdr) for HDR, and the private preview_file (route/decision.rs) for the route preview. A chip that reads d.hdr / d.dovi would be a fourth copy that can drift from the others.

Proposed shape (a design, not code yet):

  • A pure function in route/plan.rs, next to version_play_starts: played_video(d, mode, caps, dv_mode, dv_probed) -> Option<PlayedVideo>. It folds in detail_version_with's logic and owns the only fallback. None from the chooser means first version, Forced mode or a single version, and gives the page's facts. A show answers for its on-deck episode. A page with no part at all gives None.
  • PlayedVideo carries version, resolution, width, height, vcodec, kbps, acodec, hdr, plus both kinds of Dolby Vision: dovi (what the file carries) and dv (what the set will present, from frozen_dv_decision).
  • PlayedVideo::range() -> DynamicRange { Sdr, Hdr, DolbyVision }: DolbyVision only when the set will present it, otherwise Hdr if hdr.
  • plan.rs is under the globals scan, so the core takes its inputs. A thin wrapper detail_played_video(d) in decision.rs reads the session and devcaps the way detail_play_version does today. Screens call the wrapper.

What the chip shows: what the set will present, not what the file carries. The resolution chip already describes what Play starts on this set. So on a set without Dolby Vision, or with it Off, the page would say "HDR" for a P8.1 file that plays its HDR10 base layer. This also settles fraygox's first point. The one gap is a transcode: there the chip still names the source's range, and the facts row's existing tone-map warning stays the read-out for that.

What moves to it

  • The resolution chip in detail/mod.rs reads f.resolution / f.width / f.height.
  • played_hdr in hero.rs is deleted, and its caller reads f.hdr.
  • preview_file takes its video facts from played_video and keeps only the part / audio / subtitle lookup.
  • detail_play_version goes private, or away.
  • fmt::dynamic_range takes a DynamicRange (the enum lives low enough that references still point down).

This PR's chips

  • Detail page: detail_played_video(d).map(|f| f.range()).
  • Home hero: not covered. Listing versions carry no stream facts and the hero plans no route, so it keeps Media[0] facts through a separate DynamicRange::carried(hdr, dolby_vision), documented as "what the file carries". Gating it on the set's Dolby Vision is a possible follow-up.

Tests to pin it (pure, in plan.rs):

  • a single version, and a first version that direct-plays, give the page's facts;
  • a substituted version gives that version's resolution and range;
  • Forced mode gives the page's facts;
  • no part gives None, and a show gives its on-deck episode;
  • a P8.1 file on an unsupported set, and with DV Off, gives Hdr while dovi.present stays true, and DolbyVision on a supported set;
  • a P5 file on an unsupported set never gives DolbyVision;
  • playback_preview and played_video name the same version.

Order. This refactor should land first, as its own small, behaviour-neutral PR on main. After that, this PR's conflict is one line reading range(). If you'd like to take the refactor yourself, go ahead; otherwise say so and we'll do it, then this PR only needs to read from it.


Generated by Claude Code

@GLinnik21 GLinnik21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing my earlier approval to a request for changes, so this doesn't merge before the conflict is resolved the way described in #1348 (comment).

What's needed before merge:

  • The detail page's HDR / Dolby Vision chip should read the facts of the file Play starts from one shared source (played_video / range() in that comment), not from d.hdr / d.dovi or another hand-written fallback.
  • That refactor lands first, as its own small PR on main (yours or ours, just say which). Then merge main into this branch and run CI again.

The rest of the change is still fine as it is.


Generated by Claude Code

@tiper

tiper commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the design, that makes sense. Please go ahead with the played_video refactor, once it's on main I'll merge main into this branch, have the detail chip read range(), and re-run CI.

The detail page's HDR / Dolby Vision chip now reads route::detail_played_video's
range(), the same file the resolution chip describes, and names what this set
will present. The Home hero keeps the listing row's facts through
DynamicRange::carried.

Signed-off-by: Tiago Pereira <[email protected]>
@GLinnik21

Copy link
Copy Markdown
Collaborator

@tiper, #1457 landed on main in 247aa86. You can merge main into this branch now.

For the detail chip, reuse the detail_played_video(d) result for both resolution and fmt::dynamic_range(video.range()). That keeps both chips on the same version when Play picks a different copy. For the Home hero, pass DynamicRange::carried(hdr, dolby_vision) to the same formatter, since the listing describes the file before a playback route is selected.

Once you’ve updated the branch and CI passes, I’ll re-review.

@tiper

tiper commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@GLinnik21

The detail page takes detail_played_video(d) once and reads both the resolution and fmt::dynamic_range(f.range()) from it. The Home hero passes DynamicRange::carried(hdr, dolby_vision) to the same formatter. The identity test now expects "HDR" for a Dolby Vision file when the set has no Dolby Vision probe; played_video's tests cover a supported set.

CI is green except the two macOS simulator jobs, which were cancelled by the runner (the same code passed them on #1412). Could you re-run those two?

#1412 has this branch merged in and words the caption through DynamicRange::carried too.

@GLinnik21 GLinnik21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is the shape we agreed on. Detail reads one detail_played_video(d) result for both the resolution and fmt::dynamic_range(f.range()), the hero goes through DynamicRange::carried, both draw through the shared identity row, and dolby_vision stays out of the frozen initial.rs encoding. It still merges cleanly into current main. I've re-run the two cancelled macOS jobs. They stopped at exactly 15 min, which is the brew install step's limit, so they look like a stalled download, not this code.

Two final nits before merge:

  1. rust-modules/ui/src/widgets.rs:1806: the hero_identity doc still says "outlined resolution/accessibility chips". It should mention the dynamic-range chip too.
  2. The second commit's subject ("says so, as its detail page does") isn't quite right: on a set without Dolby Vision, or with it Off, the hero says "Dolby Vision" while the detail page says "HDR", by design. Please keep that wording out of the final PR description / squash message, or reword it to "Home names what the file carries, detail what the set will present".

Generated by Claude Code

@GLinnik21
GLinnik21 merged commit 546999d into plxnative:main Nov 19, 2026
18 of 21 checks passed
tiper added a commit to tiper/fin-native that referenced this pull request Nov 19, 2026
@tiper
tiper deleted the up/hdr-badge branch November 21, 2026 19:21
tiper added a commit to tiper/fin-native that referenced this pull request Nov 23, 2026
…s declared

A remux can drop the container's Dolby Vision configuration record and
keep the RPUs in the bitstream. The server then reports no Dolby Vision,
the Load declares no DolbyHdrInfo node and the panel shows the base
layer while every RPU is still fed.

For an HEVC stream with no record, the demuxer now reads its first
packets (ff::RpuOnlyScan) and reports, once per open, what the first
RPU says (FeedRaw::rpu_dovi): Profile 5, or Profile 8 over a PQ or HLG
base layer. An RPU that maps an enhancement layer, an enhancement-layer
NAL and an RPU that does not parse report nothing; a Profile 8 over any
other transfer is logged as refused. Once the Load has returned, the
pump has the route declare it (route::declare_rpu_dovi: the decision
the record would have frozen, so Dolby Vision Off, a set without
confirmed support and a re-encode change nothing) and reloads once with
the node. The installed route, the file's own declaration and the
stored Auto Original candidate all follow, and a later withdrawal is
not undone.

The base layer's transfer is the container's, or, where the container
states none (a Matroska remux with no Colour element reports trc=2),
the first SPS's VUI transfer_characteristics (ff::stream_transfer).

Measured on an LG C1 (webOS 6.5.3), stable build, on an MKV with Profile
8 RPUs, no record, trc=2 in the container and PQ in the SPS:
- before: Load dv=present:0, dynamicRange=hdr, pictureMode=hdrCinemaBright
- after: "the SPS says trc=16", "Dolby Vision P8 bl_compat=1 in the
  RPUs", "dv: reload at 323.291s with DolbyHdrInfo", Load
  dv=present:1 P8/1, dynamicRange=dolbyHdr,
  pictureMode=dolbyHdrCinemaBright; no withdrawal after the reload.
Not measured: a Profile 5 or HLG Profile 8 stream with no record, and
the 49SM9000 dev set.

Not remembered: the finding lives for the play that made it. The
server's metadata still reports no Dolby Vision for such a file, so the
detail and Home hero range chip (plxnative#1348) and the poster caption (plxnative#1412)
read HDR while the set plays Dolby Vision, and each play declares it
again with one reload.

Signed-off-by: Tiago Pereira <[email protected]>
GLinnik21 pushed a commit that referenced this pull request Nov 23, 2026
…s declared (#1472)

* Playback: Dolby Vision found in the RPUs of a stream with no record is declared

A remux can drop the container's Dolby Vision configuration record and
keep the RPUs in the bitstream. The server then reports no Dolby Vision,
the Load declares no DolbyHdrInfo node and the panel shows the base
layer while every RPU is still fed.

For an HEVC stream with no record, the demuxer now reads its first
packets (ff::RpuOnlyScan) and reports, once per open, what the first
RPU says (FeedRaw::rpu_dovi): Profile 5, or Profile 8 over a PQ or HLG
base layer. An RPU that maps an enhancement layer, an enhancement-layer
NAL and an RPU that does not parse report nothing; a Profile 8 over any
other transfer is logged as refused. Once the Load has returned, the
pump has the route declare it (route::declare_rpu_dovi: the decision
the record would have frozen, so Dolby Vision Off, a set without
confirmed support and a re-encode change nothing) and reloads once with
the node. The installed route, the file's own declaration and the
stored Auto Original candidate all follow, and a later withdrawal is
not undone.

The base layer's transfer is the container's, or, where the container
states none (a Matroska remux with no Colour element reports trc=2),
the first SPS's VUI transfer_characteristics (ff::stream_transfer).

Measured on an LG C1 (webOS 6.5.3), stable build, on an MKV with Profile
8 RPUs, no record, trc=2 in the container and PQ in the SPS:
- before: Load dv=present:0, dynamicRange=hdr, pictureMode=hdrCinemaBright
- after: "the SPS says trc=16", "Dolby Vision P8 bl_compat=1 in the
  RPUs", "dv: reload at 323.291s with DolbyHdrInfo", Load
  dv=present:1 P8/1, dynamicRange=dolbyHdr,
  pictureMode=dolbyHdrCinemaBright; no withdrawal after the reload.
Not measured: a Profile 5 or HLG Profile 8 stream with no record, and
the 49SM9000 dev set.

Not remembered: the finding lives for the play that made it. The
server's metadata still reports no Dolby Vision for such a file, so the
detail and Home hero range chip (#1348) and the poster caption (#1412)
read HDR while the set plays Dolby Vision, and each play declares it
again with one reload.

Signed-off-by: Tiago Pereira <[email protected]>

* Playback: the RPU declaration is direct play only, with the setting frozen at the resolve

A play's RPU declaration is now one per-play state (RpuDv), set at the
resolve and kept outside the route projection: Open with the Dolby
Vision setting the resolve read, for a file with no record; Declared;
Closed after a decline, a withdrawal, or for a file with a record. A
rollback cannot re-open it, and turning Dolby Vision on mid-play no
longer declares.

Only a direct play declares: a server remux's start.mkv begins at its
offset, so the reload's seek would land wrong. A report on a transcoding
route leaves the play open. The pump also waits for an Original trial to
be confirmed, as the plain seek does. A Profile 5 declaration forbids a
video copy from then on, so a later re-encode never hands the set its
base layer undeclared.

The SPS walk refuses a log2_max_pic_order_cnt_lsb_minus4 past H.265's
limit of 12 instead of overflowing on a corrupt SPS.

Signed-off-by: Tiago Pereira <[email protected]>

* Playback: a Profile 5 source forbids a video copy on every rebuild

The copy restriction lived only on the route's contract, which an Original
recovery resets, so an audio conversion after a return to Original asked the
server for directStream=1. Read it from the file's own Dolby Vision record
as well, which the RPU declaration already adopts.

* Playback: say what the Profile 5 copy rule does for an inferred record

The file's Dolby Vision fields are set at the resolve and rewritten by the
RPU declaration, not frozen. An inferred Profile 5 refused a copy still has
no correct server route: the server has no record, so it encodes the base
layer.

* Playback: one reader for the video-copy rule

The Original remux shape, the burn check and the failed-open ladder read
the rule through is_no_video_copy, so the candidate's own Profile 5 term
goes: the candidate's record is the file's. The enhancement fixture plants
the file's record beside the candidate's, as a resolve does.

---------

Signed-off-by: Tiago Pereira <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants