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 | 5 |
6 | 6 |
7 /** | 7 /** |
8 * Get the ssrc if |report| is an ssrc report. | 8 * Get the ssrc if |report| is an ssrc report. |
9 * | 9 * |
10 * @param {!Object} report The object contains id, type, and stats, where stats | 10 * @param {!Object} report The object contains id, type, and stats, where stats |
(...skipping 30 matching lines...) Expand all Loading... |
41 */ | 41 */ |
42 var SsrcInfoManager = (function() { | 42 var SsrcInfoManager = (function() { |
43 'use strict'; | 43 'use strict'; |
44 | 44 |
45 /** | 45 /** |
46 * @constructor | 46 * @constructor |
47 */ | 47 */ |
48 function SsrcInfoManager() { | 48 function SsrcInfoManager() { |
49 /** | 49 /** |
50 * Map from ssrc id to an object containing all the stream properties. | 50 * Map from ssrc id to an object containing all the stream properties. |
51 * @type {!Object.<string, !Object.<string>>} | 51 * @type {!Object<string, !Object<string>>} |
52 * @private | 52 * @private |
53 */ | 53 */ |
54 this.streamInfoContainer_ = {}; | 54 this.streamInfoContainer_ = {}; |
55 | 55 |
56 /** | 56 /** |
57 * The string separating attibutes in an SDP. | 57 * The string separating attibutes in an SDP. |
58 * @type {string} | 58 * @type {string} |
59 * @const | 59 * @const |
60 * @private | 60 * @private |
61 */ | 61 */ |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 this.streamInfoContainer_[ssrc][name] = value; | 126 this.streamInfoContainer_[ssrc][name] = value; |
127 | 127 |
128 // Move |rest| to the start of the next field. | 128 // Move |rest| to the start of the next field. |
129 rest = rest.substring(nextFieldIndex + 1); | 129 rest = rest.substring(nextFieldIndex + 1); |
130 } | 130 } |
131 } | 131 } |
132 }, | 132 }, |
133 | 133 |
134 /** | 134 /** |
135 * @param {string} sdp The ssrc id. | 135 * @param {string} sdp The ssrc id. |
136 * @return {!Object.<string>} The object containing the ssrc infomation. | 136 * @return {!Object<string>} The object containing the ssrc infomation. |
137 */ | 137 */ |
138 getStreamInfo: function(ssrc) { | 138 getStreamInfo: function(ssrc) { |
139 return this.streamInfoContainer_[ssrc]; | 139 return this.streamInfoContainer_[ssrc]; |
140 }, | 140 }, |
141 | 141 |
142 /** | 142 /** |
143 * Populate the ssrc information into |parentElement|, each field as a | 143 * Populate the ssrc information into |parentElement|, each field as a |
144 * DIV element. | 144 * DIV element. |
145 * | 145 * |
146 * @param {!Element} parentElement The parent element for the ssrc info. | 146 * @param {!Element} parentElement The parent element for the ssrc info. |
(...skipping 10 matching lines...) Expand all Loading... |
157 fieldElement = document.createElement('div'); | 157 fieldElement = document.createElement('div'); |
158 parentElement.appendChild(fieldElement); | 158 parentElement.appendChild(fieldElement); |
159 fieldElement.textContent = | 159 fieldElement.textContent = |
160 property + ':' + this.streamInfoContainer_[ssrc][property]; | 160 property + ':' + this.streamInfoContainer_[ssrc][property]; |
161 } | 161 } |
162 } | 162 } |
163 }; | 163 }; |
164 | 164 |
165 return SsrcInfoManager; | 165 return SsrcInfoManager; |
166 })(); | 166 })(); |
OLD | NEW |