View Source Membrane.RTC.Engine.Endpoint.Recording.Storage behaviour (Membrane RTC Engine Recording Endpoint v0.2.0)

An interface for Recording endpoint storage configuration.

Summary

Callbacks

Callback invoked when a new track is added to RecordingEndpoint. It should return a struct that will be further added as a child to the spec.

This callback gets invoked exclusively when FileStorage is in use and a recording session is being closed. Within this callback, you can perform the following actions

Callback invoked once all tracks have been processed by RecordingEndpoint. The returned object can be of two types

Types

@type files() :: %{
  required(filename :: String.t()) => {Path.t(), size :: pos_integer()}
}
@type object_config() :: %{
  object: binary(),
  recording_id: String.t(),
  filename: String.t()
}
@type recording_config() :: %{
  track: Membrane.RTC.Engine.Track.t(),
  recording_id: String.t(),
  filename: String.t()
}

Callbacks

Link to this callback

get_sink(recording_config, opts)

View Source
@callback get_sink(recording_config :: recording_config(), opts :: any()) :: struct()

Callback invoked when a new track is added to RecordingEndpoint. It should return a struct that will be further added as a child to the spec.

Link to this callback

on_close(file_config, recording_id, opts)

View Source
@callback on_close(file_config :: files(), recording_id :: String.t(), opts :: any()) ::
  :ok | :error

This callback gets invoked exclusively when FileStorage is in use and a recording session is being closed. Within this callback, you can perform the following actions:

  • Clean up all resources
  • Attempt to rectify any discrepancies between the saved objects and local files

If error is returned report won't be sent to the storage.

Link to this callback

save_object(object_config, opts)

View Source
@callback save_object(object_config :: object_config(), opts :: any()) ::
  :ok | {:error, String.t()}

Callback invoked once all tracks have been processed by RecordingEndpoint. The returned object can be of two types:

  • report - a file containing all the necessary information for deserializing the processed tracks.
  • recording - a file that captures a complete track recording.