Skip to content

Commit

Permalink
fix the video send bitrate params when not specifiying codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
KaptenJansson committed Sep 7, 2017
1 parent 62cd75a commit cb9954a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/web_app/js/sdputils.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,15 @@ function maybeSetVideoSendInitialBitRate(sdp, params) {
trace('Failed to find video m-line');
return sdp;
}

var codec = params.videoRecvCodec;
// Figure out the first codec payload type on the m=video SDP line.
var videoMLine = sdpLines[mLineIndex]
var pattern = new RegExp('m=video\\s\\d+\\s[A-Z\/]+\\s')
var sendPayloadType = videoMLine.split(pattern)[1].split(' ')[0]
var fmtpLine = sdpLines[findLine(sdpLines, 'a=rtpmap', sendPayloadType)]
var codecName = fmtpLine.split('a=rtpmap:' + sendPayloadType)[1].split('/')[0]

// Use codec from params if specified via URL param, otherwise use from SDP.
var codec = params.videoSendCodec || codecName;
sdp = setCodecParam(sdp, codec, 'x-google-min-bitrate',
params.videoSendInitialBitrate.toString());
sdp = setCodecParam(sdp, codec, 'x-google-max-bitrate',
Expand All @@ -205,6 +212,7 @@ function maybeSetVideoSendInitialBitRate(sdp, params) {
return sdp;
}


function removePayloadTypeFromMline(mLine, payloadType) {
mLine = mLine.split(' ');
for (var i = 0; i < mLine.length; ++i) {
Expand Down

0 comments on commit cb9954a

Please sign in to comment.