pub struct StreamingPanako { /* private fields */ }Expand description
Streaming Panako fingerprinter.
Same deferred-emission strategy as super::StreamingWang: hashes are
emitted only once their anchor has accrued the full lookahead, so the
output multiset matches Panako::extract for the same total input.
Latency is higher than Wang because the triplet zone is wider
(target_zone_t = 96 vs Wang’s 63).
The pipeline is shared with StreamingWang
via the crate-internal streaming core; this wrapper supplies
only the Panako-specific triplet emission.
Implementations§
Source§impl StreamingPanako
impl StreamingPanako
Sourcepub fn new(cfg: PanakoConfig) -> Self
pub fn new(cfg: PanakoConfig) -> Self
Build a streaming Panako extractor with the given config.
Clamps target_zone_t to a minimum of 1 and fan_out to a
minimum of 1 to prevent underflows/empty output from degenerate
configurations. Caps target_zone_t at 512 and fan_out at 64
to prevent OOM from extreme values.
Sourcepub fn config(&self) -> &PanakoConfig
pub fn config(&self) -> &PanakoConfig
Borrow the configuration this stream was built with.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset all internal state. The stream behaves as if freshly constructed: no buffered audio, no pending peaks or anchors. Call between independent streams sharing one instance so stale data from a previous stream doesn’t bleed into new hashes.
Sourcepub fn flush_complete(&mut self) -> Result<Vec<(TimestampMs, PanakoHash)>>
pub fn flush_complete(&mut self) -> Result<Vec<(TimestampMs, PanakoHash)>>
Corrected end-of-stream finalisation matching offline
Panako::extract.
See StreamingWang::flush_complete for the legacy-vs-corrected
flush contract and when to opt in.
Sourcepub fn flush_complete_with<F>(&mut self, callback: F) -> Result<usize>
pub fn flush_complete_with<F>(&mut self, callback: F) -> Result<usize>
Callback variant of flush_complete.
Trait Implementations§
Source§impl Default for StreamingPanako
impl Default for StreamingPanako
Source§impl StreamingFingerprinter for StreamingPanako
impl StreamingFingerprinter for StreamingPanako
Source§type Frame = PanakoHash
type Frame = PanakoHash
Source§fn required_sample_rate(&self) -> u32
fn required_sample_rate(&self) -> u32
Source§fn push(&mut self, samples: &[f32]) -> Result<Vec<(TimestampMs, Self::Frame)>>
fn push(&mut self, samples: &[f32]) -> Result<Vec<(TimestampMs, Self::Frame)>>
Source§fn push_with<F>(&mut self, samples: &[f32], callback: F) -> Result<usize>
fn push_with<F>(&mut self, samples: &[f32], callback: F) -> Result<usize>
callback for each fingerprint frame
that became available during this push. Read moreSource§fn flush(&mut self) -> Result<Vec<(TimestampMs, Self::Frame)>>
fn flush(&mut self) -> Result<Vec<(TimestampMs, Self::Frame)>>
Source§fn flush_with<F>(&mut self, callback: F) -> Result<usize>
fn flush_with<F>(&mut self, callback: F) -> Result<usize>
callback for each frame. Read moreSource§fn latency_ms(&self) -> u32
fn latency_ms(&self) -> u32
push to the time the fingerprint covering it
is returned.Source§fn push_strict(
&mut self,
samples: &[f32],
) -> Result<Vec<(TimestampMs, Self::Frame)>>
fn push_strict( &mut self, samples: &[f32], ) -> Result<Vec<(TimestampMs, Self::Frame)>>
impl ZeroAllocStreaming for StreamingPanako
Auto Trait Implementations§
impl !RefUnwindSafe for StreamingPanako
impl !UnwindSafe for StreamingPanako
impl Freeze for StreamingPanako
impl Send for StreamingPanako
impl Sync for StreamingPanako
impl Unpin for StreamingPanako
impl UnsafeUnpin for StreamingPanako
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more