Parlora.Channel behaviour (Parlora v0.1.0)

Copy Markdown View Source

Participant audio and playback controls, independent of device or transport.

Summary

Callbacks

Optional one-shot hint when a frame fits the output queue in this playback epoch.

Optional, idempotent pressure hint: release recovery in this playback epoch only.

Callbacks

arm_output_space(pid, pid, reference, pos_integer, non_neg_integer)

(optional)
@callback arm_output_space(pid(), pid(), reference(), pos_integer(), non_neg_integer()) ::
  :ok | {:error, Parlora.Error.t()}

Optional one-shot hint when a frame fits the output queue in this playback epoch.

capabilities(pid)

@callback capabilities(pid()) ::
  {:ok, Parlora.Channel.Capabilities.t()} | {:error, Parlora.Error.t()}

close(pid, t, term)

@callback close(pid(), String.t(), term()) :: :ok | {:error, Parlora.Error.t()}

control(pid, t, arg3)

@callback control(
  pid(),
  String.t(),
  {:suppress_output, boolean()} | {:clear_output, non_neg_integer()}
) ::
  :ok | {:error, Parlora.Error.t()}

read_audio(pid, pos_integer)

@callback read_audio(pid(), pos_integer()) ::
  {:ok, [Parlora.AudioFrame.t()]} | {:error, Parlora.Error.t()}

release_output_recovery(pid, non_neg_integer)

(optional)
@callback release_output_recovery(pid(), non_neg_integer()) ::
  :ok | {:error, Parlora.Error.t()}

Optional, idempotent pressure hint: release recovery in this playback epoch only.

start_link(t, keyword)

@callback start_link(Parlora.AdapterInit.t(), keyword()) ::
  {:ok, pid()} | {:error, Parlora.Error.t()}

write_audio(pid, t)

@callback write_audio(pid(), Parlora.AudioFrame.t()) :: :ok | {:error, Parlora.Error.t()}