oxideav-core
Core types for the oxideav pure-Rust media framework:
Packet— one compressed chunk belonging to one stream, with timestamps. Chainablewith_*builders cover everyPacketFlagsfield (with_keyframe/with_header/with_corrupt/with_discard/with_unit_boundary, plus a bulkwith_flags) and the stream-index / time-base / pts / dts / duration setters used by demuxers and remuxers. Anend_pts()accessor returns the overflow-checkedpts + durationfor muxers that need a per- packet end timestamp.Frame— one uncompressed audio / video / subtitle chunk.StreamInfo/CodecParameters— what a demuxer advertises and what a decoder / encoder consumes.TimeBase/Timestamp/Rational— rational time per stream; timestamps are integers in that base. Named constants (MILLIS/MICROS/NANOS/MPEG_TS/AUDIO_48K/AUDIO_44K1/AUDIO_8K/SECONDS) replace the workspace'sTimeBase::new(1, …)magic-numbers;TimeBase::from_rate(u32)constructs the inverse-of-rate form, andticks_of(seconds: f64)is the overflow-clamped inverse of the existingseconds_of(ticks).Timestamp::from_seconds/checked_add_ticks/checked_sub_ticks/checked_diffcover per-stream timestamp arithmetic (including cross-base differences for remux pipelines).Rationalsupports exact+ - * /and unary-(results reduced viai128intermediates), pluscmp_value/equals_valuefor value comparison (30000/1001vs30/1) that doesn't disturb the structuralEq/Hashcallers rely on to preserve the on-wire fraction.PixelFormat/SampleFormat— enum of supported raw formats (40+ pixel variants including 8/10/12-bit YUV, 10/12/14-bit planar GBR(A), packed RGB/RGBA, NV12/NV21, all common sample layouts).AttachedPicture/PictureType— ID3v2APICtaxonomy shared by ID3v2 / FLAC / MP4 / Vorbis cover-art carriage.PictureTyperound-trips byte-for-byte throughfrom_u8↔to_u8over the spec- assigned0x00..=0x14range; unassigned bytes collapse toUnknown, flagged viais_known()so strict writers can refuse to emit the0xFFsentinel.AttachedPicture::new(mime, kind)plus chainablewith_description/with_data/with_picture_typebuilders cover the producer side (parsers writing into a partially-decoded picture as bytes arrive), andis_external_link()distinguishes ID3v2's"-->"URL-sentinel mime from inline image bytes without having to hardcode the string at every call site.CodecTag/CodecResolver— neutral abstraction for mapping container-level tags (AVI FourCC, WAVEFORMATEXwFormatTag, MP4 OTI, Matroska CodecID strings) to oxideavCodecIds. Lets codec crates own their own tag claims without pulling a codec registry into every container.bits— shared MSB-first / LSB-firstBitReader/BitWriterplus unary helpers. Used by the FLAC, AAC, H.264, HEVC, Vorbis and a dozen other codecs in the workspace.SourceRegistry— URI scheme dispatch for sources. Drivers register as one of three shapes —BytesSource(file / http),PacketSource(transport-layer protocols that pre-demux), orFrameSource(synthetic generators that emit decoded frames) — andopen(uri)returns aSourceOutputenum the pipeline executor branches on.Error— one unified error enum used across the ecosystem.
Zero C dependencies. Zero FFI. Zero *-sys crates.
Usage
[]
= "0.1"
Everything downstream in oxideav (codec traits, container traits, codec
implementations, the CLI) depends on this crate transitively, so the
surface is kept deliberately small. The 0.1 series is the first stable
semver line — additive changes are 0.1.x patch bumps; breaking
reshapes go to 0.2.0.
License
MIT — see LICENSE.