Repository navigation
Lower-layer prerequisites of the neutral media crate: plx_net::range_io, plx_base::clock, LoadVideo in platform, contract landing plan - #1272
Merged
Conversation
…e_io in net, clock in base, LoadVideo in platform) Moves the HTTP range transport out of media into plx_net::range_io (generic over a UrlAuthorizer; media/src/curlio.rs becomes the Plex credential facade, so main's crate::curlio::* callers are unchanged), adds plx_base::clock, moves LoadVideo into plx_platform::devcaps (engine.rs re-exports it), and adds MediaPart.duration / PlayingItem.duration_ms. Behaviour: none except one hardening hunk in range_io: a seek or reopen asks the URL authorizer again before the request (a revoked credential grant no longer rides on the source's first open). Pinned by net::range_io::tests::a_reopen_rechecks_the_caller_authority_before_the_next_request. Deferred to P3+P4/P5 (see p2b-map.md): the VideoSink/DisplaySink split and tv::plane (they need the Starfish/ACB seam), telemetry backend/terminal-stage fields and the consent-preview rows (a wire change), Force's transcoder profile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l stop_begin and ServerStopped (additive) The contract crate merged with P1 predates #1263 (DV landing guard) and #1265 (honor Plex server stops), which integ re-expressed in the contract: DvLandingMode/DvLandingPlan/DvWithdrawal, OpenRequest.dv_landing, FeedLoad::dv_landing_due, FeedCommand::DvStandDown, FeedControl::stop_begin(terminal), RuntimeFailure::ServerStopped, and the FakeFeed that scripts them. Nothing on main implements or matches these yet (the contract is unwired), so main's behaviour is unchanged; the neutral media crate (P3) reads them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ut it
The seek/reopen authorizer recheck in plx_net::range_io was carried by integ with a reopen test only, and that test passes
without the recheck (reopen_until already asks). This one revokes the grant after the first open and expects the seek to be
refused with no request sent; it panics ("a revoked grant refuses the seek") with the recheck removed and passes with it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t's crate doc names range_io The first make check failed in its hostsim pass: rust-modules/src/app/run.rs:4967 builds a PlayingItem inside a hostsim-only test, so the default-feature check could not see the missing duration_ms. fw-compat review (MINOR): net/src/lib.rs's crate doc still called the module curlio, but it is mounted as range_io. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…instead of serving stale bytes The seek/reopen authority recheck returned before the attempt-state reset, and seek's error arm only detached the handle. After a refused seek the next read returned the pre-seek bytes still buffered, then a clean end of stream (0) instead of -1. retire_attempt (detach, drop the buffered body, clear done/failed/readable) now runs on every early return of a start: the refused recheck and a multi handle that cannot be rebuilt. The seek test asserts the read after a refused seek is negative and that the next granted seek recovers. Also: two forward references named things that arrive later (devcaps' SHARED.dg_load_v, clock's reader list). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…inters, curlio's place in media's cycle, forward references doc-claim-auditor on 279b66d...HEAD, contradictions only: shared-servers.md and the engine/ff.rs pointers named media's curlio.rs for the dynlib! table and the abort-registry rationale (both now in plx_net::range_io); media's crate doc kept curlio in the call cycle it left; RangeReader/AuthorizingRangeFactory named a feed worker and demux job this tree does not have; feed.rs named plx_play_feed::dv_start and a Feed that builds the guard (the guard is media::player::dv_start); clock's doc named a Feed layer; plus the net::origin::ResolvePin path, the range_io::tests name, a data-test comment and media's Cargo.toml comment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Nov 7, 2026
Every P2b path keeps integ's version except net/src/curlio.rs, which takes main's: the seek authority recheck test and retire_attempt (a start that returns early resets the attempt, so a read after a refused seek fails), plus its doc fixes. The two test literals main gave duration_ms already carry it here. The doc and comment fixes of P2b's audit that integ lacked come in with the merge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PilaScat
added a commit
to PilaScat/plx-native
that referenced
this pull request
Nov 7, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The neutral
plx_mediathat follows reads a handful of things that belong below it. This PR lands them onmainfirst, so the media PR ismedia-only. It is a move plus additive items; nothing on
mainselects a different path.plx_net::range_io(net/src/curlio.rs): the HTTPS byte-range transport leavesmedia/src/curlio.rs. It is generic over aUrlAuthorizer(the caller's credential policy, asked on every open, reopen, seek and redirect hop) and offersRangeReader/RangeFactoryso a lower layer can own a source without naming Plex.media/src/curlio.rsshrinks to the Plex credential facade(
PlexAuthorization,type CurlSource = range_io::CurlSource<PlexAuthorization>,range_factory(),first_read), so everycrate::curlio::*caller onmaincompiles unchanged. Thecurl_multi_*dynlib!table moves with it, symbols and candidate list as before.plx_base::clock(vclock_ms,vclock_us): a monotonic clock for stamps that are only differenced.player::vclock_msdelegates to it.plx_platform::devcaps::LoadVideo: the codec one Load declares, with the codec table's row lookup and refusal rule.engine::LoadVideoisnow a re-export;
decoder_rowandload_video_refuseddelegate to it. The existing engine tests pin the values.MediaPart.duration(plex) andPlayingItem.duration_ms(data): additive, nothing onmainreads them yet; one new test.DvLandingMode,DvLandingPlan,DvWithdrawal,OpenRequest.dv_landing,FeedLoad::dv_landing_due,FeedCommand::DvStandDown),FeedControl::stop_begin(terminal)andRuntimeFailure::ServerStopped, with theFakeFeedthat scripts them. The contract that merged with the first carve PR predates Playback: a Dolby Vision resume or seek that lands on a CRA plays the HDR10 base layer #1263 and Playback: stop when the server ends the session #1265, which the integration branchre-expressed in it; the contract is unwired on
main, so this is additive.first_read.agent-reference.md(5 sites), thedynlib!note inmodule-layers.md,plex/.../CLAUDE.md,the fw-compat reviewer's scope table, intra-doc links in
net,ci/module-layers.ini(base+=clock,net+=range_io),ci/list-caps.ini(two sections renamed to the new path).API for the next PR, with no reader on
mainyet:media::curlio::{CREDENTIAL_GATE, range_factory},RangeFactory/RangeReader/AuthorizingRangeFactory,LoadVideo::from_diag_codeandplx_base::clock::vclock_us.Left for the media PR (and why)
The platform video-sink split (
DisplaySink,tv::plane,webos::video_sink, thefeed-sinkanduri-transportfeatures) needs theStarfish/ACB seam and the port wiring in the same commit; the telemetry
backend/terminal_stagefields and consent-preview rows are awire change that only means something once the media PR fills them (and
PRIVACY.mdmust move with them); Force's transcoder profile isa behaviour change tied to the route planner. With those added from the integration branch,
cargo check -p plx_media --lib --no-default-featureson integ'smedia/has zero errors (probe inp2b-sweep.md).Behaviour
Unchanged for playback and for every request on the wire. The one change to the moved transport is a tightening of its contract with
no production effect on
maintoday:range_ioasks the URL authorizer again at the top of a request started by a seek or reopen, not only at open and at each redirecthop, so a caller whose grant changes after a source opened gets the next seek refused before anything is sent. Nothing on
maincanchange a grant mid-stream: the curl sources are https, a TLS origin is always allowed, and
CredentialPolicy::build()is fixed at buildtime. Pinned by
net::range_io::tests::a_seek_rechecks_the_caller_authority_before_the_next_request, which panics(
a revoked grant refuses the seek) with the recheck removed and passes with it, and bya_reopen_rechecks_the_caller_authority_before_the_next_request(reopen already asked; kept from the integration branch).
bytes still buffered and then a clean end of stream (0), not an error (-1).
retire_attemptnow clears the transfer state on everyearly return of a start (the refused recheck, and a multi handle that cannot be rebuilt), so a read after a refused seek fails and a later
seek recovers; the same test asserts both, and failed (
a read after a refused seek is an error, not bytes or EOF) before the fix.Log lines are unchanged (
crate::player::logisplx_base::eventlog::log; thecurlio: bound ... (7 symbols)line is emitted by the same code).Content size (non-whitespace characters,
origin/main-> branch)rust-modules/src;run.rsis a test literal,tls_selftest.rsthe facade consumer).agentsmedia/src/curlio.rs135,827 -> 6,719;net/src/curlio.rs0 -> 139,727 (the net share includes the transport's moved tests); the rest of thenet delta is the fd-slack test and doc links. The move is mechanical apart from the generic parameter and the recheck above
(
git diff --no-indexof the old file against the new one: 115 hunks, imports,crate::player::log->plx_base::eventlog::log,CurlSource<A>).Verification
make check(all 126 steps, cargo stage incl. the hostsim pass; everytest result:ok, 0 failed),make check-nodef,the
ci/test_*.pypins,ci/check-module-layers.py,ci/check-list-caps.py,bash ci/check-deps.sh, and thefw-compat-revieweragent on
origin/main...carve/p2b(adynlib!table moved crates): no blocker; the table, its candidate list and its oneOnceareunchanged; the ELF half is CI's.
pr-reviewerpass: five minor findings, fixed in 1c9bb28 (the refused-seek bug above, two forward references) and in this text;then the
doc-claim-auditoragent, ten stale sentences fixed in a2dcf13.plx_nettest result: ok. 265 passed; 0 failed,plx_mediatest result: ok. 2094 passed; 0 failed; 84 ignored,make check-nodefexit 0,check-depsgreen. CI runs the full gate.Build benchmark (
make build-bench --runs 3, same Mac, base then head)Within noise apart from the ARM relink median (+13.8 s), whose spread is the same on both sides (base 20.1-47.9 s, head 18.2-48.4 s).
The two incremental rows were not run (the full run exceeds the two-hour job limit; P1 and P2 made the same cut). One load warning per
run (a single repetition above 10 cores). ARM archive 119.7 -> 119.6 MiB.
Related: #1064
🤖 Generated with Claude Code