Skip to content

Commit

Permalink
Update demand type to allow for the default demand size syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Noarkhh committed Mar 4, 2024
1 parent f65a678 commit c32c06a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/membrane/element/action.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ defmodule Membrane.Element.Action do
guaranteed not to receive more data than demanded.
Demand size can be either a non-negative integer, that overrides existing demand,
or a function that is passed current demand, and is to return the new demand.
or a function that is passed current demand, and is to return the new demand. In case only pad
is specified, the demand size defaults to a value of 1.
Allowed only when playback is playing.
"""
@type demand :: {:demand, {Pad.ref(), demand_size}}
@type demand :: {:demand, {Pad.ref(), demand_size} | Pad.ref()}
@type demand_size :: pos_integer | (pos_integer() -> non_neg_integer())

@typedoc """
Expand Down

0 comments on commit c32c06a

Please sign in to comment.