Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: chrome/test/data/webrtc/manual/peerconnection.js

Issue 23460010: Swap force OPUS to iSAC in peerconnection.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed ISAC > iSAC Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/webrtc/manual/peerconnection.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * Used as a shortcut. Moved to the top of the page due to race conditions. 8 * Used as a shortcut. Moved to the top of the page due to race conditions.
9 * @param {string} id is a case-sensitive string representing the unique ID of 9 * @param {string} id is a case-sensitive string representing the unique ID of
10 * the element being sought. 10 * the element being sought.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 createDtmfSenderOnPeerConnection(); 110 createDtmfSenderOnPeerConnection();
111 } 111 }
112 112
113 function insertDtmfFromHere() { 113 function insertDtmfFromHere() {
114 var tones = $('dtmf-tones').value; 114 var tones = $('dtmf-tones').value;
115 var duration = $('dtmf-tones-duration').value; 115 var duration = $('dtmf-tones-duration').value;
116 var gap = $('dtmf-tones-gap').value; 116 var gap = $('dtmf-tones-gap').value;
117 insertDtmfOnSender(tones, duration, gap); 117 insertDtmfOnSender(tones, duration, gap);
118 } 118 }
119 119
120 function forceOpusChanged() { 120 function forceIsacChanged() {
121 var forceOpus = $('force-opus').checked; 121 var forceIsac = $('force-isac').checked;
122 if (forceOpus) { 122 if (forceIsac) {
123 forceOpus_(); 123 forceIsac_();
124 } else { 124 } else {
125 dontTouchSdp_(); 125 dontTouchSdp_();
126 } 126 }
127 } 127 }
128 128
129 /** 129 /**
130 * Updates the constraints in the getusermedia-constraints text box with a 130 * Updates the constraints in the getusermedia-constraints text box with a
131 * MediaStreamConstraints string. This string is created based on the status of 131 * MediaStreamConstraints string. This string is created based on the status of
132 * the checkboxes for audio and video. If device enumeration is supported and 132 * the checkboxes for audio and video. If device enumeration is supported and
133 * device source id's are not null they will be added to the constraints string. 133 * device source id's are not null they will be added to the constraints string.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 // TODO(phoglund): We need to swap the a= lines too. I don't think this 326 // TODO(phoglund): We need to swap the a= lines too. I don't think this
327 // should be needed but it apparently is right now. 327 // should be needed but it apparently is right now.
328 return swapSdpLines_(sdp, 328 return swapSdpLines_(sdp,
329 'a=rtpmap:103 ISAC/16000', 329 'a=rtpmap:103 ISAC/16000',
330 'a=rtpmap:111 opus/48000'); 330 'a=rtpmap:111 opus/48000');
331 }); 331 });
332 } 332 }
333 333
334 /** @private */ 334 /** @private */
335 function forceOpus_() { 335 function forceIsac_() {
336 setOutgoingSdpTransform(function(sdp) { 336 setOutgoingSdpTransform(function(sdp) {
337 // Remove all other codecs (not the video codecs though). 337 // Remove all other codecs (not the video codecs though).
338 sdp = sdp.replace(/m=audio (\d+) RTP\/SAVPF.*\r\n/g, 338 sdp = sdp.replace(/m=audio (\d+) RTP\/SAVPF.*\r\n/g,
339 'm=audio $1 RTP/SAVPF 111\r\n'); 339 'm=audio $1 RTP/SAVPF 104\r\n');
340 sdp = sdp.replace(/a=rtpmap:(?!111)\d{1,3} (?!VP8|red|ulpfec).*\r\n/g, ''); 340 sdp = sdp.replace('a=fmtp:111 minptime=10', 'a=fmtp:104 minptime=10');
341 sdp = sdp.replace(/a=rtpmap:(?!104)\d{1,3} (?!VP8|red|ulpfec).*\r\n/g, '');
341 return sdp; 342 return sdp;
342 }); 343 });
343 } 344 }
344 345
345 /** @private */ 346 /** @private */
346 function dontTouchSdp_() { 347 function dontTouchSdp_() {
347 setOutgoingSdpTransform(function(sdp) { return sdp; }); 348 setOutgoingSdpTransform(function(sdp) { return sdp; });
348 } 349 }
349 350
350 /** @private */ 351 /** @private */
351 function hookupDataChannelCallbacks_() { 352 function hookupDataChannelCallbacks_() {
352 setDataCallbacks(function(status) { 353 setDataCallbacks(function(status) {
353 $('data-channel-status').value = status; 354 $('data-channel-status').value = status;
354 }, 355 },
355 function(data_message) { 356 function(data_message) {
356 debug('Received ' + data_message.data); 357 debug('Received ' + data_message.data);
357 $('data-channel-receive').value = 358 $('data-channel-receive').value =
358 data_message.data + '\n' + $('data-channel-receive').value; 359 data_message.data + '\n' + $('data-channel-receive').value;
359 }); 360 });
360 } 361 }
361 362
362 /** @private */ 363 /** @private */
363 function hookupDtmfSenderCallback_() { 364 function hookupDtmfSenderCallback_() {
364 setOnToneChange(function(tone) { 365 setOnToneChange(function(tone) {
365 debug('Sent DTMF tone: ' + tone.tone); 366 debug('Sent DTMF tone: ' + tone.tone);
366 $('dtmf-tones-sent').value = 367 $('dtmf-tones-sent').value =
367 tone.tone + '\n' + $('dtmf-tones-sent').value; 368 tone.tone + '\n' + $('dtmf-tones-sent').value;
368 }); 369 });
369 } 370 }
OLDNEW
« no previous file with comments | « chrome/test/data/webrtc/manual/peerconnection.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698