From a435de089da4dd37c3c183f633a49107c720dd95 Mon Sep 17 00:00:00 2001 From: Dalyn Cessac Date: Wed, 16 Mar 2011 11:06:40 -0500 Subject: Added phpvideotoolkit transcoder and updates to the preset ui --- .../php-reader/src/ISO14496/Box/STSZ.php | 110 +++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 libraries/phpvideotoolkit/adapters/ffmpeg-php/php-reader/src/ISO14496/Box/STSZ.php (limited to 'libraries/phpvideotoolkit/adapters/ffmpeg-php/php-reader/src/ISO14496/Box/STSZ.php') diff --git a/libraries/phpvideotoolkit/adapters/ffmpeg-php/php-reader/src/ISO14496/Box/STSZ.php b/libraries/phpvideotoolkit/adapters/ffmpeg-php/php-reader/src/ISO14496/Box/STSZ.php new file mode 100644 index 0000000..21ba170 --- /dev/null +++ b/libraries/phpvideotoolkit/adapters/ffmpeg-php/php-reader/src/ISO14496/Box/STSZ.php @@ -0,0 +1,110 @@ +Sample Size Box contains the sample count and a table giving the + * size in bytes of each sample. This allows the media data itself to be + * unframed. The total number of samples in the media is always indicated in the + * sample count. + * + * There are two variants of the sample size box. The first variant has a fixed + * size 32-bit field for representing the sample sizes; it permits defining a + * constant size for all samples in a track. The second variant permits smaller + * size fields, to save space when the sizes are varying but small. One of these + * boxes must be present; the first version is preferred for maximum + * compatibility. + * + * @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_STSZ extends ISO14496_Box_Full +{ + /** @var integer */ + private $_sampleSize; + + /** @var Array */ + private $_sampleSizeTable = 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); + + $this->_sampleSize = $this->_reader->readUInt32BE(); + $sampleCount = $this->_reader->readUInt32BE(); + if ($this->_sampleSize == 0) { + $data = $this->_reader->read + ($this->getOffset() + $this->getSize() - $this->_reader->getOffset()); + for ($i = 1; $i <= $sampleCount; $i++) + $this->_sampleSizeTable[$i] = + Transform::fromUInt32BE(substr($data, ($i - 1) * 4, 4)); + } + } + + /** + * Returns the default sample size. If all the samples are the same size, this + * field contains that size value. If this field is set to 0, then the samples + * have different sizes, and those sizes are stored in the sample size table. + * + * @return integer + */ + public function getSampleSize() { return $this->_sampleSize; } + + /** + * Returns an array of sample sizes specifying the size of a sample, indexed + * by its number. + * + * @return Array + */ + public function getSampleSizeTable() + { + return $this->_sampleSizeTable; + } +} -- cgit v1.2.3