Пример #1
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_itemId = $this->_reader->readUInt16BE();
     $this->_itemProtectionIndex = $this->_reader->readUInt16BE();
     list($this->_itemName, $this->_contentType, $this->_contentEncoding) = preg_split("/\\x00/", $this->_reader->read($this->getOffset() + $this->getSize() - $this->_reader->getOffset()));
 }
Пример #2
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     while ($this->_reader->getOffset() < $this->getOffset() + $this->getSize()) {
         $this->_values[] = array('priority' => $this->_reader->readUInt16BE());
     }
 }
Пример #3
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     while ($this->_reader->getOffset() < $this->getOffset() + $this->getSize()) {
         $this->_progressiveDownloadInfo[] = array('rate' => $this->_reader->readUInt32BE(), 'initialDelay' => $this->_reader->readUInt32BE());
     }
 }
Пример #4
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 1; $i <= $entryCount; $i++) {
         $this->_sampleToChunkTable[$i] = array('firstChunk' => $this->_reader->readUInt32BE(), 'samplesPerChunk' => $this->_reader->readUInt32BE(), 'sampleDescriptionIndex' => $this->_reader->readUInt32BE());
     }
 }
Пример #5
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     list($this->_name, $this->_location) = preg_split("/\\x00/", $this->_reader->read($this->getOffset() + $this->getSize() - $this->_reader->getOffset()));
 }
Пример #6
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_location = $this->_reader->read($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
 }
Пример #7
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 1; $i <= $entryCount; $i++) {
         $this->_compositionOffsetTable[$i] = array('sampleCount' => $this->_reader->readUInt32BE(), 'sampleOffset' => $this->_reader->readUInt32BE());
     }
 }
Пример #8
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 1; $i <= $entryCount; $i++) {
         $this->_chunkOffsetTable[$i] = $reader->readUInt32BE();
     }
 }
Пример #9
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_maxPDUSize = $this->_reader->readUInt16BE();
     $this->_avgPDUSize = $this->_reader->readUInt16BE();
     $this->_maxBitrate = $this->_reader->readUInt32BE();
     $this->_avgBitrate = $this->_reader->readUInt32BE();
 }
Пример #10
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_schemeType = $this->_reader->read(4);
     $this->_schemeVersion = $this->_reader->readUInt32BE();
     if ($this->hasFlag(1)) {
         $this->_schemeUri = preg_split("/\\x00/", $this->_reader->read($this->getOffset() + $this->getSize() - $this->_reader->getOffset()));
     }
 }
Пример #11
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($this->getVersion() == 1) {
         $this->_fragmentDuration = $this->_reader->readInt64BE();
     } else {
         $this->_fragmentDuration = $this->_reader->readUInt32BE();
     }
 }
Пример #12
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->setContainer(true);
     if ($reader === null) {
         return;
     }
     $this->constructBoxes();
 }
Пример #13
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $groupingType = $this->_reader->readUInt32BE();
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 1; $i <= $entryCount; $i++) {
         $this->_sampleToGroupTable[$i] = array('sampleCount' => $this->_reader->readUInt32BE(), 'groupDescriptionIndex' => $this->_reader->readUInt32BE());
     }
 }
Пример #14
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_language = chr((($tmp = $this->_reader->readUInt16BE()) >> 10 & 0x1f) + 0x60) . chr(($tmp >> 5 & 0x1f) + 0x60) . chr(($tmp & 0x1f) + 0x60);
     $this->_tag = new Zend_Media_Id3v2($this->_reader, array('readonly' => true));
 }
Пример #15
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_balance = (($tmp = $this->_reader->readUInt16BE()) >> 8 & 0xff) + (double) ("0." . (string) ($tmp & 0xff));
     $this->_reader->skip(2);
 }
Пример #16
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  * @todo  The sample flags could be parsed further
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_trackId = $this->_reader->readUInt32BE();
     $this->_defaultSampleDescriptionIndex = $this->_reader->readUInt32BE();
     $this->_defaultSampleDuration = $this->_reader->readUInt32BE();
     $this->_defaultSampleSize = $this->_reader->readUInt32BE();
     $this->_defaultSampleFlags = $this->_reader->readUInt32BE();
 }
Пример #17
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         $this->setFlags(1);
         return;
     }
     $this->_graphicsMode = $this->_reader->readUInt16BE();
     $this->_opcolor = array($this->_reader->readUInt16BE(), $this->_reader->readUInt16BE(), $this->_reader->readUInt16BE());
 }
