forked from membraneframework/membrane_agora_plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundlex.exs
53 lines (47 loc) · 1.4 KB
/
bundlex.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
defmodule Membrane.Agora.BundlexProject do
use Bundlex.Project
def get_target() do
[architecture, vendor, os | _rest] =
:erlang.system_info(:system_architecture) |> List.to_string() |> String.split("-")
%{
architecture: architecture,
vendor: vendor,
os: os
}
end
def project do
case get_target() do
%{os: "linux"} ->
System.shell("./install.sh")
other_target ->
IO.warn("Agora's Server Gateway SDK is unavailable for this target: #{inspect(other_target)}")
end
[
natives: natives(Bundlex.platform())
]
end
defp natives(_platform) do
[
sink: [
sources: ["sink.cpp", "connection_observer.cpp"],
includes: ["agora_sdk/include/"],
libs: ["agora_rtc_sdk", "agora-ffmpeg"],
lib_dirs: ["agora_sdk/"],
deps: [unifex: :unifex],
interface: [:nif],
preprocessor: Unifex,
language: :cpp
],
source: [
sources: ["source.cpp", "connection_observer.cpp", "source/sample_audio_frame_observer.cpp", "source/sample_video_encoded_frame_observer.cpp", "source/sample_local_user_observer.cpp"],
includes: ["agora_sdk/include/"],
libs: ["agora_rtc_sdk", "agora-ffmpeg"],
lib_dirs: ["agora_sdk/"],
deps: [unifex: :unifex],
interface: [:nif],
preprocessor: Unifex,
language: :cpp
]
]
end
end