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

Handle AOT specific channels. Bump to v0.18.2 #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The package can be installed by adding `membrane_aac_plugin` to your list of dep
```elixir
def deps do
[
{:membrane_aac_plugin, "~> 0.18.1"}
{:membrane_aac_plugin, "~> 0.18.2"}
]
end
```
Expand Down
4 changes: 2 additions & 2 deletions lib/membrane/aac/parser/audio_specific_config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule Membrane.AAC.Parser.AudioSpecificConfig do
depends_on_core_coder::1, extension_flag::1>>
end

@spec parse_audio_specific_config(binary()) :: AAC.t()
@spec parse_audio_specific_config(binary()) :: map()
def parse_audio_specific_config(audio_specific_config) do
<<profile::5, frequency_id::4, audio_specific_config_rest::bitstring>> = audio_specific_config

Expand All @@ -37,7 +37,7 @@ defmodule Membrane.AAC.Parser.AudioSpecificConfig do
do: custom_frequency,
else: AAC.sampling_frequency_id_to_sample_rate(frequency_id)

%AAC{
%{
profile: AAC.aot_id_to_profile(profile),
mpeg_version: 4,
sample_rate: sample_rate,
Expand Down
17 changes: 15 additions & 2 deletions lib/membrane/aac/parser/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,23 @@ defmodule Membrane.AAC.Parser.Config do
""")
end)

esds_stream_format
esds_stream_format =
if esds_stream_format.channels == :AOT_specific do
# It means that the set of channels is described
# in the channel configutation, as specified by
# MPEG-4 p. 3, section 4.4.1.1.
# In our case it's sufficient
# to just read the number of channels
%{esds_stream_format | channels: stream_format.channels}
else
esds_stream_format
end

struct(AAC, esds_stream_format)

{:audio_specific_config, audio_specific_config} ->
AudioSpecificConfig.parse_audio_specific_config(audio_specific_config)
format = AudioSpecificConfig.parse_audio_specific_config(audio_specific_config)
struct(AAC, format)

nil ->
stream_format
Expand Down
2 changes: 1 addition & 1 deletion lib/membrane/aac/parser/esds.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule Membrane.AAC.Parser.Esds do
<<section_no, type_tag::binary, byte_size(payload), payload::binary>>
end

@spec parse_esds(binary()) :: AAC.t()
@spec parse_esds(binary()) :: map()
def parse_esds(esds) do
{section_3, <<>>} = unpack_esds_section(esds, 3)

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.AAC.MixProject do
use Mix.Project

@version "0.18.1"
@version "0.18.2"
@github_url "https://github.com/membraneframework/membrane_aac_plugin"

def project do
Expand Down
Loading