Skip to content

Commit

Permalink
lib/membrane/stream_format.ex doc changes
Browse files Browse the repository at this point in the history
sq
  • Loading branch information
bradhanks committed Feb 13, 2024
1 parent da0aeb5 commit a3fc0c5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 32 deletions.
42 changes: 16 additions & 26 deletions lib/membrane/core/bin/pad_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -163,33 +163,23 @@ defmodule Membrane.Core.Bin.PadController do
state.pads_data
|> Map.values()
|> Enum.filter(&(&1.spec_ref == spec_ref))
|> Enum.reduce(
state,
fn pad_data, state ->
if pad_data.link_id do
Membrane.Logger.debug(
"Sending link response, link_id: #{inspect(pad_data.link_id)}, pad: #{inspect(pad_data.ref)}"
)

Message.send(state.parent_pid, :link_response, [pad_data.link_id, pad_data.direction])
{[], state}
else
new_state =
Membrane.Core.Child.PadModel.set_data!(
state,
pad_data.ref,
:response_received?,
true
)
|> Enum.reduce(state, fn pad_data, state ->
if pad_data.link_id do
Membrane.Logger.debug(
"Sending link response, link_id: #{inspect(pad_data.link_id)}, pad: #{inspect(pad_data.ref)}"
)

{[], new_state}
end
end,
fn state -> {[state], state} end,
fn _acc -> :ok end
)
|> Enum.to_list()
|> List.first()
Message.send(state.parent_pid, :link_response, [pad_data.link_id, pad_data.direction])
state
else
Membrane.Core.Child.PadModel.set_data!(
state,
pad_data.ref,
:response_received?,
true
)
end
end)
end

@doc """
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.
"""
@type t :: struct
end

0 comments on commit a3fc0c5

Please sign in to comment.