Membrane.RTC.Engine.Endpoint.Recording.Reporter (Membrane RTC Engine Recording Endpoint v0.3.0)

View Source

Module responsible for creating report with information needed to decode recorded streams.

Each stream is represented as a track that includes the following fields:

  • type - Specifies either :video or :audio.
  • encoding - Necessary for decoding.
  • offset - Represents the offset compared to the first track (the first track always has an offset of 0). The the offset is calculated based on the handle_pad_added call time.
  • start_timestamp - Specifies the RTP timestamp of the first buffer.
  • start_timestamp_wallclock - Denotes the wallclock timestamp of the first buffer.
  • end_timestamp - Indicates the RTP timestamp of the last buffer.
  • clock_rate - Necessary for decoding.
  • metadata - Contains custom data attached by peer to the track.
  • origin - Specifies the component that published the track.

Summary

Types

filename()

@type filename() :: String.t()

report()

@type report() :: %{
  recording_id: String.t(),
  tracks: %{required(filename()) => track_report()}
}

state()

@opaque state()

track_report()

@type track_report() :: %{
  type: Membrane.RTC.Engine.Track.t(),
  encoding: Membrane.RTC.Engine.Track.encoding(),
  offset: pos_integer(),
  start_timestamp: pos_integer(),
  start_timestamp_wallclock: pos_integer(),
  end_timestamp: pos_integer(),
  clock_rate: Membrane.RTP.clock_rate(),
  metadata: any(),
  origin: String.t()
}

Functions

add_track(reporter, track, filename, timestamp)

@spec add_track(pid(), Membrane.RTC.Engine.Track.t(), filename(), pos_integer()) ::
  :ok

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

end_timestamp(reporter, track_id, end_timestamp)

@spec end_timestamp(pid(), Membrane.RTC.Engine.Track.id(), pos_integer()) :: :ok

get_report(reporter)

@spec get_report(pid()) :: report()

rtcp_packet(reporter, track_id, rtcp)

start(recording_id)

@spec start(String.t()) :: {:ok, pid()} | {:error, term()}

start_timestamp(reporter, track_id, start_timestamp)

@spec start_timestamp(pid(), Membrane.RTC.Engine.Track.id(), pos_integer()) :: :ok

stop(reporter)

@spec stop(pid()) :: :ok