/** * Reads and constructs the objects found within this object. */ protected function constructObjects($defaultclassnames = array()) { while (true) { $offset = $this->_reader->getOffset(); if ($offset >= $this->getOffset() + $this->getSize()) break; $guid = $this->_reader->readGUID(); $size = $this->_reader->readInt64LE(); $this->_reader->setOffset($offset); if (isset($defaultclassnames[$guid])) { if (@fopen($filename = "ASF/Object/" . $defaultclassnames[$guid] . ".php", "r", true) !== false) require_once($filename); if (class_exists ($classname = "ASF_Object_" . $defaultclassnames[$guid])) $object = new $classname($this->_reader, $this->_options); else $object = new ASF_Object($this->_reader, $this->_options); } else $object = new ASF_Object($this->_reader, $this->_options); $object->setParent($this); if (!$this->hasObject($object->getIdentifier())) $this->_objects[$object->getIdentifier()] = array(); $this->_objects[$object->getIdentifier()][] = $object; $this->_reader->setOffset($offset + $size); } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $dataSize = $this->_reader->readUInt32LE(); $this->_data = $this->_reader->read($dataSize); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_reader->skip(16); $markersCount = $this->_reader->readUInt32LE(); $this->_reader->skip(2); $nameLength = $this->_reader->readUInt16LE(); $this->_name = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($nameLength)); for ($i = 0; $i < $markersCount; $i++) { $marker = array ("offset" => $this->_reader->readInt64LE(), "presentationTime" => $this->_reader->readInt64LE()); $this->_reader->skip(2); $marker["sendTime"] = $this->_reader->readUInt32LE(); $marker["flags"] = $this->_reader->readUInt32LE(); $descriptionLength = $this->_reader->readUInt32LE(); $marker["description"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($descriptionLength)); $this->_markers[] = $marker; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_profile = $this->_reader->readUInt8(); $this->_mode = $this->_reader->readUInt8(); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param string $id The object GUID identifier. * @param integer $size The object size. */ public function __construct($reader, $id, $size) { parent::__construct($reader, $id, $size); $contentDescriptorsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $contentDescriptorsCount; $i++) { $nameLen = $this->_reader->readUInt16LE(); $name = $this->_reader->readString16LE($nameLen); $valueDataType = $this->_reader->readUInt16LE(); $valueLen = $this->_reader->readUInt16LE(); switch ($valueDataType) { case 0: case 1: // string $this->_contentDescriptors[$name] = $this->_reader->readString16LE($valueLen); break; case 2: // bool // bool case 3: // 32-bit integer $this->_contentDescriptors[$name] = $this->_reader->readUInt32LE(); break; case 4: // 64-bit integer $this->_contentDescriptors[$name] = $this->_reader->readInt64LE(); break; case 5: // 16-bit integer $this->_contentDescriptors[$name] = $this->_reader->readUInt16LE(); break; default: } } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $contentDescriptorsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $contentDescriptorsCount; $i++) { $nameLen = $this->_reader->readUInt16LE(); $name = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($nameLen)); $valueDataType = $this->_reader->readUInt16LE(); $valueLen = $this->_reader->readUInt16LE(); switch ($valueDataType) { case 0: case 1: // string $this->_contentDescriptors[$name] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($valueLen)); break; case 2: // bool case 3: // 32-bit integer $this->_contentDescriptors[$name] = $this->_reader->readUInt32LE(); break; case 4: // 64-bit integer $this->_contentDescriptors[$name] = $this->_reader->readInt64LE(); break; case 5: // 16-bit integer $this->_contentDescriptors[$name] = $this->_reader->readUInt16LE(); break; default: } } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $titleLen = $this->_reader->readUInt16LE(); $authorLen = $this->_reader->readUInt16LE(); $copyrightLen = $this->_reader->readUInt16LE(); $descriptionLen = $this->_reader->readUInt16LE(); $ratingLen = $this->_reader->readUInt16LE(); $this->_title = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($titleLen)); $this->_author = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($authorLen)); $this->_copyright = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($copyrightLen)); $this->_description = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($descriptionLen)); $this->_rating = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($ratingLen)); }
/** * Sets the box size. The size must include the header. * * @param integer $size The box size. */ public function setSize($size) { if ($this->_parent !== null) $this->_parent->setSize (($this->_parent->getSize() > 0 ? $this->_parent->getSize() : 0) + $size - ($this->_size > 0 ? $this->_size : 0)); $this->_size = $size; }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_exclusionType = $this->_reader->readGUID(); $streamNumbersCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $streamNumbersCount; $i++) $this->_streamNumbers[] = $this->_reader->readUInt16LE(); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_signatureType = $this->_reader->readUInt32LE(); $signatureDataLength = $this->_reader->readUInt32LE(); $this->_signatureData = $this->_reader->read($signatureDataLength); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_type = $this->_reader->readGUID(); $dataLength = $this->_reader->readUInt32LE(); $this->_data = $this->_reader->read($dataLength); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param string $id The object GUID identifier. * @param integer $size The object size. */ public function __construct($reader, $id, $size) { parent::__construct($reader, $id, $size); $this->_readerSOffset = $this->_reader->getOffset(); $this->_objectCount = $this->_reader->readUInt32LE(); $this->_reader->skip(2); $this->_readerCOffset = $this->_reader->getOffset(); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $priorityRecordCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $priorityRecordCount; $i++) $this->_priorityRecords[] = array ("streamNumber" => $this->_reader->readUInt16LE(), "flags" => $this->_reader->readUInt16LE()); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $bitrateRecordsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $bitrateRecordsCount; $i++) $this->_bitrateRecords[] = array ("streamNumber" => ($tmp = $this->_reader->readInt16LE()) & 0x1f, "flags" => $tmp >> 5, "averageBitrate" => $this->_reader->readUInt32LE()); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_sharingType = $this->_reader->readGUID(); $this->_dataBitrate = $this->_reader->readUInt32LE(); $this->_bufferSize = $this->_reader->readUInt32LE(); $streamNumbersCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $streamNumbersCount; $i++) $this->_streamNumbers[] = $this->_reader->readUInt16LE(); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $languageIdRecordsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $languageIdRecordsCount; $i++) { $languageIdLength = $this->_reader->readInt8(); $languageId = $this->_reader->readString16LE($languageIdLength); $this->_languages[] = iconv ("utf-16le", $this->getOption("encoding"), $languageId); } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_indexEntryTimeInterval = $this->_reader->readUInt32LE(); $indexSpecifiersCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $indexSpecifiersCount; $i++) { $this->_indexSpecifiers[] = array ("streamNumber" => $this->_reader->readUInt16LE(), "indexType" => $this->_reader->readUInt16LE()); } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_fileId = $this->_reader->readGUID(); $this->_totalDataPackets = $this->_reader->readInt64LE(); $this->_reader->skip(2); /* Data packets are not supported * for ($i = 0; $i < $this->_totalDataPackets; $i++) { * $this->_dataPackets[] = new ASF_Object_Data_Packet($reader); * } */ }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $secretDataLength = $this->_reader->readUInt32LE(); $this->_secretData = $this->_reader->read($secretDataLength); $protectionTypeLength = $this->_reader->readUInt32LE(); $this->_protectionType = $this->_reader->readString8($protectionTypeLength); $keyIdLength = $this->_reader->readUInt32LE(); $this->_keyId = $this->_reader->readString8($keyIdLength); $licenseUrlLength = $this->_reader->readUInt32LE(); $this->_licenseUrl = $this->_reader->readString8($licenseUrlLength); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param string $id The object GUID identifier. * @param integer $size The object size. */ public function __construct($reader, $id, $size) { parent::__construct($reader, $id, $size); $titleLen = $this->_reader->readUInt16LE(); $authorLen = $this->_reader->readUInt16LE(); $copyrightLen = $this->_reader->readUInt16LE(); $descriptionLen = $this->_reader->readUInt16LE(); $ratingLen = $this->_reader->readUInt16LE(); $this->_title = $this->_reader->readString16LE($titleLen); $this->_author = $this->_reader->readString16LE($authorLen); $this->_copyright = $this->_reader->readString16LE($copyrightLen); $this->_description = $this->_reader->readString16LE($descriptionLen); $this->_rating = $this->_reader->readString16LE($ratingLen); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_exclusionType = $this->_reader->readGUID(); $recordCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $recordCount; $i++) { $streamNumbersCount = $this->_reader->readUInt16LE(); $streamNumbers = array(); for ($j = 0; $j < $streamNumbersCount; $j++) $streamNumbers[] = array ("streamNumbers" => $this->_reader->readUInt16LE()); $this->_records[] = $streamNumbers; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_fileId = $this->_reader->readGUID(); $this->_indexEntryTimeInterval = $this->_reader->readInt64LE(); $this->_maximumPacketCount = $this->_reader->readUInt32LE(); $indexEntriesCount = $this->_reader->readUInt32LE(); for ($i = 0; $i < $indexEntriesCount; $i++) { $this->_indexEntries[] = array ("packetNumber" => $this->_reader->readUInt32LE(), "packetCount" => $this->_reader->readUInt16LE()); } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $contentEncryptionRecordsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $contentEncryptionRecordsCount; $i++) { $entry = array("systemId" => $this->_reader->readGUID(), "systemVersion" => $this->_reader->readUInt32LE(), "streamNumbers" => array()); $encryptedObjectRecordCount = $this->_reader->readUInt16LE(); for ($j = 0; $j < $encryptedObjectRecordCount; $j++) { $this->_reader->skip(4); $entry["streamNumbers"][] = $this->_reader->readUInt16LE(); } $dataCount = $this->_reader->readUInt32LE(); $entry["data"] = $this->_reader->read($dataCount); $this->_contentEncryptionRecords[] = $entry; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $descriptionRecordsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $descriptionRecordsCount; $i++) { $descriptionRecord = array ("languageIndex" => $this->_reader->readUInt16LE(), "streamNumber" => $this->_reader->readUInt16LE()); $nameLength = $this->_reader->readUInt16LE(); $dataType = $this->_reader->readUInt16LE(); $dataLength = $this->_reader->readUInt32LE(); $descriptionRecord["name"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($nameLength)); switch ($dataType) { case 0: // Unicode string $descriptionRecord["data"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($dataLength)); break; case 1: // BYTE array $descriptionRecord["data"] = $this->_reader->read($dataLength); break; case 2: // BOOL $descriptionRecord["data"] = $this->_reader->readUInt16LE() == 1; break; case 3: // DWORD $descriptionRecord["data"] = $this->_reader->readUInt32LE(); break; case 4: // QWORD $descriptionRecord["data"] = $this->_reader->readInt64LE(); break; case 5: // WORD $descriptionRecord["data"] = $this->_reader->readUInt16LE(); break; case 6: // GUID $descriptionRecord["data"] = $this->_reader->readGUID(); break; } $this->_descriptionRecords[] = $descriptionRecord; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_reader->skip(16); $codecEntriesCount = $this->_reader->readUInt32LE(); for ($i = 0; $i < $codecEntriesCount; $i++) { $entry = array("type" => $this->_reader->readUInt16LE()); $codecNameLength = $this->_reader->readUInt16LE() * 2; $entry["codecName"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($codecNameLength)); $codecDescriptionLength = $this->_reader->readUInt16LE() * 2; $entry["codecDescription"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($codecDescriptionLength)); $codecInformationLength = $this->_reader->readUInt16LE(); $entry["codecInformation"] = $this->_reader->read($codecInformationLength); $this->_entries[] = $entry; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $descriptionRecordsCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $descriptionRecordsCount; $i++) { $this->_reader->skip(2); $record = array("streamNumber" => $this->_reader->readUInt16LE()); $nameLength = $this->_reader->readUInt16LE(); $dataType = $this->_reader->readUInt16LE(); $dataLength = $this->_reader->readUInt32LE(); $record["name"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($nameLength)); switch ($dataType) { case 0: $record["data"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($dataLength)); break; case 1: $record["data"] = $this->_reader->readString16LE($dataLength); break; case 2: $record["data"] = $this->_reader->readUInt16LE() ? true : false; break; case 3: $record["data"] = $this->_reader->readUInt32LE(); break; case 4: $record["data"] = $this->_reader->readInt64LE(); break; case 5: $record["data"] = $this->_reader->readUInt16LE(); break; } $this->_descriptions[] = $record; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_reader->skip(16); $commandsCount = $this->_reader->readUInt16LE(); $commandTypesCount = $this->_reader->readUInt16LE(); for ($i = 0; $i < $commandTypesCount; $i++) { $commandTypeNameLength = $this->_reader->readUInt16LE(); $this->_commandTypes[] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($commandTypeNameLength * 2)); } for ($i = 0; $i < $commandsCount; $i++) { $command = array ("presentationTime" => $this->_reader->readUInt32LE(), "typeIndex" => $this->_reader->readUInt16LE()); $commandNameLength = $this->_reader->readUInt16LE(); $command["name"] = iconv ("utf-16le", $this->getOption("encoding"), $this->_reader->readString16LE($commandNameLength * 2)); $this->_commands[] = $command; } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_reader->skip(4); $indexSpecifiersCount = $this->_reader->readUInt16LE(); $indexBlocksCount = $this->_reader->readUInt32LE(); for ($i = 0; $i < $indexSpecifiersCount; $i++) $this->_indexSpecifiers[] = array ("streamNumber" => $this->_reader->readUInt16LE(), "indexType" => $this->_reader->readUInt16LE()); for ($i = 0; $i < $indexBlocksCount; $i++) { $indexEntryCount = $this->_reader->readUInt32LE(); $timecodeRange = $this->_reader->readUInt16LE(); $blockPositions = array(); for ($i = 0; $i < $indexSpecifiersCount; $i++) $blockPositions[] = $this->_reader->readInt64LE(); $indexEntries = array(); for ($i = 0; $i < $indexEntryCount; $i++) { $timecode = $this->_reader->readUInt32LE(); $offsets = array(); for ($i = 0; $i < $indexSpecifiersCount; $i++) $offsets[] = $this->_reader->readUInt32LE(); $indexEntries[] = array ("timecode" => $timecode, "offsets" => $offsets); } $this->_indexBlocks[] = array ("timecodeRange" => $timecodeRange, "blockPositions" => $blockPositions, "indexEntries" => $indexEntries); } }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_fileId = $this->_reader->readGUID(); $this->_fileSize = $this->_reader->readInt64LE(); $this->_creationDate = $this->_reader->readInt64LE(); $this->_dataPacketsCount = $this->_reader->readInt64LE(); $this->_playDuration = $this->_reader->readInt64LE(); $this->_sendDuration = $this->_reader->readInt64LE(); $this->_preroll = $this->_reader->readInt64LE(); $this->_flags = $this->_reader->readUInt32LE(); $this->_minimumDataPacketSize = $this->_reader->readUInt32LE(); $this->_maximumDataPacketSize = $this->_reader->readUInt32LE(); $this->_maximumBitrate = $this->_reader->readUInt32LE(); }
/** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $this->_indexEntryTimeInterval = $this->_reader->readUInt32LE(); $indexSpecifiersCount = $this->_reader->readUInt16LE(); $indexBlocksCount = $this->_reader->readUInt32LE(); for ($i = 0; $i < $indexSpecifiersCount; $i++) $this->_indexSpecifiers[] = array ("streamNumber" => $this->_reader->readUInt16LE(), "indexType" => $this->_reader->readUInt16LE()); for ($i = 0; $i < $indexBlocksCount; $i++) { $indexEntryCount = $this->_reader->readUInt32LE(); $blockPositions = array(); for ($i = 0; $i < $indexSpecifiersCount; $i++) $blockPositions[] = $this->_reader->readInt64LE(); $offsets = array(); for ($i = 0; $i < $indexSpecifiersCount; $i++) $offsets[] = $this->_reader->readUInt32LE(); $this->_indexBlocks[] = array ("blockPositions" => $blockPositions, "indexEntryOffsets" => $offsets); } }