-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide VP8 and Opus Payloader/Depayloader modules #154
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## sgfn/payloader-behaviour #154 +/- ##
=========================================================
Coverage 88.51% 88.52%
=========================================================
Files 38 38
Lines 1907 1908 +1
=========================================================
+ Hits 1688 1689 +1
Misses 219 219
Continue to review full report in Codecov by Sentry.
|
lib/ex_webrtc/rtp/payloader.ex
Outdated
with {:ok, module} <- match_payloader_module(codec_params.mime_type) do | ||
payloader = if is_nil(options), do: module.new(), else: module.new(options) | ||
|
||
def new(codec_params, max_payload_size \\ 1000) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather see the max_payload_size
as an option in a keyword list. It makes it easier to add/remove options later on and is more conventional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you expect that there will never be a new option for the payloaders..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I thought about using protocols, too, but right now behaviours seem like the better approach
Sorry, I don't want to mess in your PR but I have a couple of observations:
ExWebRTC.RTP.Payloader
andExWebRTC.RTP.Depayloader
- user doesn't have to know about specific payloader/depayloader modulesnew
function has to be modified anywayAn alternative approach would be to use Protocols. The API would look like this:
This way, user can use RTP utils to automatically find payloader/depayloader or implement their own payloade/depayloader and still use our protocols.
This would be beneficial if we used those protocols internally, in PeerConnection but we don't right now.
Any thoughts?