static cloneStreamDB_(streamDb) {
    const clone = /** @type {shaka.extern.StreamDB} */(Object.assign(
        {}, streamDb));

    // Clone roles array so this output stream can own it.
    clone.roles = clone.roles.slice();
    // These are wiped out now and rebuilt later from the various per-period
    // streams that match this output.
    clone.keyIds = new Set(streamDb.keyIds);
    clone.segments = [];
    clone.variantIds = [];
    clone.closedCaptions = streamDb.closedCaptions ?
      new Map(streamDb.closedCaptions) : null;

    return clone;
  }
Clone a StreamDB to make an output stream for combining others across
periods.

@param {shaka.extern.StreamDB} streamDb
@return {shaka.extern.StreamDB}
@private