-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactor demand mechanism #783
Conversation
58e7f3c
to
0f7b0ca
Compare
93bdfb4
to
9c309b0
Compare
# Match in the function below is caused by a fact, that handle_spec_started is the only callback, that | ||
# might be executed in between handling actions returned from other callbacks. | ||
# This callback has been deprecated and should be removed in v2.0.0, along with the if statement below. | ||
|
||
@impl CallbackHandler | ||
def handle_end_of_actions(state) do | ||
def handle_end_of_actions(:handle_spec_started, state), do: state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
element doesn't have this callback
@spec handle_buffer(Pad.ref(), [Buffer.t()] | Buffer.t(), State.t()) :: State.t() | ||
def handle_buffer(pad_ref, buffers, state) do | ||
@spec handle_ingoing_buffers(Pad.ref(), [Buffer.t()] | Buffer.t(), State.t()) :: State.t() | ||
def handle_ingoing_buffers(pad_ref, buffers, state) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def handle_ingoing_buffers(pad_ref, buffers, state) do | |
def handle_incoming_buffers(pad_ref, buffers, state) do |
if pad_data.direction == :input, | ||
do: raise("cannot snapshot atomic counter in input pad") | ||
if pad_data.direction == :input do | ||
raise("cannot snapshot atomic counter in input pad") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add pad ref
@@ -30,7 +30,7 @@ defmodule Membrane.Core.Element.DemandController do | |||
with {:ok, pad_data} when not pad_data.end_of_stream? <- PadModel.get_data(state, pad_ref), | |||
%State{playback: :playing} <- state do | |||
if pad_data.direction == :input do | |||
raise("cannot snapshot atomic counter in input pad") | |||
raise("cannot snapshot atomic counter in input pad #{inspect(pad_ref)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise("cannot snapshot atomic counter in input pad #{inspect(pad_ref)}") | |
raise Membrane.ElementError, "Cannot snapshot atomic counter in input pad #{inspect(pad_ref)}" |
@FelonEkonom BTW I recall you wanted to refactor |
94f6dbf
to
ad5612a
Compare
ad5612a
to
1430ecc
Compare
@mat-hek I know, but then I decided that I would rather focus more on the code related to |
Closes #706