@rtcstats/rtcstats-shared 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compression.js +15 -2
- package/package.json +1 -1
package/compression.js
CHANGED
|
@@ -318,6 +318,7 @@ const methodTable = {
|
|
|
318
318
|
// These are very common so ordered specifically such that
|
|
319
319
|
// they get ѕingle-digit ids.
|
|
320
320
|
getStats: 'g',
|
|
321
|
+
// TODO: getStats: 1, at next major version bump.
|
|
321
322
|
createOffer: 2,
|
|
322
323
|
createOfferOnSuccess: 3,
|
|
323
324
|
createOfferOnFailure: 12,
|
|
@@ -381,10 +382,15 @@ const methodTable = {
|
|
|
381
382
|
// HTMLMediaElement
|
|
382
383
|
'HTMLMediaElement.resize': 80,
|
|
383
384
|
};
|
|
385
|
+
// Properties that are decompressed but for release purpose not yet compressed.
|
|
386
|
+
// These should be moved to the compression table at major version bumps.
|
|
387
|
+
const methodTableDecompression = {
|
|
388
|
+
1: 'getStats',
|
|
389
|
+
};
|
|
384
390
|
const reverseMethodTable = Object.keys(methodTable).reduce((table, method) => {
|
|
385
391
|
table[methodTable[method]] = method;
|
|
386
392
|
return table;
|
|
387
|
-
},
|
|
393
|
+
}, methodTableDecompression);
|
|
388
394
|
|
|
389
395
|
/**
|
|
390
396
|
* Replace a rtcstats method with a numeric identifier.
|
|
@@ -707,10 +713,17 @@ const statsPropertyTable = {
|
|
|
707
713
|
base64Certificate: 165,
|
|
708
714
|
issuerCertificateId: 166,
|
|
709
715
|
};
|
|
716
|
+
// Properties that are decompressed but for release purpose not yet compressed.
|
|
717
|
+
// These should be moved to the compression table at major version bumps.
|
|
718
|
+
const statsPropertyTableDecompression = {
|
|
719
|
+
// https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-psnrsum
|
|
720
|
+
167: 'psnrMeasurements',
|
|
721
|
+
168: 'psnrSum',
|
|
722
|
+
};
|
|
710
723
|
const reverseStatsPropertyTable = Object.keys(statsPropertyTable).reduce((table, property) => {
|
|
711
724
|
table[statsPropertyTable[property]] = property;
|
|
712
725
|
return table;
|
|
713
|
-
},
|
|
726
|
+
}, statsPropertyTableDecompression);
|
|
714
727
|
|
|
715
728
|
/**
|
|
716
729
|
* Replace a stats property name with a numeric key for known properties.
|