membrane_funnel_plugin

Membrane plugin for funneling


Keywords
membrane
License
Apache-2.0

Documentation

Membrane Funnel plugin

Hex.pm API Docs CircleCI

Membrane plugin for merging multiple input streams into a single output.

It can be used for collecting data from multiple inputs and sending it through one output.

It is part of Membrane Multimedia Framework.

Installation

The package can be installed by adding membrane_funnel_plugin to your list of dependencies in mix.exs:

def deps do
  [
	{:membrane_funnel_plugin, "~> 0.9.0"}
  ]
end

Usage

Playing this pipeline should merge two files a.txt and b.txt into file c.txt

defmodule FunnelDemo do
  use Membrane.Pipeline

  def handle_init(_) do
    children = [
      a_source: %Membrane.File.Source{location: "a.txt"},
      b_source: %Membrane.File.Source{location: "b.txt"},
      funnel: Membrane.Funnel,
      sink: %Membrane.File.Sink{location: "c.txt"}
    ]

    links = [
      link(:a_source) |> to(:funnel),
      link(:b_source) |> to(:funnel),
      link(:funnel) |> to(:sink)
    ]

    spec = %ParentSpec{children: children, links: links}
    {{:ok, spec: spec, playback: :playing}, %{}}
  end
end

Copyright 2020, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0