Skip to content
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

Added sdputils.js from AppRTC project #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

janswee
Copy link

@janswee janswee commented Jun 27, 2019

sdputilsjs includes more custom control configuration of video/audio codec and bitrate in offer function.

Please refer to https://github.com/webrtc/apprtc/blob/master/src/web_app/js/sdputils.js

janswee added 2 commits June 26, 2019 21:44
Added sdputils.js from AppRTC project and used in offerfunction
@tgabi333
Copy link
Contributor

I'm not sure what is it is for?

@janswee
Copy link
Author

janswee commented Jun 27, 2019

sdputils.js is a collection of utility functions to munge/manipulate SDP offer.

One valid use case is setting a video codec preference of VP9 over VP8. VP9 requires less bandwidth/processing than VP8.

Using SimpleWebRTC, one can then set their video codec preference in the config object like so:


params: {
   videoRecvCodec: webrtcSupport.supportVp9 ? 'VP9' : 'VP8'
}

and then used in the RTCPeerConnection.offer function like so:

            //from AppRTC PeerConnectionClient.prototype.setLocalSdpAndNotify_() using sdputils.js
            offer.sdp = sdputils.maybePreferAudioReceiveCodec(offer.sdp, self.params_);
            offer.sdp = sdputils.maybePreferVideoReceiveCodec(offer.sdp, self.params_);
            offer.sdp = sdputils.maybeSetAudioReceiveBitRate(offer.sdp, self.params_);
            offer.sdp = sdputils.maybeSetVideoReceiveBitRate(offer.sdp, self.params_);
            offer.sdp = sdputils.maybeRemoveVideoFec(offer.sdp, self.params_);

@fippo
Copy link
Member

fippo commented Jun 27, 2019

SDP munging between createOffer and setLocalDescription is no longer valid in the spec.

If you want to do this I would suggest doing munging before signaling which makes it a non-issue for this library.

@janswee
Copy link
Author

janswee commented Jun 28, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants