Skip to content

Commit

Permalink
Move parts of @moduledoc from Membrane.Element.Base to Membrane.Eleme…
Browse files Browse the repository at this point in the history
…nt (#547)
  • Loading branch information
djanda97 authored Apr 27, 2023
1 parent d8b66f7 commit 9eb45ae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
21 changes: 20 additions & 1 deletion lib/membrane/element.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,27 @@ defmodule Membrane.Element do
@moduledoc """
Module containing types and functions for operating on elements.
For behaviours for elements chceck `Membrane.Source`, `Membrane.Filter`,
For behaviours for elements check `Membrane.Source`, `Membrane.Filter`,
`Membrane.Endpoint` and `Membrane.Sink`.
## Behaviours
Element-specific behaviours are specified in modules:
- `Membrane.Element.WithOutputPads` - behaviour common to sources,
filters and endpoints
- `Membrane.Element.WithInputPads` - behaviour common to sinks,
filters and endpoints
- Base modules (`Membrane.Source`, `Membrane.Filter`, `Membrane.Endpoint`,
`Membrane.Sink`) - behaviours specific to each element type.
## Callbacks
Modules listed above provide specifications of callbacks that define elements
lifecycle. All of these callbacks have names with the `handle_` prefix.
They are used to define reaction to certain events that happen during runtime,
and indicate what actions framework should undertake as a result, besides
executing element-specific code.
For actions that can be returned by each callback, see `Membrane.Element.Action`
module.
"""

@typedoc """
Expand Down
25 changes: 3 additions & 22 deletions lib/membrane/element/base.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ defmodule Membrane.Element.Base do
receive (input pads) data. For more information on pads, see
`Membrane.Pad`.
To implement an element, one of base modules (`Membrane.Source`,
Note: This module (`Membrane.Element.Base`) should not be `use`d directly.
To implement an element, one of the following base modules (`Membrane.Source`,
`Membrane.Filter`, `Membrane.Endpoint` or `Membrane.Sink`)
has to be `use`d, depending on the element type:
- source, producing buffers (contain only output pads),
Expand All @@ -23,27 +25,6 @@ defmodule Membrane.Element.Base do
- sink, consuming buffers (contain only input pads).
For more information on each element type, check documentation for appropriate
base module.
## Behaviours
Element-specific behaviours are specified in modules:
- `Membrane.Element.Base` - this module, behaviour common to all
elements,
- `Membrane.Element.WithOutputPads` - behaviour common to sources,
filters and endpoints
- `Membrane.Element.WithInputPads` - behaviour common to sinks,
filters and endpoints
- Base modules (`Membrane.Source`, `Membrane.Filter`, `Membrane.Endpoint`,
`Membrane.Sink`) - behaviours specific to each element type.
## Callbacks
Modules listed above provide specifications of callbacks that define elements
lifecycle. All of these callbacks have names with the `handle_` prefix.
They are used to define reaction to certain events that happen during runtime,
and indicate what actions framework should undertake as a result, besides
executing element-specific code.
For actions that can be returned by each callback, see `Membrane.Element.Action`
module.
"""

use Bunch
Expand Down

0 comments on commit 9eb45ae

Please sign in to comment.