View Source Membrane.HTTPAdaptiveStream.Storage behaviour (Membrane HTTP Adaptive Stream plugin v0.8.0)
Behaviour for storing manifests and stream segments.
Link to this section Summary
Callbacks
Generates the storage state based on the configuration struct.
Removes the resource.
Stores the resource on a storage.
Functions
Stores a new segment and removes stale ones.
Removes all the saved segments and manifests.
Clears the manifest cache.
Initializes the storage.
Stores stream header file.
Stores serialized manifest files
Link to this section Types
Link to this section Callbacks
Generates the storage state based on the configuration struct.
@callback remove( resource_name :: String.t(), context :: %{type: :manifest | :header | :segment}, state_t() ) :: callback_result_t()
Removes the resource.
@callback store( resource_name :: String.t(), content :: String.t() | binary(), context :: %{type: :manifest | :header | :segment, mode: :text | :binary}, state_t() ) :: callback_result_t()
Stores the resource on a storage.
Gets the mode that should be used when writing to a file and type of the resource
Link to this section Functions
@spec apply_segment_changeset( t(), {to_add :: String.t(), to_remove :: [String.t()]}, payload :: binary() ) :: {callback_result_t(), t()}
Stores a new segment and removes stale ones.
@spec cleanup(t(), segments :: [String.t()]) :: {callback_result_t(), t()}
Removes all the saved segments and manifests.
Clears the manifest cache.
Initializes the storage.
Accepts the following options:
enable_cache
- if true (default), manifests will be stored only if they've been changed
@spec store_header(t(), name :: String.t(), payload :: binary()) :: {callback_result_t(), t()}
Stores stream header file.
@spec store_manifests(t(), [{name :: String.t(), content :: String.t()}]) :: {callback_result_t(), t()}
Stores serialized manifest files