Skip to content

Commit 4095ede

Browse files
authored
Fix issue with rejecting non-matching FMTP (#67)
1 parent 57d04fc commit 4095ede

File tree

14 files changed

+114
-178
lines changed

14 files changed

+114
-178
lines changed

examples/echo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ While in `examples/echo` directory
66

77
1. Run `mix deps.get`
88
2. Run `mix run --no-halt`
9-
3. Visit `http://127.0.0.1:8829` in your browser and press the `play` button.
9+
3. Visit `http://127.0.0.1:8829/index.html` in your browser and press the `play` button.

examples/echo/lib/echo/peer_handler.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ defmodule Echo.PeerHandler do
1919
%RTPCodecParameters{
2020
payload_type: 96,
2121
mime_type: "video/VP8",
22-
clock_rate: 90_000,
23-
channels: nil,
24-
sdp_fmtp_line: nil,
25-
rtcp_fbs: []
22+
clock_rate: 90_000
2623
}
2724
]
2825

@@ -31,8 +28,7 @@ defmodule Echo.PeerHandler do
3128
payload_type: 111,
3229
mime_type: "audio/opus",
3330
clock_rate: 48_000,
34-
channels: 2,
35-
sdp_fmtp_line: %ExSDP.Attribute.FMTP{pt: 111, minptime: 10, useinbandfec: true}
31+
channels: 2
3632
}
3733
]
3834

examples/echo/lib/echo/router.ex

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
defmodule Echo.Router do
22
use Plug.Router
33

4-
@assets "assets"
5-
4+
plug(Plug.Static, at: "/", from: "assets")
65
plug(:match)
76
plug(:dispatch)
87

9-
get "/" do
10-
send_file(conn, 200, "#{@assets}/index.html")
11-
end
12-
13-
get "/script.js" do
14-
send_file(conn, 200, "#{@assets}/script.js")
15-
end
16-
178
get "/ws" do
189
WebSockAdapter.upgrade(conn, Echo.PeerHandler, %{}, [])
1910
end

examples/echo/mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"elixir_make": {:hex, :elixir_make, "0.7.8", "505026f266552ee5aabca0b9f9c229cbb496c689537c9f922f3eb5431157efc7", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "7a71945b913d37ea89b06966e1342c85cfe549b15e6d6d081e8081c493062c07"},
99
"elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"},
1010
"ex_dtls": {:hex, :ex_dtls, "0.15.0", "71a11b0379f4ebeb781548ead0e72194e650cfb6d6c435015c8b36e9e5574f62", [:mix], [{:unifex, "~> 1.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "3ff1d9ef6c4b0cc800105979c1c58dc67cada91c593beeae56e05094fdbce865"},
11-
"ex_ice": {:hex, :ex_ice, "0.5.0", "8e380afb611b4d48a74d4a8016a0284ed11c77400230e2840e2476856cf6d572", [:mix], [{:ex_stun, "~> 0.1.0", [hex: :ex_stun, repo: "hexpm", optional: false]}], "hexpm", "d5a9d5d4b54650385a9b5365b38d919d5158ab2fec5c13669ae45db494516bb6"},
11+
"ex_ice": {:hex, :ex_ice, "0.6.0", "7deb747f3813501a34b1103a8243981beed07767512d2b7007ee2c61e43b5f83", [:mix], [{:ex_stun, "~> 0.1.0", [hex: :ex_stun, repo: "hexpm", optional: false]}], "hexpm", "743917f921c26f12c13a096e93299b7a61bda0a6a44fe202e6fc5d0e2d5154af"},
1212
"ex_libsrtp": {:hex, :ex_libsrtp, "0.7.2", "211bd89c08026943ce71f3e2c0231795b99cee748808ed3ae7b97cd8d2450b6b", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:bundlex, "~> 1.3", [hex: :bundlex, repo: "hexpm", optional: false]}, {:membrane_precompiled_dependency_provider, "~> 0.1.0", [hex: :membrane_precompiled_dependency_provider, repo: "hexpm", optional: false]}, {:unifex, "~> 1.1", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "2e20645d0d739a4ecdcf8d4810a0c198120c8a2f617f2b75b2e2e704d59f492a"},
1313
"ex_rtcp": {:hex, :ex_rtcp, "0.1.0", "2e02d23fc6ccc7e00aed13358ffdbcb23e34d3a7f35c66cadaa54447383ecae4", [:mix], [], "hexpm", "1c9a7e636f3950fbcefedce31f3e4ca60b84ea80ad519789f9d215167c60cb2b"},
1414
"ex_rtp": {:hex, :ex_rtp, "0.3.0", "d18d0de39875958902816284f79c8cd51ec83d39bdd14edf6a5b069926268a43", [:mix], [], "hexpm", "cec8398237095b02438842cfc74487c3cbaeb7fe29e4c62ae11457a0ddd99754"},

examples/save_to_file/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ While in `examples/save_to_file` directory
66

77
1. Run `mix deps.get`
88
2. Run `mix run --no-halt`
9-
3. Visit `http://127.0.0.1:8829` in your browser.
9+
3. Visit `http://127.0.0.1:8829/index.html` in your browser.
1010
4. Press the `Start` button to start recording.
1111
5. Press the `Stop` button to stop recording.
1212

examples/save_to_file/lib/save_to_file/peer_handler.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ defmodule SaveToFile.PeerHandler do
2525
%RTPCodecParameters{
2626
payload_type: 96,
2727
mime_type: "video/VP8",
28-
clock_rate: 90_000,
29-
channels: nil,
30-
sdp_fmtp_line: nil,
31-
rtcp_fbs: []
28+
clock_rate: 90_000
3229
}
3330
]
3431

@@ -37,8 +34,7 @@ defmodule SaveToFile.PeerHandler do
3734
payload_type: 111,
3835
mime_type: "audio/opus",
3936
clock_rate: 48_000,
40-
channels: 2,
41-
sdp_fmtp_line: %ExSDP.Attribute.FMTP{pt: 111, minptime: 10, useinbandfec: true}
37+
channels: 2
4238
}
4339
]
4440

examples/save_to_file/lib/save_to_file/router.ex

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
defmodule SaveToFile.Router do
22
use Plug.Router
33

4-
@assets "assets"
5-
4+
plug(Plug.Static, at: "/", from: "assets")
65
plug(:match)
76
plug(:dispatch)
87

9-
get "/" do
10-
send_file(conn, 200, "#{@assets}/index.html")
11-
end
12-
13-
get "/script.js" do
14-
send_file(conn, 200, "#{@assets}/script.js")
15-
end
16-
178
get "/ws" do
189
WebSockAdapter.upgrade(conn, SaveToFile.PeerHandler, %{}, [])
1910
end

examples/save_to_file/mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"elixir_make": {:hex, :elixir_make, "0.7.8", "505026f266552ee5aabca0b9f9c229cbb496c689537c9f922f3eb5431157efc7", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "7a71945b913d37ea89b06966e1342c85cfe549b15e6d6d081e8081c493062c07"},
99
"elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"},
1010
"ex_dtls": {:hex, :ex_dtls, "0.15.0", "71a11b0379f4ebeb781548ead0e72194e650cfb6d6c435015c8b36e9e5574f62", [:mix], [{:unifex, "~> 1.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "3ff1d9ef6c4b0cc800105979c1c58dc67cada91c593beeae56e05094fdbce865"},
11-
"ex_ice": {:hex, :ex_ice, "0.5.0", "8e380afb611b4d48a74d4a8016a0284ed11c77400230e2840e2476856cf6d572", [:mix], [{:ex_stun, "~> 0.1.0", [hex: :ex_stun, repo: "hexpm", optional: false]}], "hexpm", "d5a9d5d4b54650385a9b5365b38d919d5158ab2fec5c13669ae45db494516bb6"},
11+
"ex_ice": {:hex, :ex_ice, "0.6.0", "7deb747f3813501a34b1103a8243981beed07767512d2b7007ee2c61e43b5f83", [:mix], [{:ex_stun, "~> 0.1.0", [hex: :ex_stun, repo: "hexpm", optional: false]}], "hexpm", "743917f921c26f12c13a096e93299b7a61bda0a6a44fe202e6fc5d0e2d5154af"},
1212
"ex_libsrtp": {:hex, :ex_libsrtp, "0.7.2", "211bd89c08026943ce71f3e2c0231795b99cee748808ed3ae7b97cd8d2450b6b", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:bundlex, "~> 1.3", [hex: :bundlex, repo: "hexpm", optional: false]}, {:membrane_precompiled_dependency_provider, "~> 0.1.0", [hex: :membrane_precompiled_dependency_provider, repo: "hexpm", optional: false]}, {:unifex, "~> 1.1", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "2e20645d0d739a4ecdcf8d4810a0c198120c8a2f617f2b75b2e2e704d59f492a"},
1313
"ex_rtcp": {:hex, :ex_rtcp, "0.1.0", "2e02d23fc6ccc7e00aed13358ffdbcb23e34d3a7f35c66cadaa54447383ecae4", [:mix], [], "hexpm", "1c9a7e636f3950fbcefedce31f3e4ca60b84ea80ad519789f9d215167c60cb2b"},
1414
"ex_rtp": {:hex, :ex_rtp, "0.3.0", "d18d0de39875958902816284f79c8cd51ec83d39bdd14edf6a5b069926268a43", [:mix], [], "hexpm", "cec8398237095b02438842cfc74487c3cbaeb7fe29e4c62ae11457a0ddd99754"},

examples/send_from_file/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ You may use your own files, if they meet the requirements:
1717

1818
2. Run `mix deps.get`
1919
3. Run `mix run --no-halt`
20-
4. Visit `http://127.0.0.1:8829` in your browser and press the `play` button.
20+
4. Visit `http://127.0.0.1:8829/index.html` in your browser and press the `play` button.
2121

2222
The video and audio will loop infinitely.

examples/send_from_file/lib/send_from_file/peer_handler.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ defmodule SendFromFile.PeerHandler do
2929
%RTPCodecParameters{
3030
payload_type: 96,
3131
mime_type: "video/VP8",
32-
clock_rate: 90_000,
33-
channels: nil,
34-
sdp_fmtp_line: nil,
35-
rtcp_fbs: []
32+
clock_rate: 90_000
3633
}
3734
]
3835

@@ -41,8 +38,7 @@ defmodule SendFromFile.PeerHandler do
4138
payload_type: 111,
4239
mime_type: "audio/opus",
4340
clock_rate: 48_000,
44-
channels: 2,
45-
sdp_fmtp_line: %ExSDP.Attribute.FMTP{pt: 111, minptime: 10, useinbandfec: true}
41+
channels: 2
4642
}
4743
]
4844

0 commit comments

Comments
 (0)