Skip to content

Commit

Permalink
Start using Precompiled Dependency Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Noarkhh committed Dec 12, 2023
1 parent db76ea8 commit 032991e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Note: `Membrane.H264.FFmpeg.Parser` has been removed. Now you can use our pure E
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.

```elixir
{:membrane_h264_ffmpeg_plugin, "~> 0.31.3"}
{:membrane_h264_ffmpeg_plugin, "~> 0.31.4"}
```

This package depends on the [ffmpeg](https://www.ffmpeg.org) libraries. The precompiled builds will be pulled and linked automatically. However, should there be any problems, consider installing it manually.
Expand Down
28 changes: 4 additions & 24 deletions bundlex.exs
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
defmodule Membrane.H264.FFmpeg.BundlexProject do
use Bundlex.Project

defp get_ffmpeg_url() do
membrane_precompiled_url_prefix =
"https://github.com/membraneframework-precompiled/precompiled_ffmpeg/releases/latest/download/ffmpeg"

case Bundlex.get_target() do
%{architecture: "aarch64", os: "linux"} ->
"https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n6.0-latest-linuxarm64-gpl-shared-6.0.tar.xz"

%{os: "linux"} ->
"https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n6.0-latest-linux64-gpl-shared-6.0.tar.xz"

%{architecture: "x86_64", os: "darwin" <> _rest_of_os_name} ->
"#{membrane_precompiled_url_prefix}_macos_intel.tar.gz"

%{architecture: "aarch64", os: "darwin" <> _rest_of_os_name} ->
"#{membrane_precompiled_url_prefix}_macos_arm.tar.gz"

_other ->
nil
end
end

def project() do
[
natives: natives()
Expand All @@ -36,7 +14,8 @@ defmodule Membrane.H264.FFmpeg.BundlexProject do
sources: ["decoder.c"],
os_deps: [
ffmpeg: [
{:precompiled, get_ffmpeg_url(), ["libavcodec", "libavutil"]},
{:precompiled, Membrane.PrecompiledDependencyProvider.get_dependency_url(:ffmpeg),
["libavcodec", "libavutil"]},
{:pkg_config, ["libavcodec", "libavutil"]}
]
],
Expand All @@ -47,7 +26,8 @@ defmodule Membrane.H264.FFmpeg.BundlexProject do
sources: ["encoder.c"],
os_deps: [
ffmpeg: [
{:precompiled, get_ffmpeg_url(), ["libavcodec", "libavutil"]},
{:precompiled, Membrane.PrecompiledDependencyProvider.get_dependency_url(:ffmpeg),
["libavcodec", "libavutil"]},
{:pkg_config, ["libavcodec", "libavutil"]}
]
],
Expand Down
5 changes: 3 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.H264.FFmpeg.Plugin.MixProject do
use Mix.Project

@version "0.31.3"
@version "0.31.4"
@github_url "https://github.com/membraneframework/membrane_h264_ffmpeg_plugin"

def project do
Expand Down Expand Up @@ -40,7 +40,8 @@ defmodule Membrane.H264.FFmpeg.Plugin.MixProject do
[
{:bunch, "~> 1.6"},
{:bundlex, "~> 1.3"},
{:unifex, "~> 1.1.0"},
{:unifex, "~> 1.1"},
{:membrane_precompiled_dependency_provider, "~> 0.1.0"},
{:membrane_core, "~> 1.0"},
{:membrane_common_c, "~> 0.16.0"},
{:membrane_h264_format, "~> 0.6.1"},
Expand Down

0 comments on commit 032991e

Please sign in to comment.