Files
c31fc02ab9 craft-media: MXF writer identification and metadata budget; ports of FilmCraft container PRs (#1794, #4100, #4497, #2303) (#989)
* craft-media: MXF identification on every writer entry point, and a total metadata budget

write_opatom_pcm_as takes the company, product and version that WriterConfig
already has, and the product UID is derived from the product name, so an app
that names itself writes the bytes it wrote before the move.

Everything read while opening shares a 256 MiB budget: a file made of metadata
sets, each under the 64 MiB value limit, is refused instead of read whole.

* craft-media-testkit: hostile-input hammer

Truncations, bit flips, extreme-value overwrites in both byte orders and
deletions of a valid input, each run under catch_unwind with a time budget.
CRAFT_MEDIA_HOSTILE_MULT multiplies the iterations for soak runs.

Ported from storytold/filmcraft#1794 (filmcraft-testkit's hostile module).

* craft-media: MXF hostile-input hammer

The hammer over three synthetic OP1a files and over an index segment, a primer
pack and a metadata set parsed directly, and the regression test for
sync_before on a track without samples (the fix is already in the module).

Ported from storytold/filmcraft#1794 (crates/mxf/src/tests/hostile.rs).

* craft-media: MXF picture descriptors give the H.273 code points of their colour labels

PictureInfo::color_codes maps the colour primaries, transfer characteristic
and coding equations labels the writer uses (Rec. 709, BT.2020, PQ, HLG) to
their code points, whatever the label's registry version byte.

Ported from storytold/filmcraft#4100 (the crates/mxf part).

* craft-media: MXF writer describes interlaced pictures, and the reader gives the field dominance

PictureDesc::interlaced writes the SeparateFields frame layout with a field's
stored and sampled height, the 1080i video line map and the field dominance
(bottom_field_first: 2). PictureInfo::field_dominance reads it back.

Ported from storytold/filmcraft#4497 (the crates/mxf part).

* craft-media: AVI hostile-input hammer

The hammer over the four synthetic layouts (idx1 relative and absolute, rec
lists, no index, OpenDML), opened with and without the OpenDML index.

Ported from storytold/filmcraft#1794 (crates/avi/src/tests/hostile.rs).

* craft-media: AVI says how an H.264 or HEVC stream frames its NAL units

The bytes after a video stream's format header are nothing, Annex B parameter
sets (ffmpeg with global headers) or an avcC / hvcC record (a stream copied
from MP4, with length-prefixed chunks). Stream::nal_framing tells them apart
and gives the length-prefix size, so a caller hands the decoder the header's
parameter sets and turns length prefixes into start codes. codec_params said
the bytes were never a record.

Ported from storytold/filmcraft#2303 (the container part of NalSetup in
filmcraft-codecs; the decoder wiring stays in the app).

* craft-media: MPEG-TS / PS hostile-input hammer

The hammer over transport streams (188- and 192-byte packets, six stream
types), program streams (MPEG-2 and MPEG-1 packs, private stream 1) and the
frame-header helpers for every codec. Fewer rounds than in FilmCraft, where
tests build with optimisation.

Ported from storytold/filmcraft#1794 (crates/mpegts/src/tests/hostile.rs).

---------

Co-authored-by: Logan Jennings <loganwjennings@gmail.com>
Co-authored-by: JonRC <jonarc06@gmail.com>
Co-authored-by: Michael de Meyer <249562202+oblivion8282-1337@users.noreply.github.com>
Co-authored-by: tylerjenningsw <tylerjennings2@outlook.com>
2026-11-11 19:46:48 -05:00
..