VideoInterop.ConsumerSession protocol (video_interop v0.1.0)

Copy Markdown View Source

An opened consumer stream with explicit frame ownership receipts.

transfer/2 must perform every fallible admission check before claiming the frame. After claim it must return a transferred receipt and retain a path that retires the holder exactly once. Implementations must not raise across an unknown claim point.

close/1 is idempotent and returns only after admission is closed and all pending/current claims are retired or scheduled for consumer-safe retirement.

Summary

Types

t()

All the types that implement this protocol.

Types

ownership_error()

@type ownership_error() :: {:caller_owned | :transferred, term()}

t()

@type t() :: term()

All the types that implement this protocol.

transfer_result()

@type transfer_result() ::
  {:ok, :transferred | :released} | {:error, ownership_error()}

Functions

close(session)

@spec close(t()) :: :ok

transfer(session, frame)

@spec transfer(t(), VideoInterop.Frame.t()) :: transfer_result()