當前位置: 首頁>>代碼示例>>PHP>>正文


PHP getid3_lib::trimNullByte方法代碼示例

本文整理匯總了PHP中getid3_lib::trimNullByte方法的典型用法代碼示例。如果您正苦於以下問題:PHP getid3_lib::trimNullByte方法的具體用法?PHP getid3_lib::trimNullByte怎麽用?PHP getid3_lib::trimNullByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在getid3_lib的用法示例。


在下文中一共展示了getid3_lib::trimNullByte方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: parseEBML

 private function parseEBML(&$info)
 {
     // http://www.matroska.org/technical/specs/index.html#EBMLBasics
     $this->current_offset = $info['avdataoffset'];
     while ($this->getEBMLelement($top_element, $info['avdataend'])) {
         switch ($top_element['id']) {
             case EBML_ID_EBML:
                 $info['matroska']['header']['offset'] = $top_element['offset'];
                 $info['matroska']['header']['length'] = $top_element['length'];
                 while ($this->getEBMLelement($element_data, $top_element['end'], true)) {
                     switch ($element_data['id']) {
                         case EBML_ID_EBMLVERSION:
                         case EBML_ID_EBMLREADVERSION:
                         case EBML_ID_EBMLMAXIDLENGTH:
                         case EBML_ID_EBMLMAXSIZELENGTH:
                         case EBML_ID_DOCTYPEVERSION:
                         case EBML_ID_DOCTYPEREADVERSION:
                             $element_data['data'] = getid3_lib::BigEndian2Int($element_data['data']);
                             break;
                         case EBML_ID_DOCTYPE:
                             $element_data['data'] = getid3_lib::trimNullByte($element_data['data']);
                             $info['matroska']['doctype'] = $element_data['data'];
                             $info['fileformat'] = $element_data['data'];
                             break;
                         default:
                             $this->unhandledElement('header', __LINE__, $element_data);
                             break;
                     }
                     unset($element_data['offset'], $element_data['end']);
                     $info['matroska']['header']['elements'][] = $element_data;
                 }
                 break;
             case EBML_ID_SEGMENT:
                 $info['matroska']['segment'][0]['offset'] = $top_element['offset'];
                 $info['matroska']['segment'][0]['length'] = $top_element['length'];
                 while ($this->getEBMLelement($element_data, $top_element['end'])) {
                     if ($element_data['id'] != EBML_ID_CLUSTER || !self::$hide_clusters) {
                         // collect clusters only if required
                         $info['matroska']['segments'][] = $element_data;
                     }
                     switch ($element_data['id']) {
                         case EBML_ID_SEEKHEAD:
                             // Contains the position of other level 1 elements.
                             while ($this->getEBMLelement($seek_entry, $element_data['end'])) {
                                 switch ($seek_entry['id']) {
                                     case EBML_ID_SEEK:
                                         // Contains a single seek entry to an EBML element
                                         while ($this->getEBMLelement($sub_seek_entry, $seek_entry['end'], true)) {
                                             switch ($sub_seek_entry['id']) {
                                                 case EBML_ID_SEEKID:
                                                     $seek_entry['target_id'] = self::EBML2Int($sub_seek_entry['data']);
                                                     $seek_entry['target_name'] = self::EBMLidName($seek_entry['target_id']);
                                                     break;
                                                 case EBML_ID_SEEKPOSITION:
                                                     $seek_entry['target_offset'] = $element_data['offset'] + getid3_lib::BigEndian2Int($sub_seek_entry['data']);
                                                     break;
                                                 default:
                                                     $this->unhandledElement('seekhead.seek', __LINE__, $sub_seek_entry);
                                             }
                                             break;
                                         }
                                         if ($seek_entry['target_id'] != EBML_ID_CLUSTER || !self::$hide_clusters) {
                                             // collect clusters only if required
                                             $info['matroska']['seek'][] = $seek_entry;
                                         }
                                         break;
                                     default:
                                         $this->unhandledElement('seekhead', __LINE__, $seek_entry);
                                         break;
                                 }
                             }
                             break;
                         case EBML_ID_TRACKS:
                             // A top-level block of information with many tracks described.
                             $info['matroska']['tracks'] = $element_data;
                             while ($this->getEBMLelement($track_entry, $element_data['end'])) {
                                 switch ($track_entry['id']) {
                                     case EBML_ID_TRACKENTRY:
                                         //subelements: Describes a track with all elements.
                                         while ($this->getEBMLelement($subelement, $track_entry['end'], array(EBML_ID_VIDEO, EBML_ID_AUDIO, EBML_ID_CONTENTENCODINGS, EBML_ID_CODECPRIVATE))) {
                                             switch ($subelement['id']) {
                                                 case EBML_ID_TRACKNUMBER:
                                                 case EBML_ID_TRACKUID:
                                                 case EBML_ID_TRACKTYPE:
                                                 case EBML_ID_MINCACHE:
                                                 case EBML_ID_MAXCACHE:
                                                 case EBML_ID_MAXBLOCKADDITIONID:
                                                 case EBML_ID_DEFAULTDURATION:
                                                     // nanoseconds per frame
                                                     $track_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);
                                                     break;
                                                 case EBML_ID_TRACKTIMECODESCALE:
                                                     $track_entry[$subelement['id_name']] = getid3_lib::BigEndian2Float($subelement['data']);
                                                     break;
                                                 case EBML_ID_CODECID:
                                                 case EBML_ID_LANGUAGE:
                                                 case EBML_ID_NAME:
                                                 case EBML_ID_CODECNAME:
                                                     $track_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);
                                                     break;
//.........這裏部分代碼省略.........
開發者ID:xablen,項目名稱:Semaine14_SPIP_test,代碼行數:101,代碼來源:module.audio-video.matroska.php


注:本文中的getid3_lib::trimNullByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。