Пример #18
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_systemId = $this->_reader->readGuid();
     $dataSize = $this->_reader->readUInt32BE();
     $this->_data = $reader->read($dataSize);
 }
Пример #19
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_defaultEncryption = $this->_reader->readUInt24BE();
     $this->_defaultIVSize = $this->_reader->readUInt8();
     $this->_defaultKID = $this->_reader->read(16);
 }
Пример #20
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_sampleSize = $this->_reader->readUInt32BE();
     $sampleCount = $this->_reader->readUInt32BE();
     if ($this->_sampleSize == 0) {
         for ($i = 1; $i <= $sampleCount; $i++) {
             $this->_sampleSizeTable[$i] = $this->_reader->readUInt32BE();
         }
     }
 }
Пример #21
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader = null, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($reader === null) {
         return;
     }
     $this->_reader->skip(4);
     $this->_handlerType = $this->_reader->read(4);
     $this->_reader->skip(12);
     $this->_name = $this->_reader->readString8($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
 }
Пример #22
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($this->getVersion() == 1) {
         $this->_creationTime = $this->_reader->readInt64BE();
         $this->_modificationTime = $this->_reader->readInt64BE();
         $this->_timescale = $this->_reader->readUInt32BE();
         $this->_duration = $this->_reader->readInt64BE();
     } else {
         $this->_creationTime = $this->_reader->readUInt32BE();
         $this->_modificationTime = $this->_reader->readUInt32BE();
         $this->_timescale = $this->_reader->readUInt32BE();
         $this->_duration = $this->_reader->readUInt32BE();
     }
     $this->_language = chr((($tmp = $this->_reader->readUInt16BE()) >> 10 & 0x1f) + 0x60) . chr(($tmp >> 5 & 0x1f) + 0x60) . chr(($tmp & 0x1f) + 0x60);
 }
Пример #23
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 0; $i < $entryCount; $i++) {
         $entry = array();
         if ($this->getVersion() == 1) {
             $entry['segmentDuration'] = $this->_reader->readInt64BE();
             $entry['mediaTime'] = $this->_reader->readInt64BE();
         } else {
             $entry['segmentDuration'] = $this->_reader->readUInt32BE();
             $entry['mediaTime'] = $this->_reader->readInt32BE();
         }
         $entry['mediaRate'] = (double) ($this->_reader->readInt16BE() . "." . $this->_reader->readInt16BE());
         $this->_entries[] = $entry;
     }
 }
Пример #24
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($this->getVersion() == 1) {
         $this->_creationTime = $this->_reader->readInt64BE();
         $this->_modificationTime = $this->_reader->readInt64BE();
         $this->_timescale = $this->_reader->readUInt32BE();
         $this->_duration = $this->_reader->readInt64BE();
     } else {
         $this->_creationTime = $this->_reader->readUInt32BE();
         $this->_modificationTime = $this->_reader->readUInt32BE();
         $this->_timescale = $this->_reader->readUInt32BE();
         $this->_duration = $this->_reader->readUInt32BE();
     }
     $this->_rate = (($tmp = $this->_reader->readUInt32BE()) >> 16 & 0xffff) + (double) ("0." . (string) ($tmp & 0xffff));
     $this->_volume = (($tmp = $this->_reader->readUInt16BE()) >> 8 & 0xff) + (double) ("0." . (string) ($tmp & 0xff));
     $this->_reader->skip(10);
     for ($i = 0; $i < 9; $i++) {
         $this->_matrix[$i] = $this->_reader->readUInt32BE();
     }
     $this->_reader->skip(24);
     $this->_nextTrackId = $this->_reader->readUInt32BE();
 }
