mod backend;
mod cache;
mod executor;
mod indexer;
mod options;
use pixelflow_core::Result;
pub use indexer::{
IndexProgressSink, IndexedSources, NoopIndexProgressSink, SourceIndexContext,
index_reachable_sources,
};
pub const SOURCE_FILTER_NAME: &str = "source";
#[derive(Debug, Default)]
pub struct SourceRegistry {
names: Vec<&'static str>,
}
impl SourceRegistry {
#[must_use]
pub fn new() -> Self {
Self::default()
}
pub fn register(&mut self, name: &'static str) {
self.names.push(name);
}
#[must_use]
pub fn names(&self) -> &[&'static str] {
&self.names
}
}
pub fn register_ffms2_source(registry: &mut SourceRegistry) -> Result<()> {
registry.register(SOURCE_FILTER_NAME);
Ok(())
}
#[cfg(test)]
mod tests {
use super::{SOURCE_FILTER_NAME, SourceRegistry, register_ffms2_source};
#[test]
fn register_ffms2_source_records_source_name() {
let mut registry = SourceRegistry::new();
register_ffms2_source(&mut registry).expect("source registration should succeed");
assert_eq!(registry.names(), &[SOURCE_FILTER_NAME]);
}
}