isCodecSwitchNecessary_(contentType, refMimeType, refCodecs) {
    if (contentType == shaka.util.ManifestParserUtils.ContentType.TEXT) {
      return false;
    }
    const MimeUtils = shaka.util.MimeUtils;
    const currentCodec = MimeUtils.getNormalizedCodec(
        MimeUtils.getCodecs(this.sourceBufferTypes_.get(contentType)));
    const currentBasicType = MimeUtils.getBasicType(
        this.sourceBufferTypes_.get(contentType));

    let newMimeType = shaka.util.MimeUtils.getFullType(refMimeType, refCodecs);
    let needTransmux = this.config_.forceTransmux;
    if (!shaka.media.Capabilities.isTypeSupported(newMimeType) ||
        (!this.sequenceMode_ &&
        shaka.util.MimeUtils.RAW_FORMATS.includes(newMimeType))) {
      needTransmux = true;
    }
    const newMimeTypeWithAllCodecs =
        shaka.util.MimeUtils.getFullTypeWithAllCodecs(
            refMimeType, refCodecs);
    const TransmuxerEngine = shaka.transmuxer.TransmuxerEngine;
    if (needTransmux) {
      const transmuxerPlugin =
          TransmuxerEngine.findTransmuxer(newMimeTypeWithAllCodecs);
      if (transmuxerPlugin) {
        const transmuxer = transmuxerPlugin();
        newMimeType =
            transmuxer.convertCodecs(contentType, newMimeTypeWithAllCodecs);
        transmuxer.destroy();
      }
    }

    const newCodec = MimeUtils.getNormalizedCodec(
        MimeUtils.getCodecs(newMimeType));
    const newBasicType = MimeUtils.getBasicType(newMimeType);

    return currentCodec !== newCodec || currentBasicType !== newBasicType;
  }
Returns true if it's necessary codec switch to load the new stream.

@param {shaka.util.ManifestParserUtils.ContentType} contentType
@param {string} refMimeType
@param {string} refCodecs
@return {boolean}
@private