Update return values in callbacks to reflect 1.0 spec#103
Update return values in callbacks to reflect 1.0 spec#103kidq330 merged 5 commits intomembraneframework:mainfrom
Conversation
basic_pipeline/07_Redemands.md
Outdated
| In the [source elements](../glossary/glossary.md#source), there is a "side-channel", from which we can receive data. That "side-channel" can be, as in the exemplary [pipeline](../glossary/glossary.md#pipeline) we are working on, in form of a file, from which we are reading the data. In real-life scenarios it could be also, i.e. an [RTP](../glossary/glossary.md#rtp) stream received via the network. Since we have that "side-channel", there is no need to receive data via the input [pad](../glossary/glossary.md#pad) (that is why we don't have it in the source element, do we?). | ||
| The whole logic of fetching the data can be put inside the `handle_demand/5` callback - once we are asked to provide the [buffers](../glossary/glossary.md#buffer), the `handle_demand/5` callback gets called and we can provide the desired number of buffers from the "side-channel", inside the body of that callback. No processing occurs here - we get asked for the buffer and we provide the buffer, simple as that. | ||
| The redemand mechanism here lets you focus on providing a single buffer in the `handle_demand/5` body - later on, you can simply return the `:redemand` action and that action will invoke the `handle_demand/5` once again, with the updated number of buffers which are expected to be provided. Let's see it in an example - we could have such a `handle_demand/5` definition (and it wouldn't be a mistake!): | ||
| In the [source elements](../glossary/glossary.md#source), there is a "side-channel", from which we can receive data. That "side-channel" can be, as in the example [pipeline](../glossary/glossary.md#pipeline) we are working on, in the form of a file, from which we are reading the data. In real-life scenarios it could also be, i.e. an [RTP](../glossary/glossary.md#rtp) stream received via the network. Since we have that "side-channel", there is no need to receive data via the input [pad](../glossary/glossary.md#pad) (that is why we don't have it in the source element). |
There was a problem hiding this comment.
| In the [source elements](../glossary/glossary.md#source), there is a "side-channel", from which we can receive data. That "side-channel" can be, as in the example [pipeline](../glossary/glossary.md#pipeline) we are working on, in the form of a file, from which we are reading the data. In real-life scenarios it could also be, i.e. an [RTP](../glossary/glossary.md#rtp) stream received via the network. Since we have that "side-channel", there is no need to receive data via the input [pad](../glossary/glossary.md#pad) (that is why we don't have it in the source element). | |
| In the [source elements](../glossary/glossary.md#source), there is a "side-channel", from which we can receive data. That "side-channel" can be, as in the example [pipeline](../glossary/glossary.md#pipeline) we are working on, in the form of a file, from which we are reading the data. In real-life scenarios it could also be, e.g. an [RTP](../glossary/glossary.md#rtp) stream received via the network. Since we have that "side-channel", there is no need to receive data via the input [pad](../glossary/glossary.md#pad) (that is why we don't have it in the source element). |
I just spotted this one as well :D
varsill
left a comment
There was a problem hiding this comment.
Ups, sorry for the last comment, I haven't noticed that there are still these old API leftovers in the code :D
broadcasting/05_RTMP_Pipeline.md
Outdated
| children: %{ | ||
| src: %Membrane.RTMP.SourceBin{port: 9009}, | ||
| sink: %Membrane.HTTPAdaptiveStream.SinkBin{ | ||
| manifest_module: Membrane.HTTPAdaptiveStream.HLS, | ||
| target_window_duration: 20 |> Membrane.Time.seconds(), | ||
| muxer_segment_duration: 8 |> Membrane.Time.seconds(), | ||
| storage: %Membrane.HTTPAdaptiveStream.Storages.FileStorage{directory: "output"} | ||
| } | ||
| }, |
There was a problem hiding this comment.
we don't use the children map anymore in the ChildrenSpec
broadcasting/05_RTMP_Pipeline.md
Outdated
| links: [ | ||
| link(:src) | ||
| |> via_out(:audio) | ||
| |> via_in(Pad.ref(:input, :audio), options: [encoding: :AAC]) | ||
| |> to(:sink), | ||
| link(:src) | ||
| |> via_out(:video) | ||
| |> via_in(Pad.ref(:input, :video), options: [encoding: :H264]) | ||
| |> to(:sink) |
There was a problem hiding this comment.
This one is also unfortunately outdated, we don't use links list at there is no more link/1 nor to/1 functions
broadcasting/05_RTMP_Pipeline.md
Outdated
| @impl true | ||
| def handle_init(_opts) do | ||
| ... | ||
| {[spec: spec, playback: :playing], %{}} |
There was a problem hiding this comment.
We don't have :playback action anymore, you can just remove it as we go to :playing playback right away if it's not explicitly specified not to do so
Co-authored-by: Łukasz Kita <lukasz.kita0@gmail.com>
varsill
left a comment
There was a problem hiding this comment.
I left two minor comments but generally - 🥇
broadcasting/05_RTMP_Pipeline.md
Outdated
| We refer to previously defined elements using `get_child` to also configure the `:video` pads, using `:H264` as the preferred encoding and a segment duration of 4 seconds. | ||
|
|
||
| The final thing that is done in the `handle_init/1` callback's implementation is returning the desired actions: | ||
| The final thing that is done in the `handle_init/1` callback's implementation is returning the pipeline structure through the `:spec` action: |
There was a problem hiding this comment.
It's handle_init/2 right now as now all the callbacks have context as their argument.
broadcasting/05_RTMP_Pipeline.md
Outdated
| manifest_module: Membrane.HTTPAdaptiveStream.HLS, | ||
| target_window_duration: 20 |> Membrane.Time.seconds(), | ||
| muxer_segment_duration: 8 |> Membrane.Time.seconds(), | ||
| target_window_duration: :infinity, |
There was a problem hiding this comment.
why do we want to change it?
There was a problem hiding this comment.
No description provided.