static async getDecodingInfosForVariant_(variant, decodingConfigs) {
    /**
     * @param {?MediaCapabilitiesDecodingInfo} a
     * @param {!MediaCapabilitiesDecodingInfo} b
     * @return {!MediaCapabilitiesDecodingInfo}
     */
    const merge = (a, b) => {
      if (!a) {
        return b;
      } else {
        const res = shaka.util.ObjectUtils.shallowCloneObject(a);
        res.supported = a.supported && b.supported;
        res.powerEfficient = a.powerEfficient && b.powerEfficient;
        res.smooth = a.smooth && b.smooth;
        if (b.keySystemAccess && !res.keySystemAccess) {
          res.keySystemAccess = b.keySystemAccess;
        }
        return res;
      }
    };

    const StreamUtils = shaka.util.StreamUtils;
    /** @type {?MediaCapabilitiesDecodingInfo} */
    let finalResult = null;
    const promises = [];
    for (const decodingConfig of decodingConfigs) {
      const cacheKey =
          shaka.util.ObjectUtils.alphabeticalKeyOrderStringify(decodingConfig);

      const cache = StreamUtils.decodingConfigCache_;
      if (cache.has(cacheKey)) {
        shaka.log.v2('Using cached results of mediaCapabilities.decodingInfo',
            'for key', cacheKey);
        finalResult = merge(finalResult, cache.get(cacheKey));
      } else {
        // Do a final pass-over of the decoding config: if a given stream has
        // multiple codecs, that suggests that it switches between those codecs
        // at points of the go-through.
        // mediaCapabilities by itself will report "not supported" when you
        // put in multiple different codecs, so each has to be checked
        // individually. So check each and take the worst result, to determine
        // overall variant compatibility.
        promises.push(StreamUtils
            .checkEachDecodingConfigCombination_(decodingConfig).then((res) => {
              /** @type {?MediaCapabilitiesDecodingInfo} */
              let acc = null;
              for (const result of (res || [])) {
                acc = merge(acc, result);
              }
              if (acc) {
                cache.set(cacheKey, acc);
                finalResult = merge(finalResult, acc);
              }
            }));
      }
    }
    await Promise.all(promises);
    if (finalResult) {
      variant.decodingInfos.push(finalResult);
    }
  }
Queries mediaCapabilities for the decoding info for that decoding config,
and assigns it to the given variant.
If that query has been done before, instead return a cached result.
@param {!shaka.extern.Variant} variant
@param {!Array<!MediaDecodingConfiguration>} decodingConfigs
@private