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
@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
add_partial_segment(manifest, track_id, independent?, duration, byte_size)
View Source@spec add_partial_segment( t(), Membrane.HTTPAdaptiveStream.Manifest.Track.id_t(), boolean(), Membrane.HTTPAdaptiveStream.Manifest.Track.segment_duration_t(), Membrane.HTTPAdaptiveStream.Manifest.Track.segment_byte_size_t() ) :: {Membrane.HTTPAdaptiveStream.Manifest.Track.Changeset.t(), t()}
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).
@spec add_segment( t(), track_id :: Membrane.HTTPAdaptiveStream.Manifest.Track.id_t(), [Membrane.HTTPAdaptiveStream.Manifest.Track.segment_opt_t()], [Membrane.HTTPAdaptiveStream.Manifest.SegmentAttribute.t()] ) :: {Membrane.HTTPAdaptiveStream.Manifest.Track.Changeset.t(), t()}
Add a new regular segment to the track with given track_id
.
@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.
@spec all_segments_per_track(t()) :: %{ optional(track_id :: term()) => [segment_name :: String.t()] }
Returns all segments grouped by the track id.
@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.
@spec finalize_current_segment(t(), Membrane.HTTPAdaptiveStream.Manifest.Track.id_t()) :: {Membrane.HTTPAdaptiveStream.Manifest.Track.Changeset.t(), t()}
Finalizes current segment of given track when serving partial segments.
@spec finish(t(), Membrane.HTTPAdaptiveStream.Manifest.Track.id_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
@spec has_track?(t(), Membrane.HTTPAdaptiveStream.Manifest.Track.id_t()) :: boolean()
@spec serialize(t()) :: serialized_manifests_t()