View Source Membrane.RTMPServer.ClientHandler behaviour (Membrane RTMP plugin v0.24.0)

A behaviour describing the actions that might be taken by the client handler in response to different events.

Summary

Types

t()

Type representing the user defined state of the client handler.

Callbacks

The callback invoked when the client sends the Membrane.RTMP.Messages.Connect.t() message.

The callback invoked when new piece of data is received from a given client.

The callback invoked when the client served by given client handler stops sending data. (for instance, when the remote client deletes the stream or terminates the socket connection)

The callback invoked when the client handler receives a message that is not recognized as an internal message of the client handler.

The callback invoked once the client handler is created. It should return the initial state of the client handler.

The callback invoked when the client sends the Membrane.RTMP.Messages.Publish.t() message.

Functions

Returns a specification to start this module under a supervisor.

Makes the client handler ask client for the desired number of buffers

Types

@type t() :: term()

Type representing the user defined state of the client handler.

Callbacks

Link to this callback

handle_connected(connected_msg, state)

View Source
@callback handle_connected(
  connected_msg :: Membrane.RTMP.Messages.Connect.t(),
  state :: t()
) :: t()

The callback invoked when the client sends the Membrane.RTMP.Messages.Connect.t() message.

Link to this callback

handle_data_available(payload, state)

View Source
@callback handle_data_available(payload :: binary(), state :: t()) :: t()

The callback invoked when new piece of data is received from a given client.

Link to this callback

handle_end_of_stream(state)

View Source
@callback handle_end_of_stream(state :: t()) :: t()

The callback invoked when the client served by given client handler stops sending data. (for instance, when the remote client deletes the stream or terminates the socket connection)

@callback handle_info(msg :: term(), t()) :: t()

The callback invoked when the client handler receives a message that is not recognized as an internal message of the client handler.

@callback handle_init(any()) :: t()

The callback invoked once the client handler is created. It should return the initial state of the client handler.

Link to this callback

handle_stream_published(publish_msg, state)

View Source
@callback handle_stream_published(
  publish_msg :: Membrane.RTMP.Messages.Publish.t(),
  state :: t()
) :: t()

The callback invoked when the client sends the Membrane.RTMP.Messages.Publish.t() message.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

demand_data(client_reference, how_many_buffers_demanded)

View Source
@spec demand_data(pid(), non_neg_integer()) :: :ok

Makes the client handler ask client for the desired number of buffers