From b48e05f0499f9528a4d3cd7333c328bdeccb6979 Mon Sep 17 00:00:00 2001 From: Thomas Brewer Date: Wed, 21 Feb 2024 06:08:17 -0500 Subject: [PATCH 1/2] adding rtcp processing example --- examples/echo/lib/echo/peer_handler.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/echo/lib/echo/peer_handler.ex b/examples/echo/lib/echo/peer_handler.ex index b7ecff32..fef51723 100644 --- a/examples/echo/lib/echo/peer_handler.ex +++ b/examples/echo/lib/echo/peer_handler.ex @@ -127,6 +127,13 @@ defmodule Echo.PeerHandler do {:ok, state} end + # RTCP is used for statistics and control information for media in WebRTC. + # Using these packets you can get information about the quality of the media, round trip time and packet loss. + defp handle_webrtc_msg({:rtcp, _packets}, state) do + # do something with RTCP packets + {:ok, state} + end + defp handle_webrtc_msg({:rtp, id, packet}, %{in_audio_track_id: id} = state) do PeerConnection.send_rtp(state.peer_connection, state.out_audio_track_id, packet) {:ok, state} From 7e14e6a988ec255490c0bc42e9c223468638ea6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=9Aled=C5=BA?= Date: Wed, 21 Feb 2024 16:28:02 +0100 Subject: [PATCH 2/2] Remove comment about RTCP --- examples/echo/lib/echo/peer_handler.ex | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/echo/lib/echo/peer_handler.ex b/examples/echo/lib/echo/peer_handler.ex index fef51723..3a886eb8 100644 --- a/examples/echo/lib/echo/peer_handler.ex +++ b/examples/echo/lib/echo/peer_handler.ex @@ -127,8 +127,6 @@ defmodule Echo.PeerHandler do {:ok, state} end - # RTCP is used for statistics and control information for media in WebRTC. - # Using these packets you can get information about the quality of the media, round trip time and packet loss. defp handle_webrtc_msg({:rtcp, _packets}, state) do # do something with RTCP packets {:ok, state}