-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add G711 payloader and depayloader, update deps, release 0.6.3 (#173)
- Loading branch information
Showing
11 changed files
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule ExWebRTC.RTP.Depayloader.G711 do | ||
@moduledoc false | ||
# Decapsulates G.711 audio out of RTP packet. | ||
# | ||
# Based in [RFC 3551: RTP Profile for Audio and Video Conferences with Minimal Control, section 4.5.14](https://datatracker.ietf.org/doc/html/rfc3551#section-4.5.14) | ||
|
||
alias ExRTP.Packet | ||
|
||
@behaviour ExWebRTC.RTP.Depayloader.Behaviour | ||
|
||
@type t :: %__MODULE__{} | ||
|
||
defstruct [] | ||
|
||
@impl true | ||
@spec new() :: t() | ||
def new() do | ||
%__MODULE__{} | ||
end | ||
|
||
@impl true | ||
@spec depayload(t(), Packet.t()) :: {binary(), t()} | ||
def depayload(%__MODULE__{} = depayloader, %Packet{payload: payload}), | ||
do: {payload, depayloader} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule ExWebRTC.RTP.Payloader.G711 do | ||
@moduledoc false | ||
# Encapsulates G.711 audio packet into an RTP packet. | ||
# | ||
# Based in [RFC 3551: RTP Profile for Audio and Video Conferences with Minimal Control, section 4.5.14](https://datatracker.ietf.org/doc/html/rfc3551#section-4.5.14) | ||
|
||
@behaviour ExWebRTC.RTP.Payloader.Behaviour | ||
|
||
@type t :: %__MODULE__{} | ||
|
||
defstruct [] | ||
|
||
@impl true | ||
def new(_max_payload_size) do | ||
%__MODULE__{} | ||
end | ||
|
||
@impl true | ||
@spec payload(t(), binary()) :: {[ExRTP.Packet.t()], t()} | ||
def payload(%__MODULE__{} = payloader, packet) when packet != <<>> do | ||
{[ExRTP.Packet.new(packet)], payloader} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters