decodeCea708_(dtvccPacket) {
    const parsedClosedCaptions = [];
    try {
      while (dtvccPacket.hasMoreData()) {
        // Process a service block.
        const serviceBlockHeader = dtvccPacket.readByte().value;

        // First 3 bits are service number, next 5 are block size,
        // representing the number of bytes coming in this block
        // (excluding a possible extended service block header byte)
        let serviceNumber = (serviceBlockHeader & 0xe0) >> 5;
        const blockSize = serviceBlockHeader & 0x1f;

        if (serviceNumber === /* 0b111 */ 0x07 && blockSize != 0) {
          // 2 bits null padding, 6 bits extended service number
          const extendedServiceBlockHeader = dtvccPacket.readByte().value;
          serviceNumber = extendedServiceBlockHeader & 0x3f;
        }

        // As per CEA-708-E, service number 0 is invalid, and should be ignored.
        if (serviceNumber != 0) {
          this.streams_.add('svc'+ serviceNumber);
          // If the service doesn't already exist, create it.
          if (!this.serviceNumberToService_.has(serviceNumber)) {
            const service = new shaka.cea.Cea708Service(serviceNumber);
            this.serviceNumberToService_.set(serviceNumber, service);
          }
          const service = this.serviceNumberToService_.get(serviceNumber);

          // Process all control codes.
          const startPos = dtvccPacket.getPosition();

          // Execute this loop `blockSize` times, to decode the control codes.
          while (dtvccPacket.getPosition() - startPos < blockSize) {
            const closedCaptions = service.handleCea708ControlCode(dtvccPacket);
            parsedClosedCaptions.push(...closedCaptions);
          }  // position < end of block
        }  // serviceNumber != 0
      }  // hasMoreData
    } catch (error) {
      if (error instanceof shaka.util.Error &&
      error.code === shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS) {
        shaka.log.warnOnce('CEA708_INVALID_DATA',
            'Buffer read out of bounds / invalid CEA-708 Data.');
      } else {
        // This is an unexpected error, and should be rethrown.
        throw error;
      }
    }
    return parsedClosedCaptions;
  }
Decodes a CEA-708 DTVCC packet based on ANSI/CTA-708-E.
@param {shaka.cea.DtvccPacket} dtvccPacket
@return {!Array<!shaka.extern.ICaptionDecoder.ClosedCaption>}
@private