diff --git a/Cargo.lock b/Cargo.lock index f0832419..1b07078a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1143,6 +1143,13 @@ version = "0.8.53" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" +[[package]] +name = "ruopus" +version = "0.1.2" +dependencies = [ + "ec-opus", +] + [[package]] name = "rustversion" version = "1.0.23" diff --git a/shims/ruopus/Cargo.toml b/shims/ruopus/Cargo.toml new file mode 100644 index 00000000..a43aee23 --- /dev/null +++ b/shims/ruopus/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "ruopus" +description = "Compatibility shim: the ruopus 0.1.2 surface edith consumes, served by ec-opus." +version = "0.1.2" +edition.workspace = true +license.workspace = true +authors.workspace = true +publish = false + +[dependencies] +ec-opus = { path = "../../crates/ec-opus", version = "0.1.0" } + +# The incumbent's feature names, all no-ops here. A `[patch.crates-io]` consumer +# that names a feature the patch lacks fails to *resolve*, so the swap needs +# them declared even though nothing behind them is optional in this crate: +# `spectrograms` bought the incumbent an FFT-backed MDCT (fifteen crates), and +# `ec-opus` has that path unconditionally through `ec-dsp`. +[features] +default = ["std", "spectrograms"] +std = [] +spectrograms = ["std"] +libm = [] diff --git a/shims/ruopus/src/lib.rs b/shims/ruopus/src/lib.rs new file mode 100644 index 00000000..faffbbb3 --- /dev/null +++ b/shims/ruopus/src/lib.rs @@ -0,0 +1,31 @@ +//! `ruopus` as edith consumes it, over [`ec_opus`]. +//! +//! A shim, not a port: it carries the incumbent's package name and version so +//! the swap is a `[patch.crates-io]` line, and it exposes exactly the one item +//! the replica names — [`MultistreamDecoder`], built with `with_rate` and fed +//! one packet at a time with `decode_packet` (`audio.rs:1575`, `1694`; +//! `export.rs:1950`, the fidelity gate's own decoder). +//! +//! A re-export is the whole adapter, and that is a claim about two things +//! rather than about the names: +//! +//! * **Layout arguments.** `with_rate(rate, streams, coupled, &mapping)` means +//! the same thing in both: the first `coupled` elementary streams are stereo, +//! `mapping[c]` names the decoded channel output channel `c` reads (255 = +//! silent), and an impossible layout panics rather than returning — which is +//! why the replica checks the `OpusHead` it read from a file before it gets +//! here (`audio.rs:opus_layout`). +//! * **Channel order.** Both decoders emit the *mapping's* order, which for RFC +//! 7845 family 1 is Vorbis order (FL, FC, FR, BL, BR, LFE for 5.1) and not +//! the product's FL/FR/FC/LFE/BL/BR. The permutation stays where the +//! incumbent's behaviour already put it, at the call site +//! (`audio.rs:vorbis_to_film_order`); a shim that permuted here would fold +//! surround twice. +//! +//! Errors differ in type and not in use: `ec_core::Error` where the incumbent +//! had `PacketError`, both `Display` and both consumed as `{e}` or as a +//! refused packet. + +#![forbid(unsafe_code)] + +pub use ec_opus::MultistreamDecoder;