# `Membrane.PrecompiledDependencyProvider`
[🔗](https://github.com/membraneframework/membrane_precompiled_dependency_provider/blob/v0.2.3/lib/membrane_precompiled_dependency_provider.ex#L1)

Module providing URLs for precompiled dependencies used by Membrane plugins.

Dependencies that are fully located in the repositories of `membraneframework-precompiled` will
be referred to as generic. Otherwise they will be referred to as non-generic.

# `precompiled_dependency`

```elixir
@type precompiled_dependency() :: atom()
```

An atom representing a dependency.

Dependency can be non-generic, which is handled in `get_dependency_url/2`, such as `:ffmpeg`, 
or generic, which has a corresponding repository in 
https://github.com/membraneframework-precompiled organization, such as `:opus` or `:libvpx`. 

# `version_config`

```elixir
@type version_config() :: [{precompiled_dependency(), String.t()}]
```

List of desired versions of the precompiled dependencies.

If an application requires specific versions of used precompiled dependencies, they can be specified
by passing such list to a `Config.config/3` function with `:membrane_precompiled_dependency_provider`
root key and `:versions` key, like so 

    config :membrane_precompiled_dependency_provider, :versions,
      ffmpeg: "6.0.1",
      opus: "1.5.2"

# `get_dependency_url`

```elixir
@spec get_dependency_url(precompiled_dependency(), [{:version, String.t()}]) ::
  String.t() | nil
```

Get URL of a precompiled build of given dependency for a platform from which this function is being
called. 

A specific version of the dependency can be provided with `:version` option or through config 
(see `t:version_config/0`). If provided in both ways, the config value will be taken.
For generic dependencies this version needs to be the same as a release name from the
repository of the precompiled dependency, but without the leading "v". By default the latest
version is chosen.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
