static convertStream_(old, periodStart, periodDuration) {
    const V1StorageCell = shaka.offline.indexeddb.V1StorageCell;

    const initSegmentKey = old.initSegmentUri ?
        V1StorageCell.getKeyFromSegmentUri_(old.initSegmentUri) : null;

    // timestampOffset in the new format is the inverse of
    // presentationTimeOffset in the old format.  Also, PTO did not include the
    // period start, while TO does.
    const timestampOffset = periodStart + old.presentationTimeOffset;

    const appendWindowStart = periodStart;
    const appendWindowEnd = periodStart + periodDuration;

    return {
      id: old.id,
      originalId: null,
      groupId: null,
      primary: old.primary,
      type: old.contentType,
      mimeType: old.mimeType,
      codecs: old.codecs,
      frameRate: old.frameRate,
      pixelAspectRatio: undefined,
      hdr: undefined,
      colorGamut: undefined,
      videoLayout: undefined,
      kind: old.kind,
      language: old.language,
      originalLanguage: old.language || null,
      label: old.label,
      width: old.width,
      height: old.height,
      initSegmentKey: initSegmentKey,
      encrypted: old.encrypted,
      keyIds: new Set([old.keyId]),
      segments: old.segments.map((segment) => V1StorageCell.convertSegment_(
          segment, initSegmentKey, appendWindowStart, appendWindowEnd,
          timestampOffset)),
      variantIds: old.variantIds,
      roles: [],
      forced: false,
      audioSamplingRate: null,
      channelsCount: null,
      spatialAudio: false,
      closedCaptions: null,
      tilesLayout: undefined,
      external: false,
      fastSwitching: false,
      isAudioMuxedInVideo: false,
    };
  }
@param {shaka.extern.StreamDBV1} old
@param {number} periodStart
@param {number} periodDuration
@return {shaka.extern.StreamDB}
@private