Rindle.Probe behaviour (Rindle v0.1.5)

Copy Markdown View Source

Behaviour contract for content-analysis probes.

Probes inspect a local file path (already downloaded out of storage) and return a normalized result map describing the content's kind, dimensions, duration, track presence, and free-form metadata. Storage I/O happens outside this callback; probes operate on local paths only.

This is symmetric with Rindle.Processor (see lib/rindle/processor.ex) and intentionally distinct from the internal boot-time FFmpeg version probe used by mix rindle.doctor (D-05). See SYNTHESIS ยง2.2 for the naming choice.

See:

Summary

Types

kind()

@type kind() :: :image | :video | :audio

result()

@type result() :: %{
  :kind => kind(),
  optional(:width) => pos_integer(),
  optional(:height) => pos_integer(),
  optional(:duration_ms) => non_neg_integer(),
  optional(:has_video_track) => boolean(),
  optional(:has_audio_track) => boolean(),
  optional(:metadata) => map()
}

Callbacks

accepts?(content_type)

@callback accepts?(content_type :: String.t()) :: boolean()

probe(source)

@callback probe(source :: Path.t()) :: {:ok, result()} | {:error, term()}