High-level media pipeline orchestrator.
Ties together all media subsystems into a coherent pipeline:
Stream → Decode → Texture Pool → Scene Compositor → GPU Surface
↑ ↑ ↑
Adaptive Subtitles Filters/Effects
Bitrate ↑ ↑
↑ Clock ←──── Animation
└────────┘Example
{:ok, pipeline} = Dala.Media.Pipeline.start(%{
url: "https://example.com/stream.m3u8",
width: 1920,
height: 1080,
fps: 60,
subtitles: "subtitles.srt",
filters: [:blur, :lut],
adaptive: true
})
Dala.Media.Pipeline.play(pipeline)
Dala.Media.Pipeline.pause(pipeline)
Dala.Media.Pipeline.stop(pipeline)
Summary
Functions
Add a filter to the running pipeline.
Returns a specification to start this module under a supervisor.
Get pipeline diagnostics.
Get pipeline state.
Pause playback.
Start playback.
Remove a filter from the running pipeline.
Seek to a position in milliseconds.
Start a media pipeline with the given configuration.
Stop playback and release all resources.
Types
@type config() :: %{ url: String.t(), width: non_neg_integer(), height: non_neg_integer(), fps: pos_integer(), subtitles: String.t() | nil, filters: [atom()], adaptive: boolean(), loop: boolean(), volume: float() }
@type pipeline_ref() :: pid()
Functions
@spec add_filter(pipeline_ref(), atom(), map()) :: :ok | {:error, term()}
Add a filter to the running pipeline.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec diagnostic(pipeline_ref()) :: map()
Get pipeline diagnostics.
@spec get_state(pipeline_ref()) :: atom()
Get pipeline state.
@spec pause(pipeline_ref()) :: :ok
Pause playback.
@spec play(pipeline_ref()) :: :ok
Start playback.
@spec remove_filter(pipeline_ref(), atom()) :: :ok
Remove a filter from the running pipeline.
@spec seek(pipeline_ref(), non_neg_integer()) :: :ok
Seek to a position in milliseconds.
@spec start(map()) :: {:ok, pipeline_ref()} | {:error, term()}
Start a media pipeline with the given configuration.
@spec stop(pipeline_ref()) :: :ok
Stop playback and release all resources.