-
Notifications
You must be signed in to change notification settings - Fork 0
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
Change caps #9
Change caps #9
Conversation
maksstach
commented
Dec 6, 2021
- allow vp8/vp9 input caps
- allow passing stream parameters via caps
- allow serializing without providing width or height
lib/deserializer.ex
Outdated
@@ -91,7 +97,7 @@ defmodule Membrane.Element.IVF.Deserializer do | |||
Headers.parse_ivf_frame_header(payload), | |||
<<frame::binary-size(size_of_frame), rest::binary()>> <- rest do | |||
timestamp = timestamp * (timebase * Time.second()) | |||
{:ok, %Buffer{metadata: %{timestamp: timestamp}, payload: frame}, rest} | |||
{:ok, %Buffer{pts: timestamp, payload: frame}, rest} |
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.
Below in line 102 you can remove this {:error_too_short, payload}
as it is not handled anyways. It should work with skipping the else
block.
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.
it is used in line 72
lib/serializer.ex
Outdated
if state.first_frame do | ||
if state.width == 0 or state.height == 0, | ||
do: | ||
IO.warn("Serializing stream to IVF without width or height given via options or caps") |
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.
IO.warn("Serializing stream to IVF without width or height given via options or caps") | |
IO.warn("Serializing stream to IVF without width or height. These parameters can be passed via options or caps") |
lib/serializer.ex
Outdated
|
||
ivf_buffer = (ivf_file_header || "") <> ivf_frame | ||
|
||
{{:ok, buffer: {:output, %Buffer{buffer | payload: ivf_buffer}}, redemand: :output}, | ||
%State{state | first_frame: false}} | ||
end | ||
|
||
defp update_state(state, new_fields) 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.
update_state
and new_fields
are not really descriptive and self-explanatory, we need to find some better names for them. Maybe apply_caps_to_state
or update_state_with_caps
, and new_field
-> caps
.