Element for cutting the stream.
Element options
Passed via struct Membrane.Scissors.t/0
intervals[{Time.t(), duration :: Time.t() | integer}] | Enumerable.t()Required
Enumerable containing{start_time, duration}tuples specifying parts of the stream that should be preserved. All other parts are cut off. Duration unit should conform to theinterval_duration_unitoption. Note that infinite streams are also supported.buffer_duration(Buffer.t(), accepted_format :: any -> Time.t())Required
Function returning the duration of given buffer in Membrane Time units.interval_duration_unit:time | :buffersDefault value:
:time
Unit of the duration of each interval in theintervalsoption. If:buffersis passed, given amount of buffers is preserved, unless the next interval starts earlier. In that case, the stream is cut according to the subsequent intervals.filter(Buffer.t(), accepted_format :: any -> boolean)Default value:
&Membrane.Scissors.always_pass_filter/2
Function for filtering buffers before they are cut. Each buffer is preserved iff it returnstrue. By default always returnstrue.
Pads
:input
Accepted formats:
_any| Direction: | :input |
| Availability: | :always |
| Flow control: | :manual |
| Demand unit: | :buffers |
:output
Accepted formats:
_any| Direction: | :output |
| Availability: | :always |
| Flow control: | :manual |
| Demand unit: | nil |
Summary
Types
Struct containing options for Membrane.Scissors
Types
@type t() :: %Membrane.Scissors{ buffer_duration: (Membrane.Buffer.t(), accepted_format :: any() -> Membrane.Time.t()), filter: (Membrane.Buffer.t(), accepted_format :: any() -> boolean()), interval_duration_unit: :time | :buffers, intervals: [{Membrane.Time.t(), duration :: Membrane.Time.t() | integer()}] | Enumerable.t() }
Struct containing options for Membrane.Scissors
Functions
@spec options() :: keyword()
Returns description of options available for this module