| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var rtpStream = chrome.cast.streaming.rtpStream; | 5 var rtpStream = chrome.cast.streaming.rtpStream; |
| 6 var tabCapture = chrome.tabCapture; | 6 var tabCapture = chrome.tabCapture; |
| 7 var udpTransport = chrome.cast.streaming.udpTransport; | 7 var udpTransport = chrome.cast.streaming.udpTransport; |
| 8 var createSession = chrome.cast.streaming.session.create; | 8 var createSession = chrome.cast.streaming.session.create; |
| 9 var pass = chrome.test.callbackPass; | 9 var pass = chrome.test.callbackPass; |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 chrome.test.assertTrue(udpId > 0); | 23 chrome.test.assertTrue(udpId > 0); |
| 24 console.log("Starting."); | 24 console.log("Starting."); |
| 25 var stateMachine = new TestStateMachine(stream, | 25 var stateMachine = new TestStateMachine(stream, |
| 26 audioId, | 26 audioId, |
| 27 videoId, | 27 videoId, |
| 28 udpId); | 28 udpId); |
| 29 var audioParams = rtpStream.getSupportedParams(audioId)[0]; | 29 var audioParams = rtpStream.getSupportedParams(audioId)[0]; |
| 30 var videoParams = rtpStream.getSupportedParams(videoId)[0]; | 30 var videoParams = rtpStream.getSupportedParams(videoId)[0]; |
| 31 chrome.test.assertTrue(!!audioParams.payload.codecName); | 31 chrome.test.assertTrue(!!audioParams.payload.codecName); |
| 32 chrome.test.assertTrue(!!videoParams.payload.codecName); | 32 chrome.test.assertTrue(!!videoParams.payload.codecName); |
| 33 udpTransport.setOptions(udpId, {DSCP: true}); |
| 33 udpTransport.setDestination(udpId, | 34 udpTransport.setDestination(udpId, |
| 34 {address: "127.0.0.1", port: 2344}); | 35 {address: "127.0.0.1", port: 2344}); |
| 35 rtpStream.onStarted.addListener( | 36 rtpStream.onStarted.addListener( |
| 36 stateMachine.onStarted.bind(stateMachine)); | 37 stateMachine.onStarted.bind(stateMachine)); |
| 37 stateMachine.onAllStarted = | 38 stateMachine.onAllStarted = |
| 38 pass(function(audioId, videoId) { | 39 pass(function(audioId, videoId) { |
| 39 console.log("Enabling logging."); | 40 console.log("Enabling logging."); |
| 40 rtpStream.toggleLogging(audioId, true); | 41 rtpStream.toggleLogging(audioId, true); |
| 41 rtpStream.toggleLogging(videoId, true); | 42 rtpStream.toggleLogging(videoId, true); |
| 42 console.log("Stopping."); | 43 console.log("Stopping."); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 66 chrome.test.assertTrue(!!audioParams.payload.codecName); | 67 chrome.test.assertTrue(!!audioParams.payload.codecName); |
| 67 chrome.test.assertTrue(!!videoParams.payload.codecName); | 68 chrome.test.assertTrue(!!videoParams.payload.codecName); |
| 68 chrome.test.succeed(); | 69 chrome.test.succeed(); |
| 69 }.bind(null, stream, audioId, videoId, udpId)); | 70 }.bind(null, stream, audioId, videoId, udpId)); |
| 70 rtpStream.start(audioId, audioParams); | 71 rtpStream.start(audioId, audioParams); |
| 71 rtpStream.start(videoId, videoParams); | 72 rtpStream.start(videoId, videoParams); |
| 72 }.bind(null, stream))); | 73 }.bind(null, stream))); |
| 73 })); | 74 })); |
| 74 }, | 75 }, |
| 75 ]); | 76 ]); |
| OLD | NEW |