Exemplo n.º 1
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     if ($this->version == 0) {
         $this->creationTime = pReadInt32($this->mp4->readP);
         $this->modificationTime = pReadInt32($this->mp4->readP);
         $this->trackId = pReadInt32($this->mp4->readP);
         $this->reserved1 = pReadInt32($this->mp4->readP);
         $this->duration = pReadInt32($this->mp4->readP);
     } else {
         $this->creationTime = pReadInt64($this->mp4->readP);
         $this->modificationTime = pReadInt64($this->mp4->readP);
         $this->trackId = pReadInt32($this->mp4->readP);
         $this->reserved1 = pReadInt32($this->mp4->readP);
         $this->duration = pReadInt64($this->mp4->readP);
     }
     $this->reserved2 = pReadInt32($this->mp4->readP);
     $this->reserved3 = pReadInt32($this->mp4->readP);
     $this->layer = pReadInt16($this->mp4->readP);
     $this->predefined = pReadInt16($this->mp4->readP);
     $this->volume = pReadSI16($this->mp4->readP);
     $this->reserved4 = pReadInt16($this->mp4->readP);
     for ($i = 0; $i < 9; $i++) {
         $this->matrix[] = pReadInt32($this->mp4->readP);
     }
     $this->width = pReadSI32($this->mp4->readP);
     $this->height = pReadSI32($this->mp4->readP);
 }
Exemplo n.º 2
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     if ($this->version == 0) {
         $this->creationTime = pReadInt32($this->mp4->readP);
         $this->modificationTime = pReadInt32($this->mp4->readP);
         $this->timeScale = pReadInt32($this->mp4->readP);
         $this->duration = pReadInt32($this->mp4->readP);
     } else {
         $this->creationTime = pReadInt64($this->mp4->readP);
         $this->modificationTime = pReadInt64($this->mp4->readP);
         $this->timeScale = pReadInt32($this->mp4->readP);
         $this->duration = pReadInt64($this->mp4->readP);
     }
     $this->rate = pReadSI32($this->mp4->readP);
     $this->volume = pReadSI16($this->mp4->readP);
     $this->reserved1 = pReadInt16($this->mp4->readP);
     $this->reserved2 = pReadInt32($this->mp4->readP);
     $this->reserved3 = pReadInt32($this->mp4->readP);
     for ($i = 0; $i < 9; $i++) {
         $this->matrix[] = pReadInt32($this->mp4->readP);
     }
     for ($i = 0; $i < 6; $i++) {
         $this->predefined[] = pReadInt32($this->mp4->readP);
     }
     $this->nextTrackId = pReadInt32($this->mp4->readP);
 }
Exemplo n.º 3
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     $this->count = pReadInt32($this->mp4->readP);
     for ($i = 0; $i < $this->count; $i++) {
         $this->entries[] = new Mp4Box_stts_entry(pReadInt32($this->mp4->readP), pReadInt32($this->mp4->readP));
     }
 }
Exemplo n.º 4
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     $this->count = pReadInt32($this->mp4->readP);
     for ($i = 0; $i < $this->count; $i++) {
         $this->sampleNumbers[] = pReadInt32($this->mp4->readP);
     }
 }
Exemplo n.º 5
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     $this->count = pReadInt32($this->mp4->readP);
     for ($i = 0; $i < $this->count; $i++) {
         $entry = new Mp4Box_stsd_entry(pReadInt32($this->mp4->readP) - 8, pReadInt32($this->mp4->readP));
         $entry->buf = fread($this->mp4->readP, $entry->len);
         $this->entries[] = $entry;
     }
 }
Exemplo n.º 6
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     $this->count = pReadInt32($this->mp4->readP);
     for ($i = 0; $i < $this->count; $i++) {
         if ($this->boxInfo->type == "co64") {
             $this->entries[] = pReadInt64($this->mp4->readP);
         } else {
             $this->entries[] = pReadInt32($this->mp4->readP);
         }
     }
 }
Exemplo n.º 7
0
 protected function readContent()
 {
     $this->version = pReadInt8($this->mp4->readP);
     $this->flags = pReadInt24($this->mp4->readP);
     if ($this->version == 0) {
         $this->creationTime = pReadInt32($this->mp4->readP);
         $this->modificationTime = pReadInt32($this->mp4->readP);
         $this->timeScale = pReadInt32($this->mp4->readP);
         $this->duration = pReadInt32($this->mp4->readP);
     } else {
         $this->creationTime = pReadInt64($this->mp4->readP);
         $this->modificationTime = pReadInt64($this->mp4->readP);
         $this->timeScale = pReadInt32($this->mp4->readP);
         $this->duration = pReadInt64($this->mp4->readP);
     }
     $this->language = pReadInt16($this->mp4->readP);
     $this->predefined = pReadInt16($this->mp4->readP);
 }
Exemplo n.º 8
0
function pReadSI32(&$tmp_p)
{
    return pReadInt32($tmp_p) >> 16;
}
 public function read()
 {
     if ($this->boxInfo->type != "ROOT") {
         $this->boxInfo->position = ftell($this->mp4->readP);
         $this->boxInfo->size = pReadInt32($this->mp4->readP);
         $this->boxInfo->type = fread($this->mp4->readP, 4);
         if ($this->boxInfo->size == 1) {
             $this->boxInfo->headerLength = 16;
             $this->boxInfo->size = pReadInt64($this->mp4->readP);
         } else {
             $this->boxInfo->headerLength = 8;
         }
     }
     if ($this->isContainer()) {
         if (MP4_DEBUG) {
             $string_representation = $this->toString();
             if ($string_representation != "") {
                 echo str_repeat("&nbsp;", $this->boxInfo->depth * 4) . $string_representation . "<br>";
             }
         }
         $i = 0;
         while ($this->_keepReadingChildren() && $i++ < 10) {
             $pos = ftell($this->mp4->readP);
             fseek($this->mp4->readP, $pos + 4);
             $next_type = fread($this->mp4->readP, 4);
             fseek($this->mp4->readP, $pos);
             switch ($next_type) {
                 case "stco":
                 case "co64":
                     $child = new Mp4Box_stco($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "ctts":
                     $child = new Mp4Box_ctts($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "mdhd":
                     $child = new Mp4Box_mdhd($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "mvhd":
                     $child = new Mp4Box_mvhd($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "stsd":
                     $child = new Mp4Box_stsd($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "stss":
                     $child = new Mp4Box_stss($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "stsz":
                     $child = new Mp4Box_stsz($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "tkhd":
                     $child = new Mp4Box_tkhd($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "trak":
                     $child = new Mp4Box_trak($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "stsc":
                     $child = new Mp4Box_stsc($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "stts":
                     $child = new Mp4Box_stts($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 case "mdat":
                     $child = new Mp4Box_mdat($this->mp4, $this->boxInfo->depth + 1);
                     break;
                 default:
                     $child = new Mp4AbstractBox($this->mp4, $this->boxInfo->depth + 1);
                     break;
             }
             $child->parent = $this;
             $child->read();
             $this->children[] = $child;
         }
     } else {
         $this->readContent();
         fseek($this->mp4->readP, $this->boxInfo->position + $this->boxInfo->size);
         if (MP4_DEBUG) {
             $string_representation = $this->toString();
             if ($string_representation != "") {
                 echo str_repeat("&nbsp;", $this->boxInfo->depth * 4) . $string_representation . " (" . $this->boxInfo->size . ")<br>";
             }
         }
     }
 }