コード例 #1
0
 public function __construct($totalSize, $boxType, $data, XenGallery_VideoInfo_Preparer $preparer, $parent)
 {
     parent::__construct($totalSize, $boxType, false, $preparer, $parent);
     if (is_string($data)) {
         while ($data != '') {
             try {
                 $box = $this->preparer->fromString($data, $this);
                 if (!$box instanceof XenGallery_VideoInfo_Box_Abstract) {
                     break;
                 }
             } catch (Exception $e) {
                 break;
             }
         }
     } else {
         do {
             try {
                 $box = $this->preparer->fromStream($data, $this);
                 if (!$box instanceof XenGallery_VideoInfo_Box_Abstract) {
                     break;
                 }
             } catch (Exception $e) {
                 break;
             }
         } while ($box !== false);
     }
 }
コード例 #2
0
ファイル: Stsd.php プロジェクト: VoDongMy/xenforo-laravel5.1
 public function __construct($totalSize, $boxType, $data, XenGallery_VideoInfo_Preparer $preparer, $parent)
 {
     parent::__construct($totalSize, $boxType, '', $preparer, $parent);
     $data = $this->getDataFromFileOrString($data, $totalSize);
     $ar = unpack('Cversion/C3flags/Ncount', $data);
     $desc = substr($data, 8);
     for ($i = 0; $i < $ar['count']; $i++) {
         $details = unpack('Nlen', $desc);
         $type = substr($desc, 4, 4);
         $info = substr($desc, 8, $details['len'] - 8);
         $desc = substr($desc, $details['len']);
         $this->values[$type] = $info;
     }
 }