Skip to main content

StreamingPanako

Struct StreamingPanako 

Source
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

Source

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.

Source

pub fn config(&self) -> &PanakoConfig

Borrow the configuration this stream was built with.

Source

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.

Source

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.

Source

pub fn flush_complete_with<F>(&mut self, callback: F) -> Result<usize>

Callback variant of flush_complete.

Trait Implementations§

Source§

impl Default for StreamingPanako

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl StreamingFingerprinter for StreamingPanako

Source§

type Frame = PanakoHash

One unit of fingerprint material the stream emits.
Source§

fn required_sample_rate(&self) -> u32

Sample rate, in hertz, the stream expects its input at. Read more
Source§

fn push(&mut self, samples: &[f32]) -> Result<Vec<(TimestampMs, Self::Frame)>>

Feed PCM samples and return any fingerprints that became available during this push. Read more
Source§

fn push_with<F>(&mut self, samples: &[f32], callback: F) -> Result<usize>
where F: FnMut(TimestampMs, &Self::Frame),

Feed PCM samples and invoke callback for each fingerprint frame that became available during this push. Read more
Source§

fn flush(&mut self) -> Result<Vec<(TimestampMs, Self::Frame)>>

Drain any pending fingerprint material at end-of-stream. Read more
Source§

fn flush_with<F>(&mut self, callback: F) -> Result<usize>
where F: FnMut(TimestampMs, &Self::Frame),

Drain any pending fingerprint material at end-of-stream, invoking callback for each frame. Read more
Source§

fn latency_ms(&self) -> u32

Conservative upper bound on emission latency: from the time a sample enters push to the time the fingerprint covering it is returned.
Source§

fn push_strict( &mut self, samples: &[f32], ) -> Result<Vec<(TimestampMs, Self::Frame)>>

Like push, but fail fast on non-finite input instead of sanitizing it to 0.0. Read more
Source§

impl ZeroAllocStreaming for StreamingPanako

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.