ExRTMP.Chunk (RTMP Server and Client v0.4.1)

View Source

Module describing an RTMP chunk.

Summary

Functions

Parses the binary into a chunk header.

Serializes the chunk into binary.

Types

payload_size()

@type payload_size() :: non_neg_integer()

stream_id()

@type stream_id() :: non_neg_integer()

t()

@type t() :: %ExRTMP.Chunk{
  fmt: 0..3,
  message_length: non_neg_integer() | nil,
  message_stream_id: non_neg_integer() | nil,
  message_type_id: non_neg_integer() | nil,
  payload: binary() | nil,
  stream_id: stream_id(),
  timestamp: non_neg_integer() | nil
}

Functions

parse_header(data)

@spec parse_header(binary()) :: {:ok, t(), binary()} | :more

Parses the binary into a chunk header.

serialize(chunk)

@spec serialize(t()) :: iodata()

Serializes the chunk into binary.