Repository navigation
Media codecs crate: the bundled-FFmpeg ABI, PCM decode, speed audio and the encoder leave plx_media (P2 of the URI-first carve) - #1271
Merged
Conversation
…d_audio.rs keep the demux residual over the codec facade Work in progress, not a gate candidate: the shared-file sweep (Makefile, ci pins, module-layers, list-caps, docs) and the subtitle rewire are not done; see handoff-p2.md in the lane directory. media-codecs is byte-identical to integ. Compiles: cargo check -p plx_media --lib --tests, check --lib --no-default-features. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the contract; shared-file sweep Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at review fixes plx_media_codecs takes the bundled-FFmpeg ABI, PCM decode, speed audio, SpeedDecoder and Venc; media keeps the demux over a facade. Subtitle extraction exists once: ff_subs.rs, ff_subside.rs, player/subside.rs and ff.rs call the codecs and playback-contract items instead of carrying copies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s what is left; no P4-only re-export
- ci/check-deps.sh: the codec crate is fork-scoped like integ, not a machine (sans-io-guide's list agrees).
- media ff.rs //!: the ABI and venc moved to plx_media_codecs::{ffi, venc}; the header now describes the
demuxer that stays and points there.
- speed_audio.rs: drop the force_speed_decoder_for_test re-export no caller uses until P4.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Nov 7, 2026
Every P2 path keeps integ's version (integ is the superset: the rewired subtitle
files, play-feed's ff_pcm, the play crates in every list). Taken from main: the
comment and doc fixes integ lacked (Makefile and ffabi-assert.c point at
media-codecs/src/{ffi,speed_decoder}.rs; the quoted crate lists and the
module-layers table name media_codecs), with module-layers.md's paragraph saying
the demux is play-feed's.
Co-Authored-By: Claude Opus 5.5 <[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
Carve step P2 of the URI-first plan (v4, Part 4). Behaviour: none (one dev-trigger-only exception, below).
plx_media_codecs(rust-modules/media-codecs/, byte-identical to the integration branch): the bundledFFmpeg binding (the four
dynlib!tables,load_libraries, everyOFF_*offset table, the pinned-major fence), the PCM decodeand converter (
pcm), the speed-audio DSP andSpeedDecoder, theVencencoder, and the subtitle extraction(
subtitle: image decode;subtitle_extract: manifest,Scan, and the cancellable job half that nothing inplx_mediacallsuntil P3/P4). It names
baseandplayback_contractonly (new layer[media_codecs]inci/module-layers.ini).plx_media::ff,ff_pcmandspeed_audiobecome facades:pub use plx_media_codecs::{ffi::*, pcm::*, SpeedDecoder, Venc}.The demux, the HLS/AVIO transports, the Annex-B conversion, the IRAP/
Keyframeitems of Playback: a Dolby Vision resume or seek that lands on a CRA plays the HDR10 base layer #1263 and the DV rewrite stay inmedia/src/ff.rs(they are the Feed's, P4). 113 items leftff.rs, 18 leftff_pcm.rs, all ofspeed_audio.rs.P3+P4). Removed from media, callers pointed at the codecs / contract item:
open_sub_decoder,sub_canvas,rect_pixels,rect_to_indexed,rects_within_budget,PALETTE_BYTES,decode_bitmap(
ff_subs.rsnow maps the codec's ownedBitmapDisplayto the store'sSubRects, as integ'sbitmap_cuedoes);Scan(ff_subside.rs);WINDOW_NS,SCAN_NS,FINGERPRINT,fingerprint,Anchor,playhead_of,delta_exact,delta_assumed,pacing_parks,judged_clock,ReadCfg,RunEnd(toplx_playback_contract::subtitle);SpecandCLOCK_ONLYinplayer/subside.rs(re-exported from the contract under the old names); the header/font scan ofbegin_ass_sources(nowcollect_manifest); the host FFmpeg test fixtureHostFfmpeg/bind_host_ffmpeg.p2-sweep.md): Makefile, CI workflow,ci/check-deps.sh,ci/list-caps.ini,ci/module-layers.ini, theci/test_*.pypins,tools/build-bench.py, docs and the quotedcargo test -p ...lines name the new crate;ci/ffabi-*,tools/ffabi-dump.shand the bind-tv-lib-abi / fw-compat-reviewer prose point atmedia-codecs/src/ffi.rs.Behaviour delta (dev triggers only):
ff::boot()now returns when the libraries load with a wrong major (the ABI fence), sothe
ffprobedev-trigger probe no longer runs against offsets the build does not know. Shipped builds have no probe.SpecgainsPartialEq/Eqand aDebugthat omits the URL.Content size (non-whitespace bytes of
.rs,tr -d '[:space:]'; base 97e4388, head e839887)rust-modules/media/src)rust-modules/src)Net +11,866: the codec crate's
subtitle_extractjob half (Job,AvioInput,ReadSeek: 15,495 B for the whole file, unuseduntil P3/P4),
host_test_support(1,211 B) and the crate's public surface. Per file inplx_media:ff.rsff_pcm.rsspeed_audio.rsff_subs.rsff_subside.rsff_image_subtitle_tests.rsplayer/subside.rsStated duplicates (kept in media; each is deleted by the PR named)
SideStop+impl(media/src/ff_subside.rs)plx_playback_contract::subtitle::SideStoppublish_curl(wake)); media's registers anArc<curlio::Abort>and a raw*mut HttpStreamwhose drop order againstSideIois a use-after-free guard. Switching needs aSideIochangeSideIomoves into the caption runner)SideIo,SideDemux,open_side,seek_video,scan_keyframes,read_once,Delivery(ff_subside.rs)plx_media_codecs::subtitle_extract::{Job, AvioInput, ReadSeek}(Job::open/seek_video/scan_keyframes/next)SideIovs aReadSeektrait object); the caller isplayer/subside.rs's threadplx_play_feed::side_reader)SubTracks::open/close/decode,SubKind(ff_subs.rs)subtitle_extract::ImageDecoders,TrackInfo,DecodeKindSubTracksis owned by the main demux loop inff.rs;ImageDecodersby the jobDemuxSession)read_cb,seek_cb,AVSEEK_SIZE,stream_language(media/src/ff.rs)subtitle_extract.rsff.rsff.rsmoves toplay-feed)Not duplicates (same name only):
ff::boot(wrapscurlio::bootandplx_media_codecs::ffi::boot),Clockinass_source.rsand
ffi_host.rs,Jobinass/mailbox.rs, thegcdtest helpers.Exceptions to "byte-identical to integ" (
p2-sweep.mdhas the reasons)media/src/ff.rs,ff_pcm.rs(hand-derived);ci/ffabi-assert.c(player/vp9_hdr.rspath kept; integ's "ffi.rs's SpeedDecoder"is false, the item is in
speed_decoder.rs);.agents/agents/fw-compat-reviewer.md(path updates only);ff_subside.rs,ff_subs.rs,ff_image_subtitle_tests.rs,player/subside.rs,player/shared.rsand one decision test (main's files with thededuped items removed). Three comments in
media-codecs/**(lib.rs:1,ffi.rs:512,speed_audio.rs:6) nameplx_play_feed(P4's crate) because the crate is integ's text.
Verification
Gates ran on the committed tree (
git status --shortempty before and after):make check: exit 0 (cargo, python, rest and harness stages all ok);plx_media_codecs:test result: ok. 23 passed; 0 failed;plx_media:test result: ok. 2397 passed; 0 failed; 84 ignored;plxnative-modules:1337 passed;plx_playback_contract:40 passed. The fulltest result:list is inp2b-final.login the lane dir.make check-nodef: exit 0.bash ci/check-deps.sh: all gates green, noci/allow/line added or changed.ci/check-module-layers.py,ci/check-list-caps.py,ci/check-rust-inputs.py,ci/test_{build_bench,ci_split,no_host_staticlib, test_fast,build_not_always_dirty}.py: green.fw-compat-revieweronorigin/main...carve/p2: source-only verdict, nothing in the source changes whether the binary starts;the ELF half (fwcompat matrix,
ci/check-elf.sh, the 15 DT_NEEDED / 319 undefined-symbol baseline) is ungraded because the lanehas no ARM build: CI's firmware-load-matrix step grades it. The four
dynlib!blocks,load_librariesorder and the ABI fenceare textually unchanged; no new
#[link],extern "C"import,dlopenorbuild.rs;tools/fwcompat.py --inventoryshowsthe bundled SONAMEs collide with no firmware's own copy. Its five findings (the reviewer-prompt hunk, three
ffabi-assert.ccomments, stale
ff.rsprose, forward references in the codec crate, theboot()delta) are fixed or stated above.pr-reviewerpass on97e43889d...e83988795: four findings, fixed in 37b84ed (ci/check-deps.shkeeps the codec crate out ofMACHINESas the sans-IO guide lists it;ff.rs's header describes what stays; an unused P4-onlyspeed_audiore-export dropped;this table). After 37b84ed:
check-depsgreen,make check-nodefexit 0,plx_mediatest result: ok. 2140 passed; 0 failed(
make test-crate, no hostsim),plx_appkit934 passed; 0 failed.Build benchmark (
make build-bench --runs 3, same Mac, base then head, no load warnings)The two incremental rows were not run on the head (the full run exceeds the two-hour job limit; the P1 PR made the same cut).
Every non-incremental host leaf edit is 1-8 s slower (median): the new crate is one more unit on the path from each lower
layer to
plx_media; the cause per row is not attributed further. The unit suite run and the ARM staticlib relink are faster,within this bench's spread on those rows (base ARM max 51.8 s). ARM archive 119.5 -> 119.7 MiB. Target dirs 70.5 -> 73.9 GB.
Evidence:
bench-base-97e43889d.{txt,json},bench-p2-e83988795.{txt,json}.Related: #1064
🤖 Generated with Claude Code