RTSP.RTP.Decoder behaviour (RTSP v0.3.2)

View Source

Behaviour to depayload and parse rtp packets.

Summary

Callbacks

Invoked when a discontinuity occurred.

Invoked when a new RTP packet is received

Initialize deapyloader

Types

rtp_timestamp()

@type rtp_timestamp() :: non_neg_integer()

sample()

@type sample() :: {binary() | [binary()], rtp_timestamp(), keyframe? :: boolean()}

state()

@type state() :: any()

Callbacks

handle_discontinuity(state)

@callback handle_discontinuity(state()) :: state()

Invoked when a discontinuity occurred.

A discontinuity occurs when an RTP packet is lost or missing by examining the sequence numbers.

handle_packet(t, state)

@callback handle_packet(ExRTP.Packet.t(), state()) ::
  {:ok, sample() | [sample()], state()} | {:error, any()}

Invoked when a new RTP packet is received

init(t)

@callback init(Keyword.t()) :: state()

Initialize deapyloader