OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Run a cast v2 mirroring session for 10 seconds. | 5 // Run a cast v2 mirroring session for 10 seconds. |
6 | 6 |
7 chrome.test.runTests([ | 7 chrome.test.runTests([ |
8 function sendTestPatterns() { | 8 function sendTestPatterns() { |
9 // The receive port changes between browser_test invocations, and is passed | 9 // The receive port changes between browser_test invocations, and is passed |
10 // as an query parameter in the URL. | 10 // as an query parameter in the URL. |
(...skipping 28 matching lines...) Expand all Loading... |
39 chrome.cast.streaming.session.create( | 39 chrome.cast.streaming.session.create( |
40 captureStream.getAudioTracks()[0], | 40 captureStream.getAudioTracks()[0], |
41 captureStream.getVideoTracks()[0], | 41 captureStream.getVideoTracks()[0], |
42 function (audioId, videoId, udpId) { | 42 function (audioId, videoId, udpId) { |
43 chrome.cast.streaming.udpTransport.setDestination( | 43 chrome.cast.streaming.udpTransport.setDestination( |
44 udpId, { address: "127.0.0.1", port: recvPort } ); | 44 udpId, { address: "127.0.0.1", port: recvPort } ); |
45 var rtpStream = chrome.cast.streaming.rtpStream; | 45 var rtpStream = chrome.cast.streaming.rtpStream; |
46 rtpStream.start(audioId, | 46 rtpStream.start(audioId, |
47 rtpStream.getSupportedParams(audioId)[0]); | 47 rtpStream.getSupportedParams(audioId)[0]); |
48 var videoParams = rtpStream.getSupportedParams(videoId)[0]; | 48 var videoParams = rtpStream.getSupportedParams(videoId)[0]; |
49 videoParams.payload.width = width; | |
50 videoParams.payload.height = height; | |
51 videoParams.payload.clockRate = frameRate; | 49 videoParams.payload.clockRate = frameRate; |
52 rtpStream.start(videoId, videoParams); | 50 rtpStream.start(videoId, videoParams); |
53 setTimeout(function () { | 51 setTimeout(function () { |
54 chrome.test.succeed(); | 52 chrome.test.succeed(); |
55 rtpStream.stop(audioId); | 53 rtpStream.stop(audioId); |
56 rtpStream.stop(videoId); | 54 rtpStream.stop(videoId); |
57 }, 20000); // 20 seconds | 55 }, 20000); // 20 seconds |
58 }); | 56 }); |
59 }); | 57 }); |
60 } | 58 } |
61 ]); | 59 ]); |
OLD | NEW |