501 $this->current_offset =
$info[
'avdataoffset'];
504 switch ($top_element[
'id']) {
507 $info[
'matroska'][
'header'][
'offset'] = $top_element[
'offset'];
508 $info[
'matroska'][
'header'][
'length'] = $top_element[
'length'];
510 while ($this->
getEBMLelement($element_data, $top_element[
'end'],
true)) {
511 switch ($element_data[
'id']) {
524 $info[
'matroska'][
'doctype'] = $element_data[
'data'];
525 $info[
'fileformat'] = $element_data[
'data'];
533 unset($element_data[
'offset'], $element_data[
'end']);
534 $info[
'matroska'][
'header'][
'elements'][] = $element_data;
539 $info[
'matroska'][
'segment'][0][
'offset'] = $top_element[
'offset'];
540 $info[
'matroska'][
'segment'][0][
'length'] = $top_element[
'length'];
542 while ($this->
getEBMLelement($element_data, $top_element[
'end'])) {
544 $info[
'matroska'][
'segments'][] = $element_data;
546 switch ($element_data[
'id']) {
550 while ($this->
getEBMLelement($seek_entry, $element_data[
'end'])) {
551 switch ($seek_entry[
'id']) {
554 while ($this->
getEBMLelement($sub_seek_entry, $seek_entry[
'end'],
true)) {
556 switch ($sub_seek_entry[
'id']) {
559 $seek_entry[
'target_id'] = self::EBML2Int($sub_seek_entry[
'data']);
560 $seek_entry[
'target_name'] = self::EBMLidName($seek_entry[
'target_id']);
571 if (!isset($seek_entry[
'target_id'])) {
572 $this->
warning(
'seek_entry[target_id] unexpectedly not set at '.$seek_entry[
'offset']);
575 if (($seek_entry[
'target_id'] !=
EBML_ID_CLUSTER) || !self::$hide_clusters) {
576 $info[
'matroska'][
'seek'][] = $seek_entry;
588 $info[
'matroska'][
'tracks'] = $element_data;
590 while ($this->
getEBMLelement($track_entry, $element_data[
'end'])) {
591 switch ($track_entry[
'id']) {
596 switch ($subelement[
'id']) {
620 $track_entry[$subelement[
'id_name']] = $this->
readEBMLelementData($subelement[
'length'],
true);
633 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
634 switch ($sub_subelement[
'id']) {
672 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
673 switch ($sub_subelement[
'id']) {
698 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'])) {
699 switch ($sub_subelement[
'id']) {
704 switch ($sub_sub_subelement[
'id']) {
709 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']] =
getid3_lib::BigEndian2Int($sub_sub_subelement[
'data']);
714 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
715 switch ($sub_sub_sub_subelement[
'id']) {
718 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] =
getid3_lib::BigEndian2Int($sub_sub_sub_subelement[
'data']);
722 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] = $sub_sub_sub_subelement[
'data'];
726 $this->
unhandledElement(
'track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);
734 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
735 switch ($sub_sub_sub_subelement[
'id']) {
740 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] =
getid3_lib::BigEndian2Int($sub_sub_sub_subelement[
'data']);
746 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] = $sub_sub_sub_subelement[
'data'];
750 $this->
unhandledElement(
'track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);
757 $this->
unhandledElement(
'track.contentencodings.contentencoding', __LINE__, $sub_sub_subelement);
764 $this->
unhandledElement(
'track.contentencodings', __LINE__, $sub_subelement);
776 $info[
'matroska'][
'tracks'][
'tracks'][] = $track_entry;
787 $info_entry = array();
789 while ($this->
getEBMLelement($subelement, $element_data[
'end'],
true)) {
790 switch ($subelement[
'id']) {
802 $info_entry[$subelement[
'id_name'].
'_unix'] = self::EBMLdate2unix($info_entry[$subelement[
'id_name']]);
822 $info[
'matroska'][
'comments'][strtolower($subelement[
'id_name'])][] = $info_entry[$subelement[
'id_name']];
826 $chaptertranslate_entry = array();
828 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
829 switch ($sub_subelement[
'id']) {
844 $this->
unhandledElement(
'info.chaptertranslate', __LINE__, $sub_subelement);
848 $info_entry[$subelement[
'id_name']] = $chaptertranslate_entry;
856 $info[
'matroska'][
'info'][] = $info_entry;
860 if (self::$hide_clusters) {
861 $this->current_offset = $element_data[
'end'];
864 $cues_entry = array();
866 while ($this->
getEBMLelement($subelement, $element_data[
'end'])) {
867 switch ($subelement[
'id']) {
870 $cuepoint_entry = array();
873 switch ($sub_subelement[
'id']) {
876 $cuetrackpositions_entry = array();
878 while ($this->
getEBMLelement($sub_sub_subelement, $sub_subelement[
'end'],
true)) {
879 switch ($sub_sub_subelement[
'id']) {
889 $this->
unhandledElement(
'cues.cuepoint.cuetrackpositions', __LINE__, $sub_sub_subelement);
893 $cuepoint_entry[$sub_subelement[
'id_name']][] = $cuetrackpositions_entry;
905 $cues_entry[] = $cuepoint_entry;
913 $info[
'matroska'][
'cues'] = $cues_entry;
917 $tags_entry = array();
919 while ($this->
getEBMLelement($subelement, $element_data[
'end'],
false)) {
920 switch ($subelement[
'id']) {
923 $tag_entry = array();
925 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
false)) {
926 switch ($sub_subelement[
'id']) {
929 $targets_entry = array();
931 while ($this->
getEBMLelement($sub_sub_subelement, $sub_subelement[
'end'],
true)) {
932 switch ($sub_sub_subelement[
'id']) {
936 $targets_entry[strtolower($sub_sub_subelement[
'id_name']).
'_long'] = self::TargetTypeValue($targets_entry[$sub_sub_subelement[
'id_name']]);
940 $targets_entry[$sub_sub_subelement[
'id_name']] = $sub_sub_subelement[
'data'];
955 $tag_entry[$sub_subelement[
'id_name']] = $targets_entry;
959 $tag_entry[$sub_subelement[
'id_name']][] = $this->
HandleEMBLSimpleTag($sub_subelement[
'end']);
967 $tags_entry[] = $tag_entry;
975 $info[
'matroska'][
'tags'] = $tags_entry;
980 while ($this->
getEBMLelement($subelement, $element_data[
'end'])) {
981 switch ($subelement[
'id']) {
984 $attachedfile_entry = array();
987 switch ($sub_subelement[
'id']) {
992 $attachedfile_entry[$sub_subelement[
'id_name']] = $sub_subelement[
'data'];
997 $attachedfile_entry[
'data_length'] = $sub_subelement[
'length'];
999 $attachedfile_entry[$sub_subelement[
'id_name']] = $this->
saveAttachment(
1000 $attachedfile_entry[
'FileName'],
1001 $attachedfile_entry[
'data_offset'],
1002 $attachedfile_entry[
'data_length']);
1004 $this->current_offset = $sub_subelement[
'end'];
1012 $this->
unhandledElement(
'attachments.attachedfile', __LINE__, $sub_subelement);
1016 $info[
'matroska'][
'attachments'][] = $attachedfile_entry;
1028 while ($this->
getEBMLelement($subelement, $element_data[
'end'])) {
1029 switch ($subelement[
'id']) {
1032 $editionentry_entry = array();
1035 switch ($sub_subelement[
'id']) {
1048 $chapteratom_entry = array();
1051 switch ($sub_sub_subelement[
'id']) {
1055 $chapteratom_entry[$sub_sub_subelement[
'id_name']] = $sub_sub_subelement[
'data'];
1070 $chaptertrack_entry = array();
1072 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
1073 switch ($sub_sub_sub_subelement[
'id']) {
1080 $this->
unhandledElement(
'chapters.editionentry.chapteratom.chaptertrack', __LINE__, $sub_sub_sub_subelement);
1084 $chapteratom_entry[$sub_sub_subelement[
'id_name']][] = $chaptertrack_entry;
1088 $chapterdisplay_entry = array();
1090 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
1091 switch ($sub_sub_sub_subelement[
'id']) {
1096 $chapterdisplay_entry[$sub_sub_sub_subelement[
'id_name']] = $sub_sub_sub_subelement[
'data'];
1100 $this->
unhandledElement(
'chapters.editionentry.chapteratom.chapterdisplay', __LINE__, $sub_sub_sub_subelement);
1104 $chapteratom_entry[$sub_sub_subelement[
'id_name']][] = $chapterdisplay_entry;
1108 $this->
unhandledElement(
'chapters.editionentry.chapteratom', __LINE__, $sub_sub_subelement);
1112 $editionentry_entry[$sub_subelement[
'id_name']][] = $chapteratom_entry;
1116 $this->
unhandledElement(
'chapters.editionentry', __LINE__, $sub_subelement);
1120 $info[
'matroska'][
'chapters'][] = $editionentry_entry;
1131 $cluster_entry = array();
1134 switch ($subelement[
'id']) {
1143 $cluster_silent_tracks = array();
1145 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
1146 switch ($sub_subelement[
'id']) {
1153 $this->
unhandledElement(
'cluster.silenttracks', __LINE__, $sub_subelement);
1157 $cluster_entry[$subelement[
'id_name']][] = $cluster_silent_tracks;
1161 $cluster_block_group = array(
'offset' => $this->current_offset);
1164 switch ($sub_subelement[
'id']) {
1188 $cluster_entry[$subelement[
'id_name']][] = $cluster_block_group;
1199 $this->current_offset = $subelement[
'end'];
1201 if (!self::$hide_clusters) {
1202 $info[
'matroska'][
'cluster'][] = $cluster_entry;
1206 if (!self::$parse_whole_file) {
1207 if (isset(
$info[
'matroska'][
'info']) && is_array(
$info[
'matroska'][
'info'])) {
1208 if (isset(
$info[
'matroska'][
'tracks'][
'tracks']) && is_array(
$info[
'matroska'][
'tracks'][
'tracks'])) {
1209 if (count(
$info[
'matroska'][
'track_data_offsets']) == count(
$info[
'matroska'][
'tracks'][
'tracks'])) {
const EBML_ID_CONTENTSIGALGO
const EBML_ID_CUECLUSTERPOSITION
const EBML_ID_CLUSTERCODECSTATE
const EBML_ID_TRACKNUMBER
const EBML_ID_CLUSTERPREVSIZE
const EBML_ID_CONTENTSIGNATURE
const EBML_ID_DISPLAYUNIT
const EBML_ID_TARGETTYPEVALUE
const EBML_ID_CHAPTERDISPLAY
const EBML_ID_SAMPLINGFREQUENCY
const EBML_ID_CONTENTENCODING
const EBML_ID_ASPECTRATIOTYPE
const EBML_ID_CHAPTERTRANSLATEID
const EBML_ID_CHAPTERFLAGENABLED
const EBML_ID_COLOURSPACE
const EBML_ID_CONTENTENCODINGSCOPE
const EBML_ID_CLUSTERSILENTTRACKS
const EBML_ID_ATTACHEDFILE
const EBML_ID_CONTENTENCKEYID
const EBML_ID_EDITIONENTRY
const EBML_ID_CODECPRIVATE
const EBML_ID_CLUSTERSIMPLEBLOCK
const EBML_ID_CONTENTENCODINGORDER
const EBML_ID_SEEKPOSITION
const EBML_ID_CONTENTCOMPALGO
const EBML_ID_CHAPLANGUAGE
HandleEMBLClusterBlock($element, $block_type, &$info)
const EBML_ID_CONTENTENCODINGTYPE
const EBML_ID_PIXELHEIGHT
const EBML_ID_FLAGENABLED
saveAttachment($name, $offset, $length, $image_mime=null)
const EBML_ID_CONTENTSIGHASHALGO
const EBML_ID_PIXELCROPRIGHT
const EBML_ID_CLUSTERBLOCK
const EBML_ID_NEXTFILENAME
const EBML_ID_TAGEDITIONUID
const EBML_ID_CHAPTERTRACKNUMBER
const EBML_ID_EDITIONFLAGHIDDEN
const EBML_ID_CUETRACKPOSITIONS
const EBML_ID_DEFAULTDURATION
const EBML_ID_CHAPTERSEGMENTUID
getEBMLelement(&$element, $parent_end, $get_data=false)
const EBML_ID_CHAPTERFLAGHIDDEN
const EBML_ID_CHAPTERTIMESTART
const EBML_ID_DISPLAYWIDTH
const EBML_ID_TAGCHAPTERUID
const EBML_ID_CHAPCOUNTRY
static BigEndian2Float($byteword)
const EBML_ID_CHAPTERTIMEEND
const EBML_ID_EDITIONFLAGDEFAULT
const EBML_ID_CHANNELPOSITIONS
const EBML_ID_EBMLVERSION
const EBML_ID_OUTPUTSAMPLINGFREQUENCY
const EBML_ID_EDITIONFLAGORDERED
const EBML_ID_CONTENTENCODINGS
const EBML_ID_CLUSTERSILENTTRACKNUMBER
const EBML_ID_ATTACHMENTS
static trimNullByte($string)
const EBML_ID_CLUSTERREFERENCEPRIORITY
const EBML_ID_CONTENTCOMPSETTINGS
const EBML_ID_CLUSTERBLOCKGROUP
const EBML_ID_PIXELCROPTOP
const EBML_ID_SEGMENTFILENAME
const EBML_ID_TAGTRACKUID
readEBMLelementData($length, $check_buffer=false)
const EBML_ID_CHAPTERTRANSLATE
HandleEMBLSimpleTag($parent_end)
const EBML_ID_TRACKTIMECODESCALE
const EBML_ID_CONTENTCOMPRESSION
const EBML_ID_CHAPTERSEGMENTEDITIONUID
const EBML_ID_PIXELCROPBOTTOM
const EBML_ID_CLUSTERPOSITION
const EBML_ID_EBMLMAXIDLENGTH
const EBML_ID_CHAPTERTRANSLATECODEC
const EBML_ID_CHAPTERTRANSLATEEDITIONUID
const EBML_ID_CONTENTSIGKEYID
const EBML_ID_CODECDECODEALL
const EBML_ID_EBMLMAXSIZELENGTH
const EBML_ID_FLAGINTERLACED
const EBML_ID_DISPLAYHEIGHT
const EBML_ID_CHAPTERATOM
const EBML_ID_FILEDESCRIPTION
const EBML_ID_TAGATTACHMENTUID
const EBML_ID_FLAGDEFAULT
const EBML_ID_CUEBLOCKNUMBER
const EBML_ID_EBMLREADVERSION
unhandledElement($type, $line, $element)
const EBML_ID_CLUSTERREFERENCEBLOCK
const EBML_ID_DOCTYPEVERSION
const EBML_ID_PREVFILENAME
const EBML_ID_TIMECODESCALE
const EBML_ID_SEGMENTFAMILY
const EBML_ID_DOCTYPEREADVERSION
const EBML_ID_CUECODECSTATE
const EBML_ID_CHAPTERTRACK
const EBML_ID_PIXELCROPLEFT
const EBML_ID_CONTENTENCRYPTION
const EBML_ID_FILEMIMETYPE
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)
const EBML_ID_CONTENTENCALGO
const EBML_ID_MAXBLOCKADDITIONID
const EBML_ID_CLUSTERBLOCKDURATION
const EBML_ID_CHAPTERS
getID3() by James Heinrich info@getid3.org //
const EBML_ID_CLUSTERTIMECODE
const EBML_ID_OLDSTEREOMODE