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

More docs for v1.2 #923

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

More docs for v1.2 #923

wants to merge 23 commits into from

Conversation

FelonEkonom
Copy link
Member

@FelonEkonom FelonEkonom commented Dec 19, 2024

Closes #872

  • specs examples, including mermaid graphs visualizing children topology
  • examples of starting timer with usage of Membrane.Time (Membrane.Time was the problem)
  • lifecycle of Element / Bin / Pipeline

@FelonEkonom FelonEkonom requested a review from varsill December 19, 2024 16:51
@FelonEkonom FelonEkonom self-assigned this Dec 19, 2024
@FelonEkonom FelonEkonom added the no-changelog This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md label Dec 23, 2024
@FelonEkonom FelonEkonom marked this pull request as ready for review January 2, 2025 13:06
@FelonEkonom FelonEkonom requested a review from mat-hek as a code owner January 2, 2025 13:06
@FelonEkonom FelonEkonom removed the request for review from varsill January 2, 2025 13:06
@FelonEkonom FelonEkonom mentioned this pull request Dec 20, 2024
10 tasks
assets/images/spec_with_audio.svg Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
guides/timer.md Outdated Show resolved Hide resolved
guides/timer.md Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
guides/components_lifecycle.md Outdated Show resolved Hide resolved
Following `handle_init/2` is `handle_setup/2`, which is executed asynchronously. This is an optimal time to set up resources or perform other intensive operations required for the element to function properly.

## Linking pads
For components with pads having `availability: :on_request`, the corresponding `handle_pad_added/3` callbacks are called between `handle_setup/2` and `handle_playing/2` if they are linked in the same spec where the component was spawned. Linking the pad in a different spec from the one spawning the element may lead to `handle_pad_added/3` being invoked after `handle_playing/2`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we spoke recently, I believe that linking happens only after the child setup is completed, see https://github.com/membraneframework/membrane_core/blob/master/lib/membrane/core/lifecycle_controller.ex#L14 and

- Wait until all children are initialized and all dependent specs are fully handled. Dependent specs are

guides/timer.md Outdated
@@ -0,0 +1,115 @@
# Timer usage examples
Exampls below illustrate how to use `:start_timer`, `:timer_interval` and `:stop_timer` actions on the example of `Membrane.Source`, but the API looks the same for all kinds of the Membrane Components
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Exampls below illustrate how to use `:start_timer`, `:timer_interval` and `:stop_timer` actions on the example of `Membrane.Source`, but the API looks the same for all kinds of the Membrane Components
Examples below illustrate how to use `:start_timer`, `:timer_interval` and `:stop_timer` actions on the example of `Membrane.Source`, but the API looks the same for all kinds of the Membrane Components

put that through Grammarly to avoid typos

mix.exs Outdated
@@ -146,7 +148,7 @@ defmodule Membrane.Mixfile do
{:bunch, "~> 1.6"},
{:ratio, "~> 3.0 or ~> 4.0"},
# Development
{:ex_doc, "~> 0.28", only: :dev, runtime: false},
{:ex_doc, "0.34.2", only: :dev, runtime: false},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check once again but I searched for a version that generates valid docs

@@ -56,7 +56,7 @@ defmodule Membrane.Pipeline.Action do
|> get_child(:webrtc_sink)
```
will result in having following children topology:
will result in having the following children's topology:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
will result in having the following children's topology:
will result in the following childrens' topology:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

childrens' - are you sure? children is already plural 😛


### Events
Events are one type of item that can be sent via an Element's pads and are managed in `handle_event/4`. Events can travel both upstream and downstream relative to the pad’s direction.
Events are one type of item that can be sent via an Element's pads and are managed in `handle_event/4`. Events are the only things that can travel both upstream and downstream relative to the pad’s direction - all other types of data sent through pads have to follow the direction of the link.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Events are one type of item that can be sent via an Element's pads and are managed in `handle_event/4`. Events are the only things that can travel both upstream and downstream relative to the pad’s direction - all other types of data sent through pads have to follow the direction of the link.
Events are one type of data that can be sent via an Element's pads and are managed in `handle_event/4`. Events are the only items that can travel both upstream and downstream - all other types of data sent through pads have to follow the direction of the link.

@@ -63,7 +63,7 @@ defmodule Membrane.Bin.Action do
|> get_child(:webrtc_sink)
```

will result in having following children topology:
will result in having the following children's topology:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
will result in having the following children's topology:
will result the following children's topology:

@FelonEkonom FelonEkonom requested a review from varsill January 15, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs improvements (conclusions from the workshop)
3 participants