Пример #25
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_trackId = $this->_reader->readUInt32BE();
     $reserved = ($tmp = $this->_reader->readUInt32BE()) >> 6 & 0x3ffffff;
     $lengthSizeOfTrafNum = $tmp >> 4 & 0x3;
     $lengthSizeOfTrunNum = $tmp >> 2 & 0x3;
     $lengthSizeOfSampleNum = $tmp & 0x3;
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 0; $i < $entryCount; $i++) {
         $entry = array();
         if ($this->getVersion() == 1) {
             $entry['time'] = $this->_reader->readInt64BE();
             $entry['moofOffset'] = $this->_reader->readInt64BE();
         } else {
             $entry['time'] = $this->_reader->readUInt32BE();
             $entry['moofOffset'] = $this->_reader->readUInt32BE();
         }
         switch ($lengthSizeOfTrafNum) {
             case 0:
                 $entry['trafNumber'] = $this->_reader->readUInt8();
                 break;
             case 1:
                 $entry['trafNumber'] = $this->_reader->readUInt16BE();
                 break;
             case 2:
                 $entry['trafNumber'] = $this->_reader->readUInt32BE();
                 break;
             case 3:
                 $entry['trafNumber'] = $this->_reader->readInt64BE();
                 break;
         }
         switch ($lengthSizeOfTrunNum) {
             case 0:
                 $entry['trunNumber'] = $this->_reader->readUInt8();
                 break;
             case 1:
                 $entry['trunNumber'] = $this->_reader->readUInt16BE();
                 break;
             case 2:
                 $entry['trunNumber'] = $this->_reader->readUInt32BE();
                 break;
             case 3:
                 $entry['trunNumber'] = $this->_reader->readInt64BE();
                 break;
         }
         switch ($lengthSizeOfSampleNum) {
             case 0:
                 $entry['sampleNumber'] = $this->_reader->readUInt8();
                 break;
             case 1:
                 $entry['sampleNumber'] = $this->_reader->readUInt16BE();
                 break;
             case 2:
                 $entry['sampleNumber'] = $this->_reader->readUInt32BE();
                 break;
             case 3:
                 $entry['sampleNumber'] = $this->_reader->readInt64BE();
                 break;
         }
         $this->_entries[] = $entry;
     }
 }
Пример #26
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $data = $this->_reader->read($this->getOffset() + $this->getSize() - $this->_reader->getOffset());
     $dataSize = strlen($data);
     for ($i = 1; $i <= $dataSize; $i++) {
         $this->_sampleDependencyTypeTable[$i] = array('sampleDependsOn' => ($tmp = ord($data[$i - 1])) >> 4 & 0x3, 'sampleIsDependedOn' => $tmp >> 2 & 0x3, 'sampleHasRedundancy' => $tmp & 0x3);
     }
 }
Пример #27
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $entryCount = $this->_reader->readUInt32BE();
     for ($i = 0; $i < $entryCount; $i++) {
         $this->_shadowSyncSampleTable[$i] = array('shadowedSampleNumber' => $this->_reader->readUInt32BE(), 'syncSampleNumber' => $this->_reader->readUInt32BE());
     }
 }
Пример #28
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_sequenceNumber = $this->_reader->readUInt32BE();
 }
Пример #29
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     if ($this->getVersion() == 1) {
         $this->_creationTime = $this->_reader->readInt64BE();
         $this->_modificationTime = $this->_reader->readInt64BE();
         $this->_trackId = $this->_reader->readUInt32BE();
         $this->_reader->skip(4);
         $this->_duration = $this->_reader->readInt64BE();
     } else {
         $this->_creationTime = $this->_reader->readUInt32BE();
         $this->_modificationTime = $this->_reader->readUInt32BE();
         $this->_trackId = $this->_reader->readUInt32BE();
         $this->_reader->skip(4);
         $this->_duration = $this->_reader->readUInt32BE();
     }
     $this->_reader->skip(8);
     $this->_layer = $this->_reader->readInt16BE();
     $this->_alternateGroup = $this->_reader->readInt16BE();
     $this->_volume = (($tmp = $this->_reader->readUInt16BE()) >> 8 & 0xff) + (double) ("0." . (string) ($tmp & 0xff));
     $this->_reader->skip(2);
     for ($i = 0; $i < 9; $i++) {
         $this->_matrix[$i] = $this->_reader->readUInt32BE();
     }
     $this->_width = (($tmp = $this->_reader->readUInt32BE()) >> 16 & 0xffff) + (double) ("0." . (string) ($tmp & 0xffff));
     $this->_height = (($tmp = $this->_reader->readUInt32BE()) >> 16 & 0xffff) + (double) ("0." . (string) ($tmp & 0xffff));
 }
Пример #30
0
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param Zend_Io_Reader $reader  The reader object.
  * @param Array          $options The options array.
  */
 public function __construct($reader, &$options = array())
 {
     parent::__construct($reader, $options);
     $this->_data = $reader->read($this->getSize() - 12);
 }