oxideav-core 0.1.24

Core types and registries for oxideav — timestamps, packets, frames, codec/container/source/filter registries (pure Rust, no C deps)
Documentation
//! Sibling registration entry-point macro.
//!
//! Each sibling crate that ships a codec / container / filter / source
//! invokes [`crate::register!`] at module scope to declare its
//! `register(ctx)` function as the canonical entry point. The
//! [`oxideav-meta`](https://crates.io/crates/oxideav-meta) crate's
//! build script enumerates the enabled sibling deps in its Cargo.toml
//! and emits a `register_all(ctx)` body that calls the macro-generated
//! entry point of each.
//!
//! The macro is the dispatch contract between sibling and meta. Today
//! it expands to a thin `pub fn __oxideav_entry(ctx)` wrapper around
//! the user-supplied register fn. The macro body is the only place
//! that needs to change if the dispatch transport switches in the
//! future (e.g. add a metadata arg, defer init, async-init, audit
//! hook) — sibling call sites stay untouched.
//!
//! # Standalone opt-out
//!
//! Each sibling's `register!()` call lives behind that crate's
//! default-on `registry` cargo feature. Consumers that want the
//! standalone (no-`oxideav-core`-dep) build path turn the feature off
//! and the macro call disappears.

/// Declare the canonical sibling entry point.
///
/// Place at module scope inside the sibling crate, gated behind the
/// crate's `registry` cargo feature so the standalone build path
/// stays decoupled from `oxideav-core`:
///
/// ```ignore
/// pub fn register(ctx: &mut oxideav_core::RuntimeContext) {
///     /* install factories */
/// }
///
/// #[cfg(feature = "registry")]
/// oxideav_core::register!("aac", register);
/// ```
///
/// The macro expands to a `pub fn __oxideav_entry(ctx)` wrapper that
/// invokes the supplied function. `oxideav-meta`'s `register_all`
/// calls `crate::__oxideav_entry(ctx)` for each enabled sibling dep.
///
/// The display-name argument (first literal) is reserved for future
/// dispatch-transport changes; it is currently ignored by the
/// expansion but kept in the macro signature for forward
/// compatibility.
#[macro_export]
macro_rules! register {
    ($name:literal, $func:path) => {
        /// Canonical entry point invoked by `oxideav_meta::register_all`.
        ///
        /// Generated by the [`oxideav_core::register!`] macro; do not
        /// invoke directly.
        #[doc(hidden)]
        pub fn __oxideav_entry(ctx: &mut $crate::RuntimeContext) {
            let _ = $name;
            $func(ctx);
        }
    };
}