Skip to content

Commit

Permalink
Merge pull request #25 from membraneframework/bump-unifex-0.7.0
Browse files Browse the repository at this point in the history
Bump unifex to 0.7.0
  • Loading branch information
agga1 authored Sep 22, 2021
2 parents 3efa5d9 + 55d1838 commit 86f8e76
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 24 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Membrane AAC FDK plugin

[![Hex.pm](https://img.shields.io/hexpm/v/membrane_aac_fdk_plugin.svg)](https://hex.pm/packages/membrane_aac_fdk_plugin)
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_aac_fdk_plugin/)
[![CircleCI](https://circleci.com/gh/membraneframework/membrane_aac_fdk_plugin.svg?style=svg)](https://circleci.com/gh/membraneframework/membrane_aac_fdk_plugin)
Expand All @@ -16,32 +17,38 @@ The package can be installed by adding `membrane_aac_fdk_plugin` to your list of
```elixir
def deps do
[
{:membrane_aac_fdk_plugin, "~> 0.6.1"}
{:membrane_aac_fdk_plugin, "~> 0.8.0"}
]
end
```

This package depends on [FDK-AAC](https://github.com/mstorsjo/fdk-aac) library.

### Ubuntu
(Make sure you have Multiverse repository enabled. See: https://help.ubuntu.com/community/Repositories/Ubuntu)

(Make sure you have Multiverse repository enabled. See: <https://help.ubuntu.com/community/Repositories/Ubuntu>)

```
sudo apt-get install libfdk-aac-dev
```

### Arch/Manjaro

```
pacman -S libfdk-aac
```

### MacOS

```
brew install fdk-aac
```

## Usage

### Encoder
The following pipeline takes wav file as input and encodes it as AAC.

The following pipeline takes wav file as input and encodes it as AAC.

```elixir
defmodule AAC.Pipeline do
Expand All @@ -67,8 +74,11 @@ defmodule AAC.Pipeline do
end
end
```

### Decoder
The following pipeline takes AAC file as input and plays it on speakers.

The following pipeline takes AAC file as input and plays it on speakers.

```elixir
defmodule AAC.Pipeline do
use Membrane.Pipeline
Expand Down Expand Up @@ -99,6 +109,7 @@ defmodule AAC.Pipeline do
end
end
```

## Copyright and License

Copyright 2018, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane)
Expand Down
10 changes: 5 additions & 5 deletions c_src/membrane_aac_fdk_plugin/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ UNIFEX_TERM decode_frame(UnifexEnv *env, UnifexPayload *in_payload,

UINT out_payload_size =
stream_info->frameSize * stream_info->numChannels * sizeof(INT_PCM);
UnifexPayload *out_payload =
unifex_payload_alloc(env, in_payload->type, out_payload_size);
memcpy(out_payload->data, state->decoder_buffer, out_payload_size);
UnifexPayload out_payload;
unifex_payload_alloc(env, in_payload->type, out_payload_size, &out_payload);
memcpy(out_payload.data, state->decoder_buffer, out_payload_size);

res = decode_frame_result_ok(env, out_payload);
unifex_payload_release_ptr(&out_payload);
res = decode_frame_result_ok(env, &out_payload);
unifex_payload_release(&out_payload);
return res;
}

Expand Down
11 changes: 6 additions & 5 deletions c_src/membrane_aac_fdk_plugin/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,12 @@ UNIFEX_TERM encode_frame(UnifexEnv *env, UnifexPayload *in_payload,
return encode_frame_result_error_no_data(env);
}

UnifexPayload *out_payload =
unifex_payload_alloc(env, UNIFEX_PAYLOAD_BINARY, out_args.numOutBytes);
memcpy(out_payload->data, state->aac_buffer, out_args.numOutBytes);
res = encode_frame_result_ok(env, out_payload);
unifex_payload_release_ptr(&out_payload);
UnifexPayload out_payload;
unifex_payload_alloc(env, UNIFEX_PAYLOAD_BINARY, out_args.numOutBytes,
&out_payload);
memcpy(out_payload.data, state->aac_buffer, out_args.numOutBytes);
res = encode_frame_result_ok(env, &out_payload);
unifex_payload_release(&out_payload);
return res;
}

Expand Down
10 changes: 5 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.AAC.FDK.Plugin.MixProject do
use Mix.Project

@version "0.7.0"
@version "0.8.0"
@github_url "https://github.com/membraneframework/membrane_aac_fdk_plugin"

def project do
Expand Down Expand Up @@ -54,11 +54,11 @@ defmodule Membrane.AAC.FDK.Plugin.MixProject do
defp deps do
[
{:membrane_core, "~> 0.7.0"},
{:membrane_common_c, "~> 0.8.0"},
{:membrane_common_c, "~> 0.9.0"},
{:bunch, "~> 1.0"},
{:ex_doc, "~> 0.23", only: :dev, runtime: false},
{:dialyxir, "~> 1.0.0", only: [:dev], runtime: false},
{:unifex, "~> 0.6.0"},
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
{:dialyxir, "~> 1.1", only: [:dev], runtime: false},
{:unifex, "~> 0.7.0"},
{:membrane_caps_audio_raw, "~> 0.4.0"},
{:membrane_file_plugin, "~> 0.6.0", only: [:dev, :test]}
]
Expand Down
10 changes: 5 additions & 5 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"bunch_native": {:hex, :bunch_native, "0.4.0", "9214f73b753c7c4201fc0a1145d9720a15e45effa02d9eea8237d98ae53b36e5", [:mix], [{:bundlex, "~> 0.5.0", [hex: :bundlex, repo: "hexpm", optional: false]}], "hexpm", "4bf7e84250614994383870092e883bc8b7e213c3854506b1a03493bd9a6a1ba2"},
"bundlex": {:hex, :bundlex, "0.5.0", "2be5374bd58fcdccb0e08fe5b6839baa081eb2ee73b85958122ec78160e19aa4", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.5", [hex: :qex, repo: "hexpm", optional: false]}, {:secure_random, "~> 0.5", [hex: :secure_random, repo: "hexpm", optional: false]}], "hexpm", "c459b5f19d759821dfd269abd03259dc0411d02ec1efdd350b7e15a3021f1aa9"},
"coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"},
"dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"},
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
"earmark": {:hex, :earmark, "1.4.2", "3aa0bd23bc4c61cf2f1e5d752d1bb470560a6f8539974f767a38923bb20e1d7f", [:mix], [], "hexpm", "5e8806285d8a3a8999bd38e4a73c58d28534c856bc38c44818e5ba85bbda16fb"},
"earmark_parser": {:hex, :earmark_parser, "1.4.13", "0c98163e7d04a15feb62000e1a891489feb29f3d10cb57d4f845c405852bbef8", [:mix], [], "hexpm", "d602c26af3a0af43d2f2645613f65841657ad6efc9f0e361c3b6c06b578214ba"},
"earmark_parser": {:hex, :earmark_parser, "1.4.15", "b29e8e729f4aa4a00436580dcc2c9c5c51890613457c193cc8525c388ccb2f06", [:mix], [], "hexpm", "044523d6438ea19c1b8ec877ec221b008661d3c27e3b848f4c879f500421ca5c"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.24.2", "e4c26603830c1a2286dae45f4412a4d1980e1e89dc779fcd0181ed1d5a05c8d9", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e134e1d9e821b8d9e4244687fb2ace58d479b67b282de5158333b0d57c6fb7da"},
"ex_doc": {:hex, :ex_doc, "0.25.2", "4f1cae793c4d132e06674b282f1d9ea3bf409bcca027ddb2fe177c4eed6a253f", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5b0c172e87ac27f14dfd152d52a145238ec71a95efbf29849550278c58a393d6"},
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"membrane_caps_audio_raw": {:hex, :membrane_caps_audio_raw, "0.4.0", "6a94d2e22c89d8995bfa3b00954ee25f0d441295d64e9a8ed153acb9149df54c", [:mix], [{:bimap, "~> 1.0", [hex: :bimap, repo: "hexpm", optional: false]}, {:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:membrane_core, "~> 0.7.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "afba3a49c9c9862a58ab118de13e3d267f567e37266741c679ed446e03fa3a70"},
"membrane_common_c": {:hex, :membrane_common_c, "0.8.0", "03935f19046cc89746b5c23d173f2b0c9962f5140e577b9211609fb936b2b519", [:mix], [{:membrane_core, "~> 0.7.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:shmex, "~> 0.4.0", [hex: :shmex, repo: "hexpm", optional: false]}, {:unifex, "~> 0.6.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "0f9145b2af272e2313ca1638c7613a50981a4e4604bb46f163f7ae7aa50031f4"},
"membrane_common_c": {:hex, :membrane_common_c, "0.9.0", "696c631acd34e3e7eea66e1da84fc6b37e51465f44b193f2fead3c2bcad59aed", [:mix], [{:membrane_core, "~> 0.7.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:shmex, "~> 0.4.0", [hex: :shmex, repo: "hexpm", optional: false]}, {:unifex, "~> 0.7.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "5f94b0a9667a988e8abe3b863d902e6cf6ea7e2047820855a3d863ef82b3c190"},
"membrane_core": {:hex, :membrane_core, "0.7.0", "fc773f3b79ad3b5631c3a0754c429b333a4e024989aa4a63e49aa796d2fa1bd8", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4d04d42712d5548cf22993d85a7fdee9f4b6dfe31500ed299ed692fabdbc9824"},
"membrane_element_file": {:hex, :membrane_element_file, "0.3.0", "45a7e5d42f794253752f14d15db3749596f32f44e42cc4e001c6b426915fdf4f", [:mix], [{:membrane_core, "~> 0.5.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "a80ad07f8c772c7c420ded2ef67f3fc9c55c736a2cd94a02fb0f33853b83d10e"},
"membrane_file_plugin": {:hex, :membrane_file_plugin, "0.6.0", "ddaaa67e9de7fd6f03aedb82b0c6f31110cdccce21adf4486af013b3eab943a1", [:mix], [{:membrane_core, "~> 0.7.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "9a570b96bd6f1053cc33eb47285efcf102532dafdbf78e96c39f6897b01d287e"},
Expand All @@ -25,5 +25,5 @@
"secure_random": {:hex, :secure_random, "0.5.1", "c5532b37c89d175c328f5196a0c2a5680b15ebce3e654da37129a9fe40ebf51b", [:mix], [], "hexpm", "1b9754f15e3940a143baafd19da12293f100044df69ea12db5d72878312ae6ab"},
"shmex": {:hex, :shmex, "0.4.0", "8a074a984bbd45808d80eddfa0f037d7dfb4d4046e6566cd40adf41e13decf74", [:mix], [{:bunch_native, "~> 0.4.0", [hex: :bunch_native, repo: "hexpm", optional: false]}, {:bundlex, "~> 0.5.0", [hex: :bundlex, repo: "hexpm", optional: false]}], "hexpm", "1018c4eca1db5352ed4dec4813e1ee212b98fc851e1edd302906892538bbfaa8"},
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
"unifex": {:hex, :unifex, "0.6.0", "74df301350722227e0e6243a4c729be0c58759bc3661378548b473883be78c38", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:bundlex, "~> 0.5.0", [hex: :bundlex, repo: "hexpm", optional: false]}, {:shmex, "~> 0.4.0", [hex: :shmex, repo: "hexpm", optional: false]}], "hexpm", "b7a2b7da941aa0ae32c4659a317e0dcc02216557bc3c522b510eb4e466ddced0"},
"unifex": {:hex, :unifex, "0.7.0", "43b876f19a6f9e1849762d90ac2242698a8318199e4b6b92d18274873c733bec", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:bundlex, "~> 0.5.0", [hex: :bundlex, repo: "hexpm", optional: false]}, {:shmex, "~> 0.4.0", [hex: :shmex, repo: "hexpm", optional: false]}], "hexpm", "dac9366611d82d647df5c604638caac0c26951d62892e19cacff3bf7d37556f8"},
}

0 comments on commit 86f8e76

Please sign in to comment.