-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add Serializer #2
Conversation
README.md
Outdated
@@ -4,7 +4,7 @@ | |||
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_wav_plugin) | |||
[![CircleCI](https://circleci.com/gh/membraneframework/membrane_wav_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_wav_plugin) | |||
|
|||
This repository provides WAV Parser. | |||
Plugin providing elements for managing WAV format. |
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.
Word managing
seem a bit out of place here
Plugin providing elements for managing WAV format. | |
Plugin providing elements handling audio in WAV file format. |
lib/membrane_wav/serializer.ex
Outdated
def_output_pad :output, | ||
mode: :pull, | ||
availability: :always, | ||
caps: 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.
Technically you're not outputing Raw format but rather WAV, so this requires a new _format
definition
lib/membrane_wav/serializer.ex
Outdated
caps: Caps | ||
|
||
@impl true | ||
def handle_init(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.
Nitpick, put init doesn't receive state
but rather options
struct passed defining pipeline spec
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.
That's true, I will change also in Parser
size = buffers_count * Caps.frames_to_bytes(frames, caps) | ||
|
||
{{:ok, demand: {:input, size}}, state} | ||
end | ||
|
||
@impl true | ||
def handle_process(:input, buffer, _context, state) do | ||
def handle_process(:input, buffer, _context, %{header_created: true} = 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.
I'd still add an explicit case raising with human readable error - now it might not be obvious why the element is failing from "Function clause error"
No description provided.