From d8c174c5da204a0a0c9c4fe4bb9739d5b22162ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 14 Aug 2026 19:34:52 +0300 Subject: [PATCH] shim(oxideav-core): drop the arms only the vendored H.265 tree needed The replica's software HEVC seat is the family's own intra encoder now, named as a path dependency rather than reached through this shim, so the surface it alone consumed is dead: the registration context and the `register!` macro, the `Encoder` trait with its factory and the two `CodecInfo` builders that carried them, the container-level codec tags, the pixel format and the string-keyed codec options. What the subtitle, AC-3 and Ogg shims speak is untouched: the registry, the `Decoder` trait, `CodecInfo::decoder`, the frames, the packets and the muxer. An item nobody calls is an item nobody can check, which is what this file's own header says it will not carry. --- shims/oxideav-core/src/lib.rs | 135 ---------------------------------- 1 file changed, 135 deletions(-) diff --git a/shims/oxideav-core/src/lib.rs b/shims/oxideav-core/src/lib.rs index e96c4537..7d19df55 100644 --- a/shims/oxideav-core/src/lib.rs +++ b/shims/oxideav-core/src/lib.rs @@ -145,60 +145,6 @@ impl From for CodecId { } } -/// How a codec is named by a container, so a demuxer can map what it read to a -/// registration. -#[derive(Clone, Debug, PartialEq, Eq, Hash)] -pub enum CodecTag { - /// A four-character code, as mp4 sample entries and RIFF write it. - FourCc([u8; 4]), - /// An MPEG-4 `ObjectTypeIndication`. - Mp4ObjectType(u8), - /// A Matroska `CodecID` string. - Matroska(String), -} - -impl CodecTag { - /// The four-character code `code`. - pub fn fourcc(code: &[u8; 4]) -> CodecTag { - CodecTag::FourCc(*code) - } - - /// The MPEG-4 object type `oti`. - pub fn mp4_object_type(oti: u8) -> CodecTag { - CodecTag::Mp4ObjectType(oti) - } - - /// The Matroska `CodecID` `id`. - pub fn matroska(id: impl Into) -> CodecTag { - CodecTag::Matroska(id.into()) - } -} - -/// How samples are laid out in a video frame. Only the format the family's own -/// encoders take and hand out is named; a caller that needs another adds it. -#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] -pub enum PixelFormat { - /// Planar 4:2:0 8-bit. - #[default] - Yuv420P, -} - -/// A codec's string-keyed knobs, parsed by whichever codec declares them. -#[derive(Clone, Debug, Default, PartialEq, Eq)] -pub struct CodecOptions(HashMap); - -impl CodecOptions { - /// The value set for `key`, if any. - pub fn get(&self, key: &str) -> Option<&str> { - self.0.get(key).map(String::as_str) - } - - /// Set `key` to `value`, replacing what was there. - pub fn set(&mut self, key: impl Into, value: impl Into) { - self.0.insert(key.into(), value.into()); - } -} - /// What kind of stream a set of parameters describes. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum MediaType { @@ -230,12 +176,8 @@ pub struct CodecParameters { pub width: Option, /// Coded height. pub height: Option, - /// How a video stream's samples are laid out. - pub pixel_format: Option, /// Codec setup bytes. pub extradata: Vec, - /// Codec-specific knobs, read by whichever codec declares them. - pub options: CodecOptions, } impl CodecParameters { @@ -379,26 +321,6 @@ pub trait Decoder: Send { } } -/// An encoder: frames in, packets out. -pub trait Encoder: Send { - /// The codec this produces. - fn codec_id(&self) -> &CodecId; - - /// Parameters describing the stream it produces, for the muxer. - fn output_params(&self) -> &CodecParameters; - - /// Feed one uncompressed frame. - fn send_frame(&mut self, frame: &Frame) -> Result<()>; - - /// Take one packet, or [`Error::NeedMore`] when the encoder wants another - /// frame first. - fn receive_packet(&mut self) -> Result; - - /// Signal end of input, so the lookahead drains into - /// [`receive_packet`](Encoder::receive_packet). - fn flush(&mut self) -> Result<()>; -} - /// A container writer. pub trait Muxer: Send { /// The format's short name. @@ -417,9 +339,6 @@ pub trait Muxer: Send { /// How a codec crate hands out decoders. pub type DecoderFactory = fn(&CodecParameters) -> Result>; -/// How a codec crate hands out encoders. -pub type EncoderFactory = fn(&CodecParameters) -> Result>; - /// One codec's registration. #[derive(Clone)] pub struct CodecInfo { @@ -427,10 +346,6 @@ pub struct CodecInfo { pub id: CodecId, /// How to build a decoder for it. pub decoder_factory: Option, - /// How to build an encoder for it. - pub encoder_factory: Option, - /// The container-level names that mean this codec. - pub tags: Vec, } impl CodecInfo { @@ -439,8 +354,6 @@ impl CodecInfo { CodecInfo { id, decoder_factory: None, - encoder_factory: None, - tags: Vec::new(), } } @@ -449,18 +362,6 @@ impl CodecInfo { self.decoder_factory = Some(factory); self } - - /// The same registration, with an encoder. - pub fn encoder(mut self, factory: EncoderFactory) -> CodecInfo { - self.encoder_factory = Some(factory); - self - } - - /// The same registration, claiming `tags` on top of whatever it claimed. - pub fn tags(mut self, tags: impl IntoIterator) -> CodecInfo { - self.tags.extend(tags); - self - } } /// The codecs a caller has registered, in registration order per id. @@ -501,42 +402,6 @@ impl CodecRegistry { } } -/// What a codec crate is handed to register itself into. -/// -/// The incumbent's context carries four sub-registries; this one carries the -/// codecs, because a container, source or filter crate registering into the -/// replica's build does not exist. -#[derive(Clone, Default)] -pub struct RuntimeContext { - /// Decoder and encoder factories, by codec id. - pub codecs: CodecRegistry, -} - -impl RuntimeContext { - /// An empty context. - pub fn new() -> RuntimeContext { - RuntimeContext::default() - } -} - -/// Declare a codec crate's registration entry point, as the family's crates -/// spell it: `oxideav_core::register!("h265", register);`. -/// -/// The name is carried for documentation only, exactly as the incumbent does — -/// what the generated `__oxideav_entry` runs is `$func`. -#[macro_export] -macro_rules! register { - ($name:literal, $func:path) => { - /// This crate's registration entry point, generated by - /// [`oxideav_core::register!`]. - #[doc(hidden)] - pub fn __oxideav_entry(ctx: &mut $crate::RuntimeContext) { - let _ = $name; - $func(ctx); - } - }; -} - /// A [`Decoder`] over one of the family's own, converting the frames on the way /// out. Codec shims are two lines with this: build the `ec_core` decoder, wrap. pub struct EcDecoder {