Sync Sample Box provides a compact marking of the random access * points within the stream. The table is arranged in strictly increasing order * of sample number. If the sync sample box is not present, every sample is a * random access point. * * @package php-reader * @subpackage ISO 14496 * @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: 92 $ */ final class ISO14496_Box_STSS extends ISO14496_Box_Full { /** @var Array */ private $_syncSampleTable = array(); /** * Constructs the class with given parameters and reads box related data from * the ISO Base Media file. * * @param Reader $reader The reader object. */ public function __construct($reader, &$options = array()) { parent::__construct($reader, $options); $entryCount = $this->_reader->readUInt32BE(); $data = $this->_reader->read ($this->getOffset() + $this->getSize() - $this->_reader->getOffset()); for ($i = 1; $i <= $entryCount; $i++) $this->_syncSampleTable[$i] = Transform::fromUInt32BE(substr($data, ($i - 1) * 4, 4)); } /** * Returns an array of values. Each entry has the entry number as its index * and an integer that gives the numbers of the samples that are random access * points in the stream as its value. * * @return Array */ public function getSyncSampleTable() { return $this->_syncSampleTable; } }