Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move parts of @moduledoc from Membrane.Element.Base to Membrane.Element #547

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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