pub trait VisualSource: Send {
// Required methods
fn report(&self) -> &ProbeReport;
fn render(
&mut self,
time: MediaTime,
fit: (u32, u32),
) -> Result<VisualFrame, ExtensionError>;
fn resident_bytes(&self) -> usize;
// Provided methods
fn needs(&self, _time: MediaTime) -> Vec<String> { ... }
fn reader(&self) -> Option<Box<dyn VisualSource>> { ... }
fn shared_bytes(&self) -> usize { ... }
}Expand description
A source a provider opened: asked for frames by source time.
Required Methods§
Sourcefn report(&self) -> &ProbeReport
fn report(&self) -> &ProbeReport
What the file is.
Sourcefn render(
&mut self,
time: MediaTime,
fit: (u32, u32),
) -> Result<VisualFrame, ExtensionError>
fn render( &mut self, time: MediaTime, fit: (u32, u32), ) -> Result<VisualFrame, ExtensionError>
The frame shown at time. Vector sources rasterize to fit within fit (width, height),
keeping aspect; raster sources use their own size.
§Errors
If the frame cannot be produced.
Sourcefn resident_bytes(&self) -> usize
fn resident_bytes(&self) -> usize
Bytes the source holds between renders (cached frames, images, and file bytes).
Provided Methods§
Sourcefn needs(&self, _time: MediaTime) -> Vec<String>
fn needs(&self, _time: MediaTime) -> Vec<String>
Locators rendering at time will read that the source does not already hold.
Sourcefn reader(&self) -> Option<Box<dyn VisualSource>>
fn reader(&self) -> Option<Box<dyn VisualSource>>
Another independently positioned reader sharing this source’s decoded data and frame
budget. None when any time is equally cheap to draw, so the host can share the source.
The part of Self::resident_bytes shared with Self::reader readers, counted once.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".