コード例 #1
0
ファイル: Meta.php プロジェクト: hausdesign/zf-library
 /**
  * Constructs the class with given parameters and reads box related data
  * from the ISO Base Media file.
  *
  * @param HausDesign_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();
 }
コード例 #2
0
ファイル: Stsc.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($entryCount = count($this->_sampleToChunkTable));
     for ($i = 1; $i <= $entryCount; $i++) {
         $writer->writeUInt32BE($this->_sampleToChunkTable[$i]['firstChunk'])->writeUInt32BE($this->_sampleToChunkTable[$i]['samplesPerChunk'])->writeUInt32BE($this->_sampleToChunkTable[$i]['sampleDescriptionIndex']);
     }
 }
コード例 #3
0
ファイル: Trex.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($this->_trackId)->writeUInt32BE($this->_defaultSampleDescriptionIndex)->writeUInt32BE($this->_defaultSampleDuration)->writeUInt32BE($this->_defaultSampleSize)->writeUInt32BE($this->_defaultSampleFlags);
 }
コード例 #4
0
ファイル: Mfro.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($this->_parentSize);
 }
コード例 #5
0
ファイル: Id32.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt16BE(ord($this->_language[0]) - 0x60 << 10 | ord($this->_language[1]) - 0x60 << 5 | ord($this->_language[2]) - 0x60);
     $this->_tag->write($writer);
 }
コード例 #6
0
ファイル: Stss.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($entryCount = count($this->_syncSampleTable));
     for ($i = 1; $i <= $entryCount; $i++) {
         $writer->writeUInt32BE($this->_syncSampleTable[$i]);
     }
 }
コード例 #7
0
ファイル: Hdlr.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->write(str_pad('', 4, ""))->write($this->_handlerType)->writeUInt32BE(0)->writeUInt32BE(0)->writeUInt32BE(0)->writeString8($this->_name, 1);
 }
コード例 #8
0
ファイル: Vmhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt16BE($this->_graphicsMode)->writeUInt16BE($this->_opcolor[0])->writeUInt16BE($this->_opcolor[1])->writeUInt16BE($this->_opcolor[2]);
 }
コード例 #9
0
ファイル: Co64.php プロジェクト: hausdesign/zf-library
 /**
  * Returns the box heap size in bytes.
  *
  * @return integer
  */
 public function getHeapSize()
 {
     return parent::getHeapSize() + 4 + count($this->_chunkOffsetTable) * 8;
 }
コード例 #10
0
ファイル: Mdhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     if ($this->getVersion() == 1) {
         $writer->writeInt64BE($this->_creationTime)->writeInt64BE($this->_modificationTime)->writeUInt32BE($this->_timescale)->writeInt64BE($this->_duration);
     } else {
         $writer->writeUInt32BE($this->_creationTime)->writeUInt32BE($this->_modificationTime)->writeUInt32BE($this->_timescale)->writeUInt32BE($this->_duration);
     }
     $writer->writeUInt16BE(ord($this->_language[0]) - 0x60 << 10 | ord($this->_language[1]) - 0x60 << 5 | ord($this->_language[2]) - 0x60)->write(str_pad('', 2, ""));
 }
コード例 #11
0
ファイル: Urn.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeString8($this->_name, 1)->write($this->_location);
 }
コード例 #12
0
ファイル: Mvhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     if ($this->getVersion() == 1) {
         $writer->writeInt64BE($this->_creationTime)->writeInt64BE($this->_modificationTime)->writeUInt32BE($this->_timescale)->writeInt64BE($this->_duration);
     } else {
         $writer->writeUInt32BE($this->_creationTime)->writeUInt32BE($this->_modificationTime)->writeUInt32BE($this->_timescale)->writeUInt32BE($this->_duration);
     }
     @(list(, $rateDecimals) = explode('.', (double) $this->_rate));
     @(list(, $volumeDecimals) = explode('.', (double) $this->_volume));
     $writer->writeUInt32BE(floor($this->_rate) << 16 | $rateDecimals)->writeUInt16BE(floor($this->_volume) << 8 | $volumeDecimals)->write(str_pad('', 10, ""));
     for ($i = 0; $i < 9; $i++) {
         $writer->writeUInt32BE($this->_matrix[$i]);
     }
     $writer->write(str_pad('', 24, ""))->writeUInt32BE($this->_nextTrackId);
 }
コード例 #13
0
ファイル: Hmhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt16BE($this->_maxPDUSize)->writeUInt16BE($this->_avgPDUSize)->writeUInt16BE($this->_maxBitrate)->writeUInt16BE($this->_avgBitrate);
 }
コード例 #14
0
ファイル: Mehd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     if ($this->getVersion() == 1) {
         $writer->writeInt64BE($this->_fragmentDuration);
     } else {
         $writer->writeUInt32BE($this->_fragmentDuration);
     }
 }
コード例 #15
0
ファイル: Mfhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($this->_sequenceNumber);
 }
コード例 #16
0
ファイル: Infe.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt16BE($this->_itemId)->writeUInt16BE($this->_itemProtectionIndex)->writeString8($this->_itemName, 1)->writeString8($this->_contentType, 1)->writeString8($this->_contentEncoding, 1);
 }
コード例 #17
0
ファイル: Cprt.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt16BE(ord($this->_language[0]) - 0x60 << 10 | ord($this->_language[1]) - 0x60 << 5 | ord($this->_language[2]) - 0x60)->writeString8($this->_notice, 1);
 }
コード例 #18
0
ファイル: Smhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     @(list(, $balanceDecimals) = explode('.', (double) $this->_balance));
     $writer->writeInt16BE(floor($this->_balance) << 8 | $balanceDecimals)->writeInt16BE(0);
 }
コード例 #19
0
ファイル: Stts.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($entryCount = count($this->_timeToSampleTable));
     for ($i = 1; $i <= $entryCount; $i++) {
         $writer->writeUInt32BE($this->_timeToSampleTable[$i]['sampleCount'])->writeUInt32BE($this->_timeToSampleTable[$i]['sampleDelta']);
     }
 }
コード例 #20
0
ファイル: Schm.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->write($this->_schemeType);
     $writer->writeUInt32BE($this->_schemeVersion);
     if ($this->hasFlag(1)) {
         $writer->writeString8($this->_schemeUri, 1);
     }
 }
コード例 #21
0
ファイル: Tkhd.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     if ($this->getVersion() == 1) {
         $writer->writeInt64BE($this->_creationTime)->writeInt64BE($this->_modificationTime)->writeUInt32BE($this->_trackId)->writeUInt32BE(0)->writeInt64BE($this->_duration);
     } else {
         $writer->writeUInt32BE($this->_creationTime)->writeUInt32BE($this->_modificationTime)->writeUInt32BE($this->_trackId)->writeUInt32BE(0)->writeUInt32BE($this->_duration);
     }
     @(list(, $volumeDecimals) = explode('.', (double) $this->_volume));
     $writer->write(str_pad('', 8, ""))->writeInt16BE($this->_layer)->writeInt16BE($this->_alternateGroup)->writeUInt16BE(floor($this->_volume) << 8 | $volumeDecimals)->write(str_pad('', 2, ""));
     for ($i = 0; $i < 9; $i++) {
         $writer->writeUInt32BE($this->_matrix[$i]);
     }
     @(list(, $widthDecimals) = explode('.', (double) $this->_width));
     @(list(, $heightDecimals) = explode('.', (double) $this->_height));
     $writer->writeUInt32BE(floor($this->_width) << 16 | $widthDecimals)->writeUInt32BE(floor($this->_height) << 16 | $heightDecimals);
 }
コード例 #22
0
ファイル: Stdp.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     for ($i = 0; $i < count($this->_values); $i++) {
         $writer->writeUInt16BE($this->_values[$i]['priority']);
     }
 }
コード例 #23
0
ファイル: Sbgp.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($this->_groupingType);
     $writer->writeUInt32BE($entryCount = count($this->_sampleToGroupTable));
     for ($i = 1; $i <= $entryCount; $i++) {
         $writer->writeUInt32BE($this->_sampleToGroupTable[$i]['sampleCount'])->writeUInt32BE($this->_sampleToGroupTable[$i]['groupDescriptionIndex']);
     }
 }
コード例 #24
0
ファイル: Tfra.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $lengthSizes = $this->_getLengthSizes();
     $writer->writeUInt32BE($this->_trackId)->writeUInt32BE($lengthSizes['trafNum'] << 4 | $lengthSizes['trunNum'] << 2 | $lengthSizes['sampleNum'])->writeUInt32BE($entryCount = count($this->_entries));
     for ($i = 0; $i < $entryCount; $i++) {
         if ($this->getVersion() == 1) {
             $writer->writeInt64BE($this->_entries[$i]['time'])->writeInt64BE($this->_entries[$i]['mediaTime']);
         } else {
             $writer->writeUInt32BE($this->_entries[$i]['time'])->writeInt32BE($this->_entries[$i]['moofOffset']);
         }
         switch ($lengthSizes['trafNum']) {
             case 0:
                 $writer->writeUInt8($this->_entries[$i]['trafNumber']);
                 break;
             case 1:
                 $writer->writeUInt16BE($this->_entries[$i]['trafNumber']);
                 break;
             case 2:
                 $writer->writeUInt32BE($this->_entries[$i]['trafNumber']);
                 break;
             case 3:
                 $writer->writeInt64BE($this->_entries[$i]['trafNumber']);
                 break;
         }
         switch ($lengthSizes['trunNum']) {
             case 0:
                 $writer->writeUInt8($this->_entries[$i]['trunNumber']);
                 break;
             case 1:
                 $writer->writeUInt16BE($this->_entries[$i]['trunNumber']);
                 break;
             case 2:
                 $writer->writeUInt32BE($this->_entries[$i]['trunNumber']);
                 break;
             case 3:
                 $writer->writeInt64BE($this->_entries[$i]['trunNumber']);
                 break;
         }
         switch ($lengthSizes['sampleNum']) {
             case 0:
                 $writer->writeUInt8($this->_entries[$i]['sampleNumber']);
                 break;
             case 1:
                 $writer->writeUInt16BE($this->_entries[$i]['sampleNumber']);
                 break;
             case 2:
                 $writer->writeUInt32BE($this->_entries[$i]['sampleNumber']);
                 break;
             case 3:
                 $writer->writeInt64BE($this->_entries[$i]['sampleNumber']);
                 break;
         }
     }
 }
コード例 #25
0
ファイル: Url.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->write($this->_location);
 }
コード例 #26
0
ファイル: Ctts.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($entryCount = count($this->_compositionOffsetTable));
     for ($i = 1; $i <= $entryCount; $i++) {
         $writer->writeUInt32BE($this->_compositionOffsetTable[$i]['sampleCount'])->writeUInt32BE($this->_compositionOffsetTable[$i]['sampleOffset']);
     }
 }
コード例 #27
0
ファイル: Dref.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt32BE($this->getBoxCount());
 }
コード例 #28
0
ファイル: Pdin.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     for ($i = 0; $i < count($this->_timeToSampleTable); $i++) {
         $writer->writeUInt32BE($this->_progressiveDownloadInfo[$i]['rate'])->writeUInt32BE($this->_progressiveDownloadInfo[$i]['initialDelay']);
     }
 }
コード例 #29
0
ファイル: Pitm.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     $writer->writeUInt16BE($this->_itemId);
 }
コード例 #30
0
ファイル: Sdtp.php プロジェクト: hausdesign/zf-library
 /**
  * Writes the box data.
  *
  * @param HausDesign_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     parent::_writeData($writer);
     for ($i = 1; $i <= count($this->_sampleDependencyTypeTable); $i++) {
         $writer->write(chr(($this->_sampleDependencyTypeTable[$i]['sampleDependsOn'] & 0x3) << 4 | ($this->_sampleDependencyTypeTable[$i]['sampleIsDependedOn'] & 0x3) << 2 | $this->_sampleDependencyTypeTable[$i]['sampleHasRedundancy'] & 0x3));
     }
 }