edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane hevcrefuse: refuse an HEVC stream whose parameter sets do not parse
Branch lane-hevcrefuse from codecs-integration (base fbf0f85). Commit a4bc0f4.
Change
crates/engine/src/demux.rs: newDemuxer::hevc_parameter_sets_parse(). It reads the VPS/SPS/PPS blob the demuxer already keeps (hvcCfor mp4,CodecPrivatefor mkv), splits it withec_h265_syntax::split_annex_b, and parses each VPS/SPS/PPS with the matchingec-h265-syntaxparser. It isfalsewhen any of them fails, or when no SPS parses. If the container carried no sets, it reads the first access unit instead and seeks back, asfill_sei_lightdoes. Non-HEVC returnstrue. Parameter sets only, no picture decode.crates/engine/src/decode.rs:DecodeSession::open_worker(the synchronous opener behindopen,open_at,open_range) calls it right afterDemuxer::open, before a worker or decoder is chosen. A refusal returnsErr(Codec::Hevc.undecodable()), so both hardware and software are covered.
Gates
cargo test -p engine --release --test hw_decode -- --include-ignored: 13 passed, 0 failed, includingan_undecodable_hevc_stream_is_refused_by_name.cargo test -p engine --release --no-fail-fast: 875 passed, 4 failed. Failures:import_refuses_what_does_not_match,a_project_naming_many_tracks_of_one_file_walks_it_once_and_keeps_its_order: on the allowed list.an_mp4_copy_of_an_anamorphic_source_refuses_in_words(anamorphic) andthe_software_seat_decodes_and_seeks_vp8(vp8): not on the allowed list. Both fail in isolation, and both also fail on the baseline (fbf0f85) with my change stashed, so they are not caused by this lane. They reproduce only whenlibengine_hw.sois present next to the test binary (see below).
- Clippy (
cargo clippy -p engine --all-targets): no warnings on the lines touched. The only hit indecode.rsis the pre-existinghw_decodes(&PathBuf)at line 3015.
Environment notes
- The hw_decode tests need
libengine_hw.sobeside the test binary. That lookup iscurrent_exe().parent()and then the bare name. I built-p engine-hw --releaseand copied the library to~/.cache/tgt-edith-hevcrefuse/release/and.../release/deps/. I also builthw-encode-child(-p engine --bin hw-encode-child). Without them, all 8 hw tests fail with "no hardware decode plugin/driver available". assetsis a symlink to/home/user/Documents/Code/Rust/edith/assetsin the worktree and is not committed.
Not done
open_worker_deferred(the no-sync-error opener) is not checked. Its refusal would be a dropped sender, not anErr, and the task only asked for the synchronous open path.