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 recording_config() :: %{ track: Membrane.RTC.Engine.Track.t(), recording_id: String.t(), filename: String.t() }
Callbacks
@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.
@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.
@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.