View Source Membrane.HTTPAdaptiveStream.Manifest behaviour (Membrane HTTP Adaptive Stream plugin v0.12.0)

Behaviour for manifest serialization.

Link to this section Summary

Functions

Add a new partial segment to the track with given track_id.

Add a new regular segment to the track with given track_id.

Add a track to the manifest.

Returns all segments grouped by the track id.

Append a discontinuity to the track.

Finalizes current segment of given track when serving partial segments.

Restores all the stale segments in all tracks.

Link to this section Types

Link to this type

serialized_manifest_t()

View Source
@type serialized_manifest_t() ::
  {manifest_name :: String.t(), manifest_content :: String.t()}
Link to this type

serialized_manifests_t()

View Source
@type serialized_manifests_t() :: %{
  master_manifest: serialized_manifest_t(),
  manifest_per_track: %{optional(track_id :: any()) => serialized_manifest_t()}
}
@type t() :: %Membrane.HTTPAdaptiveStream.Manifest{
  module: module(),
  name: String.t(),
  tracks: %{
    required(id :: any()) => Membrane.HTTPAdaptiveStream.Manifest.Track.t()
  }
}

Link to this section Callbacks

@callback serialize(t()) :: serialized_manifests_t()

Link to this section Functions

Link to this function

add_partial_segment(manifest, track_id, independent?, duration, byte_size)

View Source

Add a new partial segment to the track with given track_id.

Partial segments gets appended to the latest regular segment until finalize_current_segment/2 gets called. After that, in order to add new partial segments one must add an incomplete segment (a regular segment with and option of complete? set to false).

Link to this function

add_segment(manifest, track_id, opts, attributes \\ [])

View Source

Add a new regular segment to the track with given track_id.

Link to this function

add_track(manifest, config)

View Source
@spec add_track(t(), Membrane.HTTPAdaptiveStream.Manifest.Track.Config.t()) ::
  {header_name :: String.t(), t()}

Add a track to the manifest.

Returns the name under which the header file should be stored.

Link to this function

all_segments_per_track(manifest)

View Source
@spec all_segments_per_track(t()) :: %{
  optional(track_id :: term()) => [segment_name :: String.t()]
}

Returns all segments grouped by the track id.

Link to this function

discontinue_track(manifest, track_id)

View Source
@spec discontinue_track(t(), Membrane.HTTPAdaptiveStream.Manifest.Track.id_t()) ::
  {header_name :: String.t(), t()}

Append a discontinuity to the track.

This will inform the player that eg. the parameters of the encoder changed and allow you to provide a new MP4 header. For details on discontinuities refer to RFC 8216.

Link to this function

finalize_current_segment(manifest, track_id)

View Source

Finalizes current segment of given track when serving partial segments.

Link to this function

finish(manifest, track_id)

View Source
Link to this function

from_beginning(manifest)

View Source
@spec from_beginning(t()) :: t()

Restores all the stale segments in all tracks.

All the tracks must be configured to be persisted beforehand, otherwise this function will raise

Link to this function

has_track?(manifest, track_id)

View Source
@spec serialize(t()) :: serialized_manifests_t()