From eb5b8d90032e3e12328f70bfeef7c6ef1ddb1d05 Mon Sep 17 00:00:00 2001 From: "feliks.pobiedzinski@swmansion.com" Date: Tue, 18 Jul 2023 17:33:13 +0200 Subject: [PATCH 1/2] Update actions docs --- lib/membrane/element/action.ex | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/membrane/element/action.ex b/lib/membrane/element/action.ex index 3f1d20166..422cf9605 100644 --- a/lib/membrane/element/action.ex +++ b/lib/membrane/element/action.ex @@ -93,7 +93,7 @@ defmodule Membrane.Element.Action do @typedoc """ Executes `c:Membrane.Element.WithOutputPads.handle_demand/5` callback - for the given pad if its demand is greater than 0. + for those given pads, that have demand greater than 0. The pad must have output direction and work in pull mode. @@ -123,26 +123,29 @@ defmodule Membrane.Element.Action do ## Usage limitations Allowed only when playback is playing. """ - @type redemand :: {:redemand, Pad.ref()} + @type redemand :: {:redemand, Pad.ref() | [Pad.ref()]} @typedoc """ - Sends buffers/stream format/event to all output pads of element (or to input pads when - event occurs on the output pad). + Sends buffers/stream format/event/end of stream to all output pads of element (or to input + pads when event occurs on the output pad). Used by default implementations of - `c:Membrane.Element.WithInputPads.handle_stream_format/4` and - `c:Membrane.Element.Base.handle_event/4` callbacks in filter. + `c:Membrane.Element.WithInputPads.handle_stream_format/4`, + `c:Membrane.Element.Base.handle_event/4` and + `c:Membrane.Element.WithInputPads.handle_end_of_stream/3` callbacks in filter. Allowed only when _all_ below conditions are met: - element is filter, - - callback is `c:Membrane.WithInputPads.handle_buffers_batch/4`, - `c:Membrane.Element.WithInputPads.handle_stream_format/4` - or `c:Membrane.Element.Base.handle_event/4`, + - callback is `c:Membrane.Element.WithInputPads.handle_buffers_batch/4`, + `c:Membrane.Element.WithInputPads.handle_buffer/4`, + `c:Membrane.Element.WithInputPads.handle_stream_format/4`, + `c:Membrane.Element.Base.handle_event/4` or `c:Membrane.Element.WithInputPads.handle_end_of_stream/3` - playback is `playing` Keep in mind that `c:Membrane.WithInputPads.handle_buffers_batch/4` can only - forward buffers, `c:Membrane.Element.WithInputPads.handle_stream_format/4` - stream formats - and `c:Membrane.Element.Base.handle_event/4` - events. + forward buffers, `c:Membrane.Element.WithInputPads.handle_stream_format/4` - stream formats. + `c:Membrane.Element.Base.handle_event/4` - events and + `c:Membrane.Element.WithInputPads.handle_end_of_stream/3` - ends of streams. """ @type forward :: {:forward, Buffer.t() | [Buffer.t()] | StreamFormat.t() | Event.t() | :end_of_stream} From 240fb7cdd22df49720f484ea81e9776bf683c907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Feliks=20Pobiedzi=C5=84ski?= <38541925+FelonEkonom@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:46:10 +0200 Subject: [PATCH 2/2] Update lib/membrane/element/action.ex Co-authored-by: Mateusz Front --- lib/membrane/element/action.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/membrane/element/action.ex b/lib/membrane/element/action.ex index 422cf9605..521a1c40d 100644 --- a/lib/membrane/element/action.ex +++ b/lib/membrane/element/action.ex @@ -93,7 +93,7 @@ defmodule Membrane.Element.Action do @typedoc """ Executes `c:Membrane.Element.WithOutputPads.handle_demand/5` callback - for those given pads, that have demand greater than 0. + for the given pad (or pads), that have demand greater than 0. The pad must have output direction and work in pull mode.