Membrane.Core.Element.DemandHandler.supply_demand
You're seeing just the function
supply_demand
, go back to Membrane.Core.Element.DemandHandler module for more information.
Specs
supply_demand(Membrane.Pad.ref_t(), Membrane.Core.Element.State.t()) :: {:ok, Membrane.Core.Element.State.t()} | {{:error, any()}, Membrane.Core.Element.State.t()}
If element is not supplying demand currently, this function supplies demand right away by taking buffers from the InputBuffer of the given pad and passing it to proper controllers.
If element is currently supplying demand it delays supplying demand until all current processing is finished.
This is necessary due to the case when one requests a demand action while previous demand is being supplied. This could lead to a situation where buffers are taken from InputBuffer and passed to callbacks, while buffers being currently supplied have not been processed yet, and therefore to changing order of buffers.