Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.9 KB

README.md

File metadata and controls

58 lines (42 loc) · 1.9 KB

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.2"}
  ]
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 and License

Copyright 2020, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0