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

Change caps #9

Closed
wants to merge 16 commits into from
Closed

Change caps #9

wants to merge 16 commits into from

Conversation

maksstach
Copy link
Contributor

  • allow vp8/vp9 input caps
  • allow passing stream parameters via caps
  • allow serializing without providing width or height

@@ -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}
Copy link
Contributor

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.

Copy link
Contributor Author

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

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")
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
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")


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
Copy link
Contributor

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.

@daniel-jodlos daniel-jodlos deleted the change-caps branch September 2, 2022 11:16
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