Stream Bitrate Properties Object defines the average bit rate of * each digital media stream. * * @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: 108 $ */ final class ASF_Object_StreamBitrateProperties extends ASF_Object { /** @var Array */ private $_bitrateRecords = 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); $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()); } /** * Returns an array of bitrate records. Each record consists of the following * keys. * * o streamNumber -- Specifies the number of this stream described by this * record. 0 is an invalid stream. Valid values are between 1 and 127. * * o flags -- These bits are reserved and should be set to 0. * * o averageBitrate -- Specifies the average bit rate of the stream in bits * per second. This value should include an estimate of ASF packet and * payload overhead associated with this stream. * * @return Array */ public function getBitrateRecords() { return $this->_bitrateRecords; } }