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

Migrate the guide to the getting started tutorial #82

Merged
merged 9 commits into from
Oct 4, 2023
Merged

Migrate the guide to the getting started tutorial #82

merged 9 commits into from
Oct 4, 2023

Conversation

mat-hek
Copy link
Member

@mat-hek mat-hek commented Sep 14, 2023

TODO:

  • Chapter about observability & logging
  • Links to docs
  • Update the pipeline chapter with changes in the old Getting Started tutorial

@mat-hek mat-hek requested review from varsill and Noarkhh September 14, 2023 09:57
@mat-hek mat-hek requested a review from FelonEkonom September 25, 2023 15:23

### Membrane packages

To embrace modularity, Membrane is delivered to you in multiple packages, including plugins, formats, core and standalone libraries. The complete list of all the Membrane packages maintained by the Membrane team is available [here](https://github.com/membraneframework/membrane_core/Membrane-packages).
Copy link
Member

Choose a reason for hiding this comment

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

The callback is called whenever a buffer arrives on a pad, and receives four arguments:
- the pad where the buffer arrived,
- the [Membrane.Buffer](https://hexdocs.pm/membrane_core/Membrane.Buffer.html) structure carrying the stream data,
- [Membrane.Element.CallbackContext](https://hexdocs.pm/membrane_core/Membrane.Element.CallbackContext.html), providing some useful information about the element,
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
- [Membrane.Element.CallbackContext](https://hexdocs.pm/membrane_core/Membrane.Element.CallbackContext.html), providing some useful information about the element,
- [Membrane.Element.CallbackContext.t()](https://hexdocs.pm/membrane_core/Membrane.Element.CallbackContext.html#t:t/0), providing some useful information about the element,

Copy link
Member Author

Choose a reason for hiding this comment

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

is there any difference?

Copy link
Member

Choose a reason for hiding this comment

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

typespec vs module

Copy link
Member

@FelonEkonom FelonEkonom Sep 27, 2023

Choose a reason for hiding this comment

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

Especially this typespec describes a map, not a structure

Comment on lines +9 to +11
## Bin's pads

Bin's pads are defined and linked similarly to element's pads. However, their role is limited to proxy the stream to other elements and bins inside (inputs) or outside (outputs). To achieve that, each input pad of a bin needs to be linked to both an output pad from the outside of a bin and an input pad of its child inside. Accordingly, each bin's output should be linked to output inside and input outside of the bin.
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to have an example showing how to link bin's pad from inside, using bin_input/1 and bin_output/2

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'll do that in a separate PR


```elixir
import Config
config :membrane_core, :logger, verbose: true
Copy link
Member

Choose a reason for hiding this comment

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

I would notice, that it is necessary to recompile modules after changing this config

Copy link
Member Author

Choose a reason for hiding this comment

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

done

mat-hek and others added 2 commits September 27, 2023 15:36
Co-authored-by: Feliks Pobiedziński <38541925+FelonEkonom@users.noreply.github.com>
Co-authored-by: Feliks Pobiedziński <38541925+FelonEkonom@users.noreply.github.com>
* `:auto` - Membrane automatically manages the flow control. It works under the assumption that the element does not need to block or slow down the processing rate, it just processes or consumes the stream as it flows. This option is not available for `Source` elements.
* `:manual` - You need to manually control the flow control by using the `demand` action on `input` pads and implementing the `handle_demand` callback for `output` pads.
* `:push` - It's a simple mode where an element producing data pushes it right away through the `output` pad. An `input` pad in this mode should be always ready to process that data.
* `demand_unit` - Either `:bytes` or `:buffers`, specifies what unit will be used to request or receive demands. Must be specified if `flow_control` is set to `:manual`.
Copy link
Member

Choose a reason for hiding this comment

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

++ And direction is input


* `accepted_format` - a pattern for a stream format expected on the pad, for example `%Membrane.RawAudio{channels: 2}`. It serves documentation purposes and is validated in runtime.
* `flow_control` - configures how back pressure should be handled on the pad. You can choose from the following options:
* `auto` - Membrane automatically manages the flow control. It works under the assumption that the element does not need to block or slow down the processing rate, it just processes or consumes the stream as it flows. This option is not available for `Source` elements.
Copy link
Member

Choose a reason for hiding this comment

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

Comment above is still valid

@mat-hek mat-hek requested a review from FelonEkonom October 4, 2023 11:57
@mat-hek mat-hek merged commit 2dcd1d2 into main Oct 4, 2023
@mat-hek mat-hek deleted the guide branch October 4, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants