Skip to content

Commit

Permalink
Merge branch 'master' into pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-hek authored Feb 23, 2024
2 parents 3918c93 + 4c37a06 commit b396a9f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
18 changes: 12 additions & 6 deletions lib/membrane/event.ex
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
defmodule Membrane.Event do
@moduledoc """
Event is an entity that can be sent between elements.
Represents a communication event, capable of flowing both downstream and upstream.
Events can flow either downstream or upstream - they can be sent with
`t:Membrane.Element.Action.event/0`, and can be handled in
`c:Membrane.Element.Base.handle_event/4`. Each event is
to implement `Membrane.EventProtocol`, which allows to configure its behaviour.
Events are dispatched using `t:Membrane.Element.Action.event/0` and are handled via the
`c:Membrane.Element.Base.handle_event/4` callback. Each event must conform to the
`Membrane.EventProtocol` to ensure the proper configuration of its behaviour.
"""

alias Membrane.EventProtocol

@typedoc @moduledoc
@typedoc """
The Membrane event, based on the `Membrane.EventProtocol`.
"""
@type t :: EventProtocol.t()

@doc """
Checks if the given argument is a Membrane event.
Returns `true` if the `event` implements the `Membrane.EventProtocol`, otherwise `false`.
"""
@spec event?(t()) :: boolean
def event?(event) do
EventProtocol.impl_for(event) != nil
Expand Down
14 changes: 8 additions & 6 deletions lib/membrane/stream_format.ex
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
defmodule Membrane.StreamFormat do
@moduledoc """
Describes capabilities of some pad.
Defines the capabilities of a pad within the Membrane framework.
Every pad has some capabilities, which define a type of data that pad is
expecting. This format can be, for example, raw audio with specific sample
rate or encoded audio in given format.
Each pad in a multimedia pipeline has specific capabilities, determining the type and format
of data it can handle. For example, a pad's capabilities might include handling raw audio
with a specific sample rate or managing encoded audio in a specified format.
To link two pads together, their capabilities have to be compatible.
To successfully link two pads together, their capabilities must be compatible.
"""

@typedoc @moduledoc
@typedoc """
Represents a pad's capabilities. For more information, see: `Membrane.StreamFormat`.
"""
@type t :: struct
end

0 comments on commit b396a9f

Please sign in to comment.