ISOWebVTTCue::ISOWebVTTCue(const MediaTime& presentationTime, const MediaTime& duration, JSC::ArrayBuffer* buffer) : ISOBox(buffer) , m_presentationTime(presentationTime) , m_duration(duration) { size_t offset = ISOBox::boxHeaderSize(); while (offset < length() && length() - offset > ISOBox::boxHeaderSize()) { RefPtr<ArrayBuffer> subBuffer = buffer->slice(offset); String boxType = ISOBox::peekType(subBuffer.get()); size_t boxSize = ISOBox::peekLength(subBuffer.get()); size_t boxDataSize = boxSize - ISOBox::boxHeaderSize(); if (boxType == vttCueSourceIDBoxType()) m_sourceID = peekString(subBuffer.get(), ISOBox::boxHeaderSize(), boxDataSize); else if (boxType == vttIdBoxType()) m_identifer = peekString(subBuffer.get(), ISOBox::boxHeaderSize(), boxDataSize); else if (boxType == vttCurrentTimeBoxType()) m_originalStartTime = peekString(subBuffer.get(), ISOBox::boxHeaderSize(), boxDataSize); else if (boxType == vttSettingsBoxType()) m_settings = peekString(subBuffer.get(), ISOBox::boxHeaderSize(), boxDataSize); else if (boxType == vttPayloadBoxType()) m_cueText = peekString(subBuffer.get(), ISOBox::boxHeaderSize(), boxDataSize); else LOG(Media, "ISOWebVTTCue::ISOWebVTTCue - skipping box id = \"%s\", size = %zu", boxType.utf8().data(), boxSize); offset += boxSize; } }
void Script_v6::o6_loadCursor(FuncParams ¶ms) { int16 id = (int16) readUint16(); startFunc(params); print("%d, ", id); if (id == -1) { print("%s, ", peekString()); skip(9); print("%d, ", readUint16()); print("%d", (int8) readUint8()); } else if (id == -2) { print("%d, ", readUint16()); print("%d, ", readUint16()); print("%d", (int8) readUint8()); } else { print("%d", (int8) readUint8()); } endFunc(); }
QString QByteArrayBuilder::getString(){ QString s = peekString(); pointer += s.size() + 1; //remove(0, s.size() + 1); return s; }