Membrane.HTTPAdaptiveStream.Storage behaviour (Membrane HTTP Adaptive Stream plugin v0.3.0) View Source
Behaviour for storing manifests and stream segments.
Link to this section Summary
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
Callbacks
Generates the storage state based on the configuration struct.
Removes the resource.
Stores the resource on a storage.
Link to this section Types
Link to this section Functions
Specs
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.
Specs
cleanup(t(), segments :: [String.t()]) :: {callback_result_t(), t()}
Removes all the saved segments and manifests.
Specs
Clears the manifest cache.
Specs
Initializes the storage.
Accepts the following options:
enable_cache- if true (default), manifests will be stored only if they've been changed
Specs
store_header(t(), name :: String.t(), payload :: binary()) :: {callback_result_t(), t()}
Stores stream header file.
Specs
store_manifests(t(), [{name :: String.t(), content :: String.t()}]) :: {callback_result_t(), t()}
Stores serialized manifest files
Link to this section Callbacks
Specs
Generates the storage state based on the configuration struct.
Specs
remove( resource_name :: String.t(), context :: %{type: :manifest | :header | :segment}, state_t() ) :: callback_result_t()
Removes the resource.
Specs
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