Skip to content

membraneframework/membrane_precompiled_dependency_provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Membrane Precompiled Dependency Provider

Hex.pm API Docs CircleCI

Package providing URLs for precompiled dependencies used by Membrane plugins.

Installation

The package can be installed by adding membrane_precompiled_dependency_provider to your list of dependencies in mix.exs:

def deps do
  [
    {:membrane_precompiled_dependency_provider, "~> 0.1.2"}
  ]
end

Usage

In most cases the package is intended to provide an URL to be used in your project's bundlex.exs. This text will assume familiarity with Bundlex and it's mechanism of managing precompiled dependencies, so if you're not acquainted with it you can read about it here.

Dependencies that are fully located in a correctly structured repository in membraneframework-precompiled github organization (details here) will be referred to as Generic. Otherwise they will be referred to as Non-generic.

The simplest example of natives/0 function in bundlex.exs, where we have an :example native that has an :example_dep Generic dependency:

defp natives() do
  [
    example: [
      interface: :nif,
      sources: ["example.c"],
      os_deps: [
        example_dep: 
        [{
          :precompiled, 
          Membrane.PrecompiledDependencyProvider.get_dependency_url(:example_dep)
        }]
      ],
      preprocessor: Unifex
    ]
  ]

Adding new dependencies

Pool of dependencies offered by this package can be expanded with new ones, Generic and Non-generic, by modifying lib/membrane_precompiled_dependency_provider.ex appropriately.

To add any dependency start by adding it's name as one of possible values of precompiled_dependencies() type:

@type precompiled_dependency() :: ... | :example_dep

When the dependency is Generic (is present on membraneframework-precompiled) that is all you need to do.

Adding Non-generic dependencies

When the precompiled builds of a dependency are already hosted somewhere else they can be added as a Non-generic dependency.

To achieve this create a clause of get_non_generic_dep_url/2 that pattern-matches on your dependency's name and returns an URL appropriate for the passed target:

defp get_non_generic_dep_url(:example_non_generic_dep, target) do
  ...
end

For an example see implementation for :ffmpeg.

Copyright and License

Copyright 2023, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0

About

Provides URLs for precompiled dependencies used by Membrane plugins.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages