Esempio n. 1
0
 /**
  * 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);
   
   while ($this->_reader->getOffset <= $this->getSize())
     $this->_trackId[] = $this->_reader->readUInt32BE();
 }
Esempio n. 2
0
 /**
  * Sets the box size. The size must include the size and type header,
  * fields, and all contained boxes.
  *
  * The method will propagate size change to box parents.
  * 
  * @param integer $size The box size.
  */
 public function setSize($size)
 {
   if ($this->_parent !== null)
     $this->_parent->setSize
       (($this->_parent->getSize() > 0 ? $this->_parent->getSize() : 0) +
        $size - ($this->_size > 0 ? $this->_size : 0));
   $this->_size = $size;
 }
Esempio n. 3
0
 /**
  * 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 = null, &$options = array())
 {
   parent::__construct($reader, $options);
   $this->setContainer(true);
   
   if ($reader === null)
     return;
   
   $this->constructBoxes();
 }
Esempio n. 4
0
 /**
  * Returns the box raw data.
  *
  * @return string
  */
 public function __toString($data = "")
 {
   return parent::__toString(Transform::toUInt16BE(count($this->_boxes)));
 }
Esempio n. 5
0
 /**
  * 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->_dataFormat = $this->_reader->read(4);
 }
Esempio n. 6
0
 /**
  * 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);
   
   $offsetSize = (($tmp = $this->_reader->readUInt32BE()) >> 28) & 0xf;
   $lengthSize = ($tmp >> 24) & 0xf;
   $baseOffsetSize = ($tmp >> 20) & 0xf;
   $itemCount = $this->_reader->readUInt16BE();
   for ($i = 0; $i < $itemCount; $i++) {
     $item = array();
     $item["itemId"] = $this->_reader->readUInt16BE();
     $item["dataReferenceIndex"] = $this->_reader->readUInt16BE();
     $item["baseOffset"] =
       ($baseOffsetSize == 4 ? $this->_reader->readUInt32BE() :
        ($baseOffsetSize == 8 ? $this->_reader->readInt64BE() : 0));
     $item["extents"] = array();
     for ($j = 0; $j < $extentCount; $j++) {
       $extent = array();
       $extent["offset"] =
         ($offsetSize == 4 ? $this->_reader->readUInt32BE() :
          ($offsetSize == 8 ? $this->_reader->readInt64BE() : 0));
       $extent["length"] =
         ($lengthSize == 4 ? $this->_reader->readUInt32BE() :
          ($lengthSize == 8 ? $this->_reader->readInt64BE() : 0));
       $item["extents"][] = $extent;
     }
     $this->_items[] = $item;
   }
 }
Esempio n. 7
0
 /**
  * Returns the box raw data.
  *
  * @return string
  */
 public function __toString($data = "")
 {
   return parent::__toString
     (Transform::toUInt32BE($this->_version << 24 | $this->_flags) . $data);
 }
Esempio n. 8
0
 public function __construct($reader = null, &$options = array())
 {
   parent::__construct(is_string($reader) ? null : $reader, $options);
   $this->setContainer(true);
   
   if (is_string($reader)) {
     $this->setType($reader);
     $this->addBox(new ISO14496_Box_DATA());
   } else
     $this->constructBoxes();
 }
Esempio n. 9
0
 /**
  * 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->_majorBrand   = $this->_reader->readString8(4);
   $this->_minorVersion = $this->_reader->readUInt32BE();
   while ($this->_reader->getOffset() < $this->getSize())
     if (($brand = $this->_reader->readString8(4)) != "")
       $this->_compatibleBrands[] = $brand;
 }
Esempio n. 10
0
 /**
  * Returns the box raw data.
  *
  * @return string
  */
 public function __toString($data = "")
 {
   return parent::__toString(str_repeat("\0", $this->getSize() - 8));
 }
Esempio n. 11
0
 /**
  * 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);
 }