Skip to main content

oxideav_core/
lib.rs

1//! Core types and registries for the oxideav framework.
2//!
3//! This crate is the dependency-light foundation: primitive types
4//! (timestamps, packets, frames, media formats) plus the registries
5//! every sibling crate registers itself into. The aggregate
6//! [`RuntimeContext`] bundles all four registries (codec / container /
7//! source / filter) into a single value that consumers pass around.
8//!
9//! # Resolution order
10//!
11//! Every registry lookup that can have several candidates ranks them by
12//! one rule, so the winner depends only on the registered claims and
13//! the input — never on hash-map iteration order:
14//!
15//! 1. **evidence, descending** — probe score
16//!    ([`ContainerRegistry::probe_input`]), probe confidence
17//!    ([`CodecRegistry::resolve_tag_ref`]; unprobed claims count as
18//!    `1.0`), or matched prefix length
19//!    ([`CodecRegistry::resolve_payload_magic_ref`]);
20//! 2. **resolution priority, ascending** — lower is preferred, default
21//!    [`DEFAULT_PRIORITY`]; set with
22//!    [`ContainerRegistry::register_probe_with_priority`],
23//!    [`ContainerRegistry::register_extension_with_priority`] or
24//!    [`CodecInfo::with_resolution_priority`];
25//! 3. **registration order** — earlier wins (extension hints keep their
26//!    historical most-recent-wins contract at equal priority).
27//!
28//! The ranked lists are observable via
29//! [`ContainerRegistry::probe_candidates`],
30//! [`ContainerRegistry::extension_candidates`],
31//! [`CodecRegistry::resolve_tag_candidates`] and
32//! [`CodecRegistry::resolve_payload_magic_candidates`].
33
34#![warn(missing_docs)]
35
36pub mod arena;
37pub mod bits;
38pub mod capabilities;
39pub mod engine;
40pub mod error;
41pub mod execution;
42pub mod filter;
43pub mod format;
44pub mod frame;
45pub mod layer;
46pub mod limits;
47pub mod metadata;
48pub mod options;
49pub mod packet;
50pub mod picture;
51pub mod rational;
52pub mod registry;
53pub mod signal;
54pub mod stream;
55pub mod subtitle;
56pub mod time;
57pub mod vector;
58
59pub use capabilities::{CodecCapabilities, DEFAULT_PRIORITY};
60pub use engine::{EngineProbeFn, HwCodecCaps, HwDeviceInfo};
61pub use error::{Error, Result};
62pub use execution::ExecutionContext;
63pub use filter::{FilterContext, PortParams, PortSpec, StreamFilter};
64pub use format::{
65    ChannelLayout, ChannelPosition, MediaType, ParseChannelLayoutError, PixelFormat, SampleFormat,
66};
67pub use frame::{AudioFrame, Frame, VideoFrame, VideoPlane};
68pub use layer::{LayerIdentity, LayerInfo};
69pub use limits::DecoderLimits;
70pub use metadata::{Attachment, Chapter};
71pub use options::{
72    parse_options, CodecOptions, CodecOptionsStruct, OptionField, OptionKind, OptionValue,
73};
74pub use packet::Packet;
75pub use picture::{AttachedPicture, PictureType};
76pub use rational::Rational;
77pub use registry::{
78    BytesSource, CodecImplementation, CodecInfo, CodecRegistry, ContainerProbeFn,
79    ContainerRegistry, Decoder, DecoderFactory, Demuxer, Encoder, EncoderFactory,
80    ExtensionCandidate, FilterFactory, FilterRegistry, FrameSource, MultiTitleSource, Muxer,
81    OpenBytesFn, OpenDemuxerFn, OpenFramesFn, OpenMultiTitleFn, OpenMuxerFn, OpenPacketsFn,
82    PacketSource, PayloadMagicCandidate, ProbeCandidate, ProbeData, ProbeScore, ReadSeek,
83    RuntimeContext, SourceOutput, SourceRegistry, TagCandidate, WriteSeek, MAX_PROBE_SCORE,
84    PROBE_SCORE_EXTENSION,
85};
86pub use signal::{
87    ColorPrimaries, ColorRange, ColorSignal, MatrixCoefficients, TransferCharacteristics,
88};
89pub use stream::{
90    CodecId, CodecParameters, CodecResolver, CodecTag, Confidence, NullCodecResolver, ProbeContext,
91    ProbeFn, StreamInfo,
92};
93pub use subtitle::{CuePosition, Segment, SubtitleCue, SubtitleStyle, TextAlign};
94pub use time::{rescale, rescale_checked, rescale_rnd, Rounding, TimeBase, Timestamp};
95pub use vector::{
96    DashPattern, FillRule, GradientStop, Group, ImageRef, LineCap, LineJoin, LinearGradient,
97    MaskKind, Node, Paint, Path, PathCommand, PathNode, Point, RadialGradient, Rect, Rgba,
98    SpreadMethod, Stroke, Transform2D, VectorFrame, ViewBox,
99};