Skip to content

Commit

Permalink
Update callback contexts docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FelonEkonom committed Jan 10, 2023
1 parent fe194f0 commit b8ee62d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/membrane/bin/callback_context.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
defmodule Membrane.Bin.CallbackContext do
@moduledoc """
Module describiing context passed to the `Membrane.Bin` callbacks.
Module describing context passed to the `Membrane.Bin` callbacks.
"""

@typedoc """
Type describing context passed to the `Membrane.Bin` callbacks.
Field `:pad_options` is present only in `c:Membrane.Bin.handle_pad_added/3`
and `c:Membrane.Bin.handle_pad_removed/3`.
"""
@type t :: %{
:clock => Membrane.Clock.t(),
:parent_clock => Membrane.Clock.t(),
Expand Down
14 changes: 13 additions & 1 deletion lib/membrane/element/callback_context.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
defmodule Membrane.Element.CallbackContext do
@moduledoc """
Describes context passed to Membrane Elements callbacks.
Describes context passed to the Membrane Element callbacks.
"""

@typedoc """
Type describing context passed to the Membrane Element callbacks.
Field `:incoming_demand` is present only in
`c:Membrane.Element.WithOutputPads.handle_demand/5`.
Field `:pad_options` is present only in `c:Membrane.Element.Base.handle_pad_added/3`
and `c:Membrane.Element.Base.handle_pad_removed/3`.
Field `:old_stream_format` is present only in
`c:Membrane.Element.WithInputPads.handle_stream_format/5`.
"""
@type t :: %{
:pads => %{Membrane.Pad.ref_t() => Membrane.Element.PadData.t()},
:clock => Membrane.Clock.t() | nil,
Expand Down
8 changes: 8 additions & 0 deletions lib/membrane/pipeline/callback_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ defmodule Membrane.Pipeline.CallbackContext do
Module describing context passed to the `Membrane.Pipeline` callbacks.
"""

@typedoc """
Type describing context passed to the `Membrane.Pipeline` callbacks.
Field `:from` is present only in `c:Membrane.Pipeline.handle_call/3`.
Fields `:members` and `:crash_initiator` are present only in
`c:Membrane.Pipeline.handle_crash_group_down/3`.
"""
@type t :: %{
:clock => Membrane.Clock.t(),
:children => %{Membrane.Child.name_t() => Membrane.ChildEntry.t()},
Expand Down

0 comments on commit b8ee62d

Please sign in to comment.