-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
155 additions
and
32 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,23 @@ | ||
defmodule ExWebRTC.RTP.Depayloader do | ||
@moduledoc """ | ||
Behaviour for ExWebRTC Depayloaders. | ||
""" | ||
|
||
@type depayloader :: struct() | ||
|
||
@doc """ | ||
Creates a new depayloader struct. | ||
Refer to the modules implementing the behaviour for available options. | ||
""" | ||
@callback new(options :: any()) :: depayloader() | ||
|
||
@doc """ | ||
Processes binary data from a single RTP packet, and outputs a frame if assembled. | ||
Returns the frame (or `nil` if a frame could not be decoded yet) | ||
together with the updated depayloader struct. | ||
""" | ||
@callback depayload(depayloader(), packet :: ExRTP.Packet.t()) :: | ||
{binary() | nil, 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
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,21 @@ | ||
defmodule ExWebRTC.RTP.Payloader do | ||
@moduledoc """ | ||
Behaviour for ExWebRTC Payloaders. | ||
""" | ||
|
||
@type payloader :: struct() | ||
|
||
@doc """ | ||
Creates a new payloader struct. | ||
Refer to the modules implementing the behaviour for available options. | ||
""" | ||
@callback new(options :: any()) :: payloader() | ||
|
||
@doc """ | ||
Packs a frame into one or more RTP packets. | ||
Returns the packets together with the updated payloader struct. | ||
""" | ||
@callback payload(payloader(), frame :: binary()) :: {[ExRTP.Packet.t()], payloader()} | ||
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