1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! Constant drift guard (WP4, section 1).
//!
//! This crate re-declares constants that other workspace crates already
//! validate against real fixtures. The guard pins those copies so a future
//! edit cannot silently diverge — if an upstream constant ever changes, the
//! assertion here fails loudly and this crate's own copy must be re-reviewed.
//!
//! **This file guards ONE direction only: that upstream still declares what we
//! were written against.** The prober constants are private (by design — prober
//! internals are not public API), so an integration test can only compare an
//! upstream constant against a literal. That cannot catch this crate's own copy
//! drifting, which is the direction that matters more.
//!
//! The other direction lives in a `#[cfg(test)] mod drift` inside each prober
//! module (`src/ts.rs`, `src/mpegps.rs`, `src/mxf.rs`), where the private
//! constant is visible and is compared to the upstream one directly. Verified
//! necessary: editing `ts.rs`'s `TS_SYNC_BYTE` to `0x48` leaves every test in
//! THIS file green while `ts::drift::sync_byte_matches_mpeg_ts` turns red.
//!
//! Neither direction substitutes for the other; both are required.
/// Upstream `mpeg-ts` still declares the values this crate's TS prober was
/// written against.
///
/// **This asserts upstream against a literal, so it catches `mpeg-ts` changing
/// but NOT this crate's own copy drifting** — an integration test cannot see
/// `container-probe/src/ts.rs`'s private constants. The guard for that
/// direction is the `ts::drift` unit-test module inside `src/ts.rs`, which
/// compares the real constants to each other.
///
/// Both directions are needed and neither substitutes for the other: verified
/// by editing `TS_SYNC_BYTE` to `0x48`, which leaves this test green and turns
/// `ts::drift::sync_byte_matches_mpeg_ts` red.
/// The MPEG-PS `pack_start_code` (`0x000001BA`), our copy at
/// `container-probe/src/mpegps.rs` (`const PACK_START_CODE: [u8; 4] =
/// [0x00, 0x00, 0x01, 0xBA];`).
///
/// `mpeg-ps` keeps its own `PACK_START_CODE` in a **private** module
/// (`pack_header`, `mpeg-ps/src/pack_header.rs:12` — `pub const PACK_START_CODE:
/// u32 = 0x0000_01BA;`) and does not re-export it, so it cannot be referenced
/// from here. The nearest public constant is the 3-byte
/// `packet_start_code_prefix` that opens every pack/system/PSM start code
/// (`00 00 01`), exported as `mpeg_ps::PACKET_START_CODE_PREFIX`; the `BA`
/// suffix turning it into the pack start code is pinned by the citation above.
/// That is the best indirect guard available without a `pub(crate)` widening.
/// The MXF partition-pack key prefix (`06 0E 2B 34 02 05 01`), our copy at
/// `container-probe/src/mxf.rs` (`const MXF_KEY_PREFIX`).
///
/// `st377-1`'s own `PARTITION_KEY_PREFIX` (its `src/partition.rs`) is private,
/// so there is no exact public constant to compare against. The nearest public
/// equivalent is the SMPTE Universal-Label organisation header that every MXF
/// KLV key shares — `06 0E 2B 34` — which is the first four bytes of both
/// `st377_1::op1a::OP1A_UL_PREFIX` and `st377_1::klv::FILL_ITEM_KEY_PREFIX`
/// (and of this crate's `MXF_KEY_PREFIX`). Asserting that shared prefix pins
/// the header against `st377-1` without a `pub(crate)` widening.