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

Add an option to pass AudioSpecificConfig() #46

Merged
merged 5 commits into from
Sep 30, 2024
Merged

Conversation

Noarkhh
Copy link
Contributor

@Noarkhh Noarkhh commented Sep 23, 2024

No description provided.

@@ -8,6 +8,8 @@ defmodule Membrane.AAC.Parser do
If PTS is absent, it calculates and puts one based on the sample rate.
"""
use Membrane.Filter
require Membrane.Logger
alias Hex.State
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need that? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, lsp added that

default: nil,
description: """
Decoder configuration data AudioSpecificConfig() - if received
from a side channel it should be provided via this option.
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
from a side channel it should be provided via this option.
via side channel it should be provided via this option.

spec: binary() | nil,
default: nil,
description: """
Decoder configuration data AudioSpecificConfig() - if received
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also refer to ISO/IEC 14496-3 here

be additionally provided and will be encoded in the `esds`. If not known they should be set to 0.
Determines which config spec will be generated and included in output stream format as `config`:
- `esds` - the field will be an `esds` MP4 atom. `avg_bit_rate` and `max_bit_rate` can be
additionally provided and will be included in the `esds`. If not known they should be set to 0.
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
additionally provided and will be included in the `esds`. If not known they should be set to 0.
additionally provided and will be included in the `esds`. If not provided, they will be set to 0.

Comment on lines 123 to 126
non_nil_config ->
Membrane.Logger.warning(
"AAC config provided both with stream_format and options, ignoring the latter"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about a case where stream_format.config is not nil and state.audio_specific_config is nil? We shouldn't print that message then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also consider rewriting it with some cond clause as I think it could be more descriptive if you wrote something like: config == nil and state.audio_specific_config == nil

Copy link
Contributor

@varsill varsill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@Noarkhh Noarkhh merged commit ceb5d59 into master Sep 30, 2024
3 checks passed
@Noarkhh Noarkhh deleted the config-option branch September 30, 2024 09:15
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.

2 participants