Skip to main content

Crate oxideav_source

Crate oxideav_source 

Source
Expand description

Source registry shim — oxideav_core::SourceRegistry plus the built-in file:// driver and a prefetching BufferedSource wrapper.

SourceRegistry, the typed source traits (BytesSource, PacketSource, FrameSource), and the SourceOutput enum live in oxideav-core. This crate retains the concrete file:// driver and the BufferedSource helper that oxideav-http and the player rely on; it also exposes a with_defaults free function that pre-populates a registry with the file driver, matching the historical surface.

let reg = oxideav_source::with_defaults();
let _input = reg.open("/tmp/video.mp4").unwrap();

Structs§

BufferedSource
Buffered, prefetching wrapper around any ReadSeek.
SourceRegistry
Registry mapping URI schemes to opener functions. Each scheme picks one of three opener kinds (bytes / packets / frames) at registration time; callers see the choice via the SourceOutput variant returned from open.

Enums§

SourceOutput
What a SourceRegistry::open call returns. The variant is decided at driver-registration time, so callers can match on the shape and branch the pipeline accordingly.

Traits§

BytesSource
A seekable byte stream (Read + Seek + Send). Replaces the historical Box<dyn ReadSeek> opener-return type with a name that mirrors the other source-shape traits in this module. Blanket-implemented for every type that satisfies the bounds, so existing readers (files, Cursor<Vec<u8>>, HTTP-over-Range adapters) work unchanged.
FrameSource
A producer of already-decoded Frames.
PacketSource
A producer of already-demuxed Packets.
ReadSeek
Convenience trait bundle for seekable readers.

Functions§

open_file
Open a local file as a Box<dyn BytesSource>. Accepts:
register
Install the file:// (and bare-path) source driver into the given runtime context. Idempotent — replacing a prior registration of the file scheme.
with_defaults
Build a SourceRegistry pre-populated with the built-in file driver. Bare paths (without a scheme) also dispatch to it via the registry’s fall-back behaviour.