OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 tabView = null; | 5 var tabView = null; |
6 var ssrcInfoManager = null; | 6 var ssrcInfoManager = null; |
7 var peerConnectionUpdateTable = null; | 7 var peerConnectionUpdateTable = null; |
8 var statsTable = null; | 8 var statsTable = null; |
9 var dumpCreator = null; | 9 var dumpCreator = null; |
10 /** A map from peer connection id to the PeerConnectionRecord. */ | 10 /** A map from peer connection id to the PeerConnectionRecord. */ |
11 var peerConnectionDataStore = {}; | 11 var peerConnectionDataStore = {}; |
| 12 /** A list of getUserMedia requests. */ |
| 13 var userMediaRequests = []; |
12 | 14 |
13 /** A simple class to store the updates and stats data for a peer connection. */ | 15 /** A simple class to store the updates and stats data for a peer connection. */ |
14 var PeerConnectionRecord = (function() { | 16 var PeerConnectionRecord = (function() { |
15 /** @constructor */ | 17 /** @constructor */ |
16 function PeerConnectionRecord() { | 18 function PeerConnectionRecord() { |
17 /** @private */ | 19 /** @private */ |
18 this.record_ = { | 20 this.record_ = { |
19 constraints: {}, | 21 constraints: {}, |
20 servers: [], | 22 servers: [], |
21 stats: {}, | 23 stats: {}, |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 statsTable.addStatsReport(peerConnectionElement, report); | 243 statsTable.addStatsReport(peerConnectionElement, report); |
242 drawSingleReport(peerConnectionElement, report); | 244 drawSingleReport(peerConnectionElement, report); |
243 } | 245 } |
244 } | 246 } |
245 | 247 |
246 | 248 |
247 /** | 249 /** |
248 * Adds a getUserMedia request. | 250 * Adds a getUserMedia request. |
249 * | 251 * |
250 * @param {!Object} data The object containing rid {number}, pid {number}, | 252 * @param {!Object} data The object containing rid {number}, pid {number}, |
251 * origin {string}, audio {Object<string>}, video {Object<string>}. | 253 * origin {string}, audio {string}, video {string}. |
252 */ | 254 */ |
253 function addGetUserMedia(data) { | 255 function addGetUserMedia(data) { |
254 // TODO(jiayl): add the getUserMedia info to the tabbed UI. | 256 // TODO(jiayl): add the getUserMedia info to the tabbed UI. |
| 257 userMediaRequests.push(data); |
255 } | 258 } |
256 | 259 |
257 | 260 |
258 /** | 261 /** |
259 * Removes the getUserMedia requests from the specified |rid|. | 262 * Removes the getUserMedia requests from the specified |rid|. |
260 * | 263 * |
261 * @param {!Object} data The object containing rid {number}, the render id. | 264 * @param {!Object} data The object containing rid {number}, the render id. |
262 */ | 265 */ |
263 function removeGetUserMediaForRenderer(data) { | 266 function removeGetUserMediaForRenderer(data) { |
264 // TODO(jiayl): remove the getUserMedia info from the tabbed UI. | 267 // TODO(jiayl): remove the getUserMedia info from the tabbed UI. |
| 268 for (var i = userMediaRequests.length - 1; i >= 0; --i) { |
| 269 if (userMediaRequests[i].rid == data.rid) |
| 270 userMediaRequests.splice(i, 1); |
| 271 } |
265 } | 272 } |
266 | 273 |
267 /** | 274 /** |
268 * Set | 275 * Set |
269 */ | 276 */ |
270 function enableAecRecording() { | 277 function enableAecRecording() { |
271 dumpCreator.enableAecRecording(); | 278 dumpCreator.enableAecRecording(); |
272 } | 279 } |
OLD | NEW |