pub trait MediaSourceOpener: Send + Sync {
// Required method
fn open(&self, uri: &str) -> Result<MediaSourceHandle, Error>;
}Expand description
Opens a media URI the decoder cannot open for itself.
A file: URI is a path and needs nobody, which is why
open_media_source answers those without asking. A content:// document
belongs to an Android provider and only the platform layer can ask that
provider for a descriptor, so the platform layer registers this and the
decode thread calls it.
A descriptor rather than a reader because that is what both sides really have: a real file is seekable, a provider that streams hands back a pipe, and the decoder tells them apart by trying to seek.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".