You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rtp_sts.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. /* global ssrc2jid */
  2. /* jshint -W117 */
  3. /**
  4. * Calculates packet lost percent using the number of lost packets and the
  5. * number of all packet.
  6. * @param lostPackets the number of lost packets
  7. * @param totalPackets the number of all packets.
  8. * @returns {number} packet loss percent
  9. */
  10. function calculatePacketLoss(lostPackets, totalPackets) {
  11. if(!totalPackets || totalPackets <= 0 || !lostPackets || lostPackets <= 0)
  12. return 0;
  13. return Math.round((lostPackets/totalPackets)*100);
  14. }
  15. /**
  16. * Peer statistics data holder.
  17. * @constructor
  18. */
  19. function PeerStats()
  20. {
  21. this.ssrc2Loss = {};
  22. this.ssrc2AudioLevel = {};
  23. this.ssrc2bitrate = {};
  24. this.ssrc2resolution = {};
  25. }
  26. /**
  27. * The bandwidth
  28. * @type {{}}
  29. */
  30. PeerStats.bandwidth = {};
  31. /**
  32. * The bit rate
  33. * @type {{}}
  34. */
  35. PeerStats.bitrate = {};
  36. /**
  37. * The packet loss rate
  38. * @type {{}}
  39. */
  40. PeerStats.packetLoss = null;
  41. /**
  42. * Sets packets loss rate for given <tt>ssrc</tt> that blong to the peer
  43. * represented by this instance.
  44. * @param ssrc audio or video RTP stream SSRC.
  45. * @param lossRate new packet loss rate value to be set.
  46. */
  47. PeerStats.prototype.setSsrcLoss = function (ssrc, lossRate)
  48. {
  49. this.ssrc2Loss[ssrc] = lossRate;
  50. };
  51. /**
  52. * Sets resolution for given <tt>ssrc</tt> that belong to the peer
  53. * represented by this instance.
  54. * @param ssrc audio or video RTP stream SSRC.
  55. * @param resolution new resolution value to be set.
  56. */
  57. PeerStats.prototype.setSsrcResolution = function (ssrc, resolution)
  58. {
  59. if(resolution === null && this.ssrc2resolution[ssrc])
  60. {
  61. delete this.ssrc2resolution[ssrc];
  62. }
  63. else if(resolution !== null)
  64. this.ssrc2resolution[ssrc] = resolution;
  65. };
  66. /**
  67. * Sets the bit rate for given <tt>ssrc</tt> that blong to the peer
  68. * represented by this instance.
  69. * @param ssrc audio or video RTP stream SSRC.
  70. * @param bitrate new bitrate value to be set.
  71. */
  72. PeerStats.prototype.setSsrcBitrate = function (ssrc, bitrate)
  73. {
  74. if(this.ssrc2bitrate[ssrc])
  75. {
  76. this.ssrc2bitrate[ssrc].download += bitrate.download;
  77. this.ssrc2bitrate[ssrc].upload += bitrate.upload;
  78. }
  79. else {
  80. this.ssrc2bitrate[ssrc] = bitrate;
  81. }
  82. };
  83. /**
  84. * Sets new audio level(input or output) for given <tt>ssrc</tt> that identifies
  85. * the stream which belongs to the peer represented by this instance.
  86. * @param ssrc RTP stream SSRC for which current audio level value will be
  87. * updated.
  88. * @param audioLevel the new audio level value to be set. Value is truncated to
  89. * fit the range from 0 to 1.
  90. */
  91. PeerStats.prototype.setSsrcAudioLevel = function (ssrc, audioLevel)
  92. {
  93. // Range limit 0 - 1
  94. this.ssrc2AudioLevel[ssrc] = Math.min(Math.max(audioLevel, 0), 1);
  95. };
  96. /**
  97. * Array with the transport information.
  98. * @type {Array}
  99. */
  100. PeerStats.transport = [];
  101. /**
  102. * <tt>StatsCollector</tt> registers for stats updates of given
  103. * <tt>peerconnection</tt> in given <tt>interval</tt>. On each update particular
  104. * stats are extracted and put in {@link PeerStats} objects. Once the processing
  105. * is done <tt>audioLevelsUpdateCallback</tt> is called with <tt>this</tt>
  106. * instance as an event source.
  107. *
  108. * @param peerconnection webRTC peer connection object.
  109. * @param interval stats refresh interval given in ms.
  110. * @param {function(StatsCollector)} audioLevelsUpdateCallback the callback
  111. * called on stats update.
  112. * @constructor
  113. */
  114. function StatsCollector(peerconnection, audioLevelsInterval,
  115. audioLevelsUpdateCallback, statsInterval,
  116. statsUpdateCallback)
  117. {
  118. this.peerconnection = peerconnection;
  119. this.baselineAudioLevelsReport = null;
  120. this.currentAudioLevelsReport = null;
  121. this.currentStatsReport = null;
  122. this.baselineStatsReport = null;
  123. this.audioLevelsIntervalId = null;
  124. /**
  125. * Gather PeerConnection stats once every this many milliseconds.
  126. */
  127. this.GATHER_INTERVAL = 10000;
  128. /**
  129. * Log stats via the focus once every this many milliseconds.
  130. */
  131. this.LOG_INTERVAL = 60000;
  132. /**
  133. * Gather stats and store them in this.statsToBeLogged.
  134. */
  135. this.gatherStatsIntervalId = null;
  136. /**
  137. * Send the stats already saved in this.statsToBeLogged to be logged via
  138. * the focus.
  139. */
  140. this.logStatsIntervalId = null;
  141. /**
  142. * Stores the statistics which will be send to the focus to be logged.
  143. */
  144. this.statsToBeLogged =
  145. {
  146. timestamps: [],
  147. stats: {}
  148. };
  149. // Updates stats interval
  150. this.audioLevelsIntervalMilis = audioLevelsInterval;
  151. this.statsIntervalId = null;
  152. this.statsIntervalMilis = statsInterval;
  153. // Map of jids to PeerStats
  154. this.jid2stats = {};
  155. this.audioLevelsUpdateCallback = audioLevelsUpdateCallback;
  156. this.statsUpdateCallback = statsUpdateCallback;
  157. }
  158. /**
  159. * Stops stats updates.
  160. */
  161. StatsCollector.prototype.stop = function ()
  162. {
  163. if (this.audioLevelsIntervalId)
  164. {
  165. clearInterval(this.audioLevelsIntervalId);
  166. this.audioLevelsIntervalId = null;
  167. clearInterval(this.statsIntervalId);
  168. this.statsIntervalId = null;
  169. clearInterval(this.logStatsIntervalId);
  170. this.logStatsIntervalId = null;
  171. clearInterval(this.gatherStatsIntervalId);
  172. this.gatherStatsIntervalId = null;
  173. }
  174. };
  175. /**
  176. * Callback passed to <tt>getStats</tt> method.
  177. * @param error an error that occurred on <tt>getStats</tt> call.
  178. */
  179. StatsCollector.prototype.errorCallback = function (error)
  180. {
  181. console.error("Get stats error", error);
  182. this.stop();
  183. };
  184. /**
  185. * Starts stats updates.
  186. */
  187. StatsCollector.prototype.start = function ()
  188. {
  189. var self = this;
  190. this.audioLevelsIntervalId = setInterval(
  191. function ()
  192. {
  193. // Interval updates
  194. self.peerconnection.getStats(
  195. function (report)
  196. {
  197. var results = null;
  198. if(!report || !report.result || typeof report.result != 'function')
  199. {
  200. results = report;
  201. }
  202. else
  203. {
  204. results = report.result();
  205. }
  206. //console.error("Got interval report", results);
  207. self.currentAudioLevelsReport = results;
  208. self.processAudioLevelReport();
  209. self.baselineAudioLevelsReport =
  210. self.currentAudioLevelsReport;
  211. },
  212. self.errorCallback
  213. );
  214. },
  215. self.audioLevelsIntervalMilis
  216. );
  217. this.statsIntervalId = setInterval(
  218. function () {
  219. // Interval updates
  220. self.peerconnection.getStats(
  221. function (report)
  222. {
  223. var results = null;
  224. if(!report || !report.result || typeof report.result != 'function')
  225. {
  226. //firefox
  227. results = report;
  228. }
  229. else
  230. {
  231. //chrome
  232. results = report.result();
  233. }
  234. //console.error("Got interval report", results);
  235. self.currentStatsReport = results;
  236. try
  237. {
  238. self.processStatsReport();
  239. }
  240. catch(e)
  241. {
  242. console.error("Unsupported key:" + e);
  243. }
  244. self.baselineStatsReport = self.currentStatsReport;
  245. },
  246. self.errorCallback
  247. );
  248. },
  249. self.statsIntervalMilis
  250. );
  251. if (config.logStats) {
  252. this.gatherStatsIntervalId = setInterval(
  253. function () {
  254. self.peerconnection.getStats(
  255. function (report) {
  256. self.addStatsToBeLogged(report.result());
  257. },
  258. function () {
  259. }
  260. );
  261. },
  262. this.GATHER_INTERVAL
  263. );
  264. this.logStatsIntervalId = setInterval(
  265. function() { self.logStats(); },
  266. this.LOG_INTERVAL);
  267. }
  268. };
  269. /**
  270. * Converts the stats to the format used for logging, and saves the data in
  271. * this.statsToBeLogged.
  272. * @param reports Reports as given by webkitRTCPerConnection.getStats.
  273. */
  274. StatsCollector.prototype.addStatsToBeLogged = function (reports) {
  275. var self = this;
  276. var num_records = this.statsToBeLogged.timestamps.length;
  277. this.statsToBeLogged.timestamps.push(new Date().getTime());
  278. reports.map(function (report) {
  279. var stat = self.statsToBeLogged.stats[report.id];
  280. if (!stat) {
  281. stat = self.statsToBeLogged.stats[report.id] = {};
  282. }
  283. stat.type = report.type;
  284. report.names().map(function (name) {
  285. var values = stat[name];
  286. if (!values) {
  287. values = stat[name] = [];
  288. }
  289. while (values.length < num_records) {
  290. values.push(null);
  291. }
  292. values.push(report.stat(name));
  293. });
  294. });
  295. };
  296. StatsCollector.prototype.logStats = function () {
  297. if (!focusJid) {
  298. return;
  299. }
  300. var deflate = true;
  301. var content = JSON.stringify(this.statsToBeLogged);
  302. if (deflate) {
  303. content = String.fromCharCode.apply(null, Pako.deflateRaw(content));
  304. }
  305. content = Base64.encode(content);
  306. // XEP-0337-ish
  307. var message = $msg({to: focusJid, type: 'normal'});
  308. message.c('log', { xmlns: 'urn:xmpp:eventlog',
  309. id: 'PeerConnectionStats'});
  310. message.c('message').t(content).up();
  311. if (deflate) {
  312. message.c('tag', {name: "deflated", value: "true"}).up();
  313. }
  314. message.up();
  315. connection.send(message);
  316. // Reset the stats
  317. this.statsToBeLogged.stats = {};
  318. this.statsToBeLogged.timestamps = [];
  319. };
  320. var keyMap = {
  321. "firefox": {
  322. "ssrc": "ssrc",
  323. "packetsReceived": "packetsReceived",
  324. "packetsLost": "packetsLost",
  325. "packetsSent": "packetsSent",
  326. "bytesReceived": "bytesReceived",
  327. "bytesSent": "bytesSent"
  328. },
  329. "chrome": {
  330. "receiveBandwidth": "googAvailableReceiveBandwidth",
  331. "sendBandwidth": "googAvailableSendBandwidth",
  332. "remoteAddress": "googRemoteAddress",
  333. "transportType": "googTransportType",
  334. "localAddress": "googLocalAddress",
  335. "activeConnection": "googActiveConnection",
  336. "ssrc": "ssrc",
  337. "packetsReceived": "packetsReceived",
  338. "packetsSent": "packetsSent",
  339. "packetsLost": "packetsLost",
  340. "bytesReceived": "bytesReceived",
  341. "bytesSent": "bytesSent",
  342. "googFrameHeightReceived": "googFrameHeightReceived",
  343. "googFrameWidthReceived": "googFrameWidthReceived",
  344. "googFrameHeightSent": "googFrameHeightSent",
  345. "googFrameWidthSent": "googFrameWidthSent",
  346. "audioInputLevel": "audioInputLevel",
  347. "audioOutputLevel": "audioOutputLevel"
  348. }
  349. };
  350. /**
  351. * Stats processing logic.
  352. */
  353. StatsCollector.prototype.processStatsReport = function () {
  354. if (!this.baselineStatsReport) {
  355. return;
  356. }
  357. for (var idx in this.currentStatsReport) {
  358. var now = this.currentStatsReport[idx];
  359. try {
  360. if (getStatValue(now, 'receiveBandwidth') ||
  361. getStatValue(now, 'sendBandwidth')) {
  362. PeerStats.bandwidth = {
  363. "download": Math.round(
  364. (getStatValue(now, 'receiveBandwidth')) / 1000),
  365. "upload": Math.round(
  366. (getStatValue(now, 'sendBandwidth')) / 1000)
  367. };
  368. }
  369. }
  370. catch(e){/*not supported*/}
  371. if(now.type == 'googCandidatePair')
  372. {
  373. var ip, type, localIP, active;
  374. try {
  375. ip = getStatValue(now, 'remoteAddress');
  376. type = getStatValue(now, "transportType");
  377. localIP = getStatValue(now, "localAddress");
  378. active = getStatValue(now, "activeConnection");
  379. }
  380. catch(e){/*not supported*/}
  381. if(!ip || !type || !localIP || active != "true")
  382. continue;
  383. var addressSaved = false;
  384. for(var i = 0; i < PeerStats.transport.length; i++)
  385. {
  386. if(PeerStats.transport[i].ip == ip &&
  387. PeerStats.transport[i].type == type &&
  388. PeerStats.transport[i].localip == localIP)
  389. {
  390. addressSaved = true;
  391. }
  392. }
  393. if(addressSaved)
  394. continue;
  395. PeerStats.transport.push({localip: localIP, ip: ip, type: type});
  396. continue;
  397. }
  398. if(now.type == "candidatepair")
  399. {
  400. if(now.state == "succeeded")
  401. continue;
  402. var local = this.currentStatsReport[now.localCandidateId];
  403. var remote = this.currentStatsReport[now.remoteCandidateId];
  404. PeerStats.transport.push({localip: local.ipAddress + ":" + local.portNumber,
  405. ip: remote.ipAddress + ":" + remote.portNumber, type: local.transport});
  406. }
  407. if (now.type != 'ssrc' && now.type != "outboundrtp" &&
  408. now.type != "inboundrtp") {
  409. continue;
  410. }
  411. var before = this.baselineStatsReport[idx];
  412. if (!before) {
  413. console.warn(getStatValue(now, 'ssrc') + ' not enough data');
  414. continue;
  415. }
  416. var ssrc = getStatValue(now, 'ssrc');
  417. if(!ssrc)
  418. continue;
  419. var jid = ssrc2jid[ssrc];
  420. if (!jid) {
  421. console.warn("No jid for ssrc: " + ssrc);
  422. continue;
  423. }
  424. var jidStats = this.jid2stats[jid];
  425. if (!jidStats) {
  426. jidStats = new PeerStats();
  427. this.jid2stats[jid] = jidStats;
  428. }
  429. var isDownloadStream = true;
  430. var key = 'packetsReceived';
  431. if (!getStatValue(now, key))
  432. {
  433. isDownloadStream = false;
  434. key = 'packetsSent';
  435. if (!getStatValue(now, key))
  436. {
  437. console.warn("No packetsReceived nor packetSent stat found");
  438. continue;
  439. }
  440. }
  441. var packetsNow = getStatValue(now, key);
  442. if(!packetsNow || packetsNow < 0)
  443. packetsNow = 0;
  444. var packetsBefore = getStatValue(before, key);
  445. if(!packetsBefore || packetsBefore < 0)
  446. packetsBefore = 0;
  447. var packetRate = packetsNow - packetsBefore;
  448. if(!packetRate || packetRate < 0)
  449. packetRate = 0;
  450. var currentLoss = getStatValue(now, 'packetsLost');
  451. if(!currentLoss || currentLoss < 0)
  452. currentLoss = 0;
  453. var previousLoss = getStatValue(before, 'packetsLost');
  454. if(!previousLoss || previousLoss < 0)
  455. previousLoss = 0;
  456. var lossRate = currentLoss - previousLoss;
  457. if(!lossRate || lossRate < 0)
  458. lossRate = 0;
  459. var packetsTotal = (packetRate + lossRate);
  460. jidStats.setSsrcLoss(ssrc,
  461. {"packetsTotal": packetsTotal,
  462. "packetsLost": lossRate,
  463. "isDownloadStream": isDownloadStream});
  464. var bytesReceived = 0, bytesSent = 0;
  465. if(getStatValue(now, "bytesReceived"))
  466. {
  467. bytesReceived = getStatValue(now, "bytesReceived") -
  468. getStatValue(before, "bytesReceived");
  469. }
  470. if(getStatValue(now, "bytesSent"))
  471. {
  472. bytesSent = getStatValue(now, "bytesSent") -
  473. getStatValue(before, "bytesSent");
  474. }
  475. var time = Math.round((now.timestamp - before.timestamp) / 1000);
  476. if(bytesReceived <= 0 || time <= 0)
  477. {
  478. bytesReceived = 0;
  479. }
  480. else
  481. {
  482. bytesReceived = Math.round(((bytesReceived * 8) / time) / 1000);
  483. }
  484. if(bytesSent <= 0 || time <= 0)
  485. {
  486. bytesSent = 0;
  487. }
  488. else
  489. {
  490. bytesSent = Math.round(((bytesSent * 8) / time) / 1000);
  491. }
  492. jidStats.setSsrcBitrate(ssrc, {
  493. "download": bytesReceived,
  494. "upload": bytesSent});
  495. var resolution = {height: null, width: null};
  496. try {
  497. if (getStatValue(now, "googFrameHeightReceived") &&
  498. getStatValue(now, "googFrameWidthReceived")) {
  499. resolution.height = getStatValue(now, "googFrameHeightReceived");
  500. resolution.width = getStatValue(now, "googFrameWidthReceived");
  501. }
  502. else if (getStatValue(now, "googFrameHeightSent") &&
  503. getStatValue(now, "googFrameWidthSent")) {
  504. resolution.height = getStatValue(now, "googFrameHeightSent");
  505. resolution.width = getStatValue(now, "googFrameWidthSent");
  506. }
  507. }
  508. catch(e){/*not supported*/}
  509. if(resolution.height && resolution.width)
  510. {
  511. jidStats.setSsrcResolution(ssrc, resolution);
  512. }
  513. else
  514. {
  515. jidStats.setSsrcResolution(ssrc, null);
  516. }
  517. }
  518. var self = this;
  519. // Jid stats
  520. var totalPackets = {download: 0, upload: 0};
  521. var lostPackets = {download: 0, upload: 0};
  522. var bitrateDownload = 0;
  523. var bitrateUpload = 0;
  524. var resolutions = {};
  525. Object.keys(this.jid2stats).forEach(
  526. function (jid)
  527. {
  528. Object.keys(self.jid2stats[jid].ssrc2Loss).forEach(
  529. function (ssrc)
  530. {
  531. var type = "upload";
  532. if(self.jid2stats[jid].ssrc2Loss[ssrc].isDownloadStream)
  533. type = "download";
  534. totalPackets[type] +=
  535. self.jid2stats[jid].ssrc2Loss[ssrc].packetsTotal;
  536. lostPackets[type] +=
  537. self.jid2stats[jid].ssrc2Loss[ssrc].packetsLost;
  538. }
  539. );
  540. Object.keys(self.jid2stats[jid].ssrc2bitrate).forEach(
  541. function (ssrc) {
  542. bitrateDownload +=
  543. self.jid2stats[jid].ssrc2bitrate[ssrc].download;
  544. bitrateUpload +=
  545. self.jid2stats[jid].ssrc2bitrate[ssrc].upload;
  546. delete self.jid2stats[jid].ssrc2bitrate[ssrc];
  547. }
  548. );
  549. resolutions[jid] = self.jid2stats[jid].ssrc2resolution;
  550. }
  551. );
  552. PeerStats.bitrate = {"upload": bitrateUpload, "download": bitrateDownload};
  553. PeerStats.packetLoss = {
  554. total:
  555. calculatePacketLoss(lostPackets.download + lostPackets.upload,
  556. totalPackets.download + totalPackets.upload),
  557. download:
  558. calculatePacketLoss(lostPackets.download, totalPackets.download),
  559. upload:
  560. calculatePacketLoss(lostPackets.upload, totalPackets.upload)
  561. };
  562. this.statsUpdateCallback(
  563. {
  564. "bitrate": PeerStats.bitrate,
  565. "packetLoss": PeerStats.packetLoss,
  566. "bandwidth": PeerStats.bandwidth,
  567. "resolution": resolutions,
  568. "transport": PeerStats.transport
  569. });
  570. PeerStats.transport = [];
  571. };
  572. /**
  573. * Stats processing logic.
  574. */
  575. StatsCollector.prototype.processAudioLevelReport = function ()
  576. {
  577. if (!this.baselineAudioLevelsReport)
  578. {
  579. return;
  580. }
  581. for (var idx in this.currentAudioLevelsReport)
  582. {
  583. var now = this.currentAudioLevelsReport[idx];
  584. if (now.type != 'ssrc')
  585. {
  586. continue;
  587. }
  588. var before = this.baselineAudioLevelsReport[idx];
  589. if (!before)
  590. {
  591. console.warn(getStatValue(now, 'ssrc') + ' not enough data');
  592. continue;
  593. }
  594. var ssrc = getStatValue(now, 'ssrc');
  595. var jid = ssrc2jid[ssrc];
  596. if (!jid)
  597. {
  598. console.warn("No jid for ssrc: " + ssrc);
  599. continue;
  600. }
  601. var jidStats = this.jid2stats[jid];
  602. if (!jidStats)
  603. {
  604. jidStats = new PeerStats();
  605. this.jid2stats[jid] = jidStats;
  606. }
  607. // Audio level
  608. var audioLevel = null;
  609. try {
  610. audioLevel = getStatValue(now, 'audioInputLevel');
  611. if (!audioLevel)
  612. audioLevel = getStatValue(now, 'audioOutputLevel');
  613. }
  614. catch(e) {/*not supported*/
  615. console.warn("Audio Levels are not available in the statistics.");
  616. clearInterval(this.audioLevelsIntervalId);
  617. return;
  618. }
  619. if (audioLevel)
  620. {
  621. // TODO: can't find specs about what this value really is,
  622. // but it seems to vary between 0 and around 32k.
  623. audioLevel = audioLevel / 32767;
  624. jidStats.setSsrcAudioLevel(ssrc, audioLevel);
  625. if(jid != connection.emuc.myroomjid)
  626. this.audioLevelsUpdateCallback(jid, audioLevel);
  627. }
  628. }
  629. };
  630. function getStatValue(item, name) {
  631. if(!keyMap[RTC.browser][name])
  632. throw "The property isn't supported!";
  633. var key = keyMap[RTC.browser][name];
  634. return RTC.browser == "chrome"? item.stat(key) : item[key];
  635. }