Codec List Object provides user-friendly information about the * codecs and formats used to encode the content found in the ASF file. * * @package php-reader * @subpackage ASF * @author Sven Vollbehr * @copyright Copyright (c) 2008 The PHP Reader Project Workgroup * @license http://code.google.com/p/php-reader/wiki/License New BSD License * @version $Rev: 102 $ */ final class ASF_Object_CodecList extends ASF_Object { const VIDEO_CODEC = 0x1; const AUDIO_CODEC = 0x2; const UNKNOWN_CODEC = 0xffff; /** @var Array */ private $_entries = array(); /** * 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; } } /** * Returns the array of codec entries. * * @return Array */ public function getEntries() { return $this->_entries; } }