getid3_quicktime::QuicktimeParseAtom( string $atomname, int $atomsize, string $atom_data, int $baseoffset, array $atomHierarchy, bool $ParseAllPossibleAtoms ): array|false
- Source
wp-includes/ID3/module.audio-video.quicktime.php:276
Compatibility
- WordPress
- core
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$atomnamestring$atomsizeint$atom_datastring$baseoffsetint$atomHierarchyarray$ParseAllPossibleAtomsbool
Return value
array|false
Performance profile
How much work a call to getid3_quicktime::QuicktimeParseAtom() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Light
- Scaling
- Scales with input
- Instructions
- 46–91
- Plugin surface
- None
- Called by
- 2
Touches nothing outside its own arguments.
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 6149.
Nothing here hands control to plugin code.
2 places in core call this, so the cost is paid more often than your own code shows.
What one call costs · 7 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost getid3_quicktime::QuicktimeParseAtom() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 46–71 | end(), array_push(), ->QuicktimeParseContainerAtom(), array_pop() |
$atom_parent != "udta" && !$atomoffset && empty($atom_structure) | 48–50 | end(), array_push(), array_pop() |
$atom_parent != "udta" && !$atomoffset && !empty($atom_structure) | 58–60 | end(), array_push(), ->CopyToAppropriateCommentsSection(), array_pop() |
$atom_parent == "udta" && empty($atom_structure) | 72–78 | end(), array_push(), ::getid3_lib(), ::getid3_lib(), ->QuicktimeLanguageLookup(), array_pop() |
$atom_parent != "udta" && $atomoffset && empty($atom_structure) | 81 | end(), array_push(), ::getid3_lib(), ->warning(), array_pop() |
$atom_parent == "udta" && !empty($atom_structure) | 82–88 | end(), array_push(), ::getid3_lib(), ::getid3_lib(), ->QuicktimeLanguageLookup(), ->CopyToAppropriateCommentsSection(), array_pop() |
$atom_parent != "udta" && $atomoffset && !empty($atom_structure) | 91 | end(), array_push(), ::getid3_lib(), ->warning(), ->CopyToAppropriateCommentsSection(), array_pop() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 6151 | 46–91 | 504 | 2 more instructions than PHP 8.5 |
| 8.5 | 6149 | 46–91 | 504 | |
| 8.4 | 6149 | 46–91 | 504 | 1179 fewer instructions than PHP 8.3 |
| 8.3 | 7328 | 52–112 | 504 | |
| 8.2 | 7328 | 52–112 | 504 | 20 more instructions than PHP 8.1 |
| 8.1 | 7308 | 52–192 | 504 | 10 fewer instructions than PHP 7.4 |
| 7.4 | 7318 | 52–192 | 504 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 35
- getid3_lib::BigEndian2Int()
- getid3_quicktime::QuicktimeParseContainerAtom()
- getid3_quicktime::QuicktimeLanguageLookup()
- getid3_quicktime::warning()
- getid3_lib::PrintHexBytes()
- getid3_id3v1::LookupGenreName()
- getid3_quicktime::QuicktimeContentRatingLookup()
- getid3_quicktime::QuicktimeSTIKLookup()
- getid3_quicktime::QuicktimeStoreFrontCodeLookup()
- getid3_quicktime::CopyToAppropriateCommentsSection()
- getid3_quicktime::QuicktimeDCOMLookup()
- getid3_quicktime::NoNullString()
Show all 35
- getid3_lib::FixedPoint16_16()
- getid3_quicktime::MaybePascal2String()
- getid3_quicktime::QuicktimeVideoCodecLookup()
- getid3_quicktime::QuicktimeAudioCodecLookup()
- getid3_quicktime::QuicktimeColorNameLookup()
- getid3_quicktime::error()
- getid3_lib::DateMac2Unix()
- getid3_lib::FixedPoint8_8()
- getid3_lib::FixedPoint2_30()
- getid3_quicktime::quicktime_read_mp4_descr_length()
- getid3_quicktime::QuicktimeIODSaudioProfileName()
- getid3_quicktime::QuicktimeIODSvideoProfileName()
- getid3_lib::LittleEndian2Int()
- getID3::__construct()
- getid3_mp3::__construct()
- getid3_quicktime::fread()
- getid3_lib::IncludeDependency()
- getid3_id3v2::__construct()
- getid3_tag_nikon_nctg::__construct()
- getid3_lib::BigEndian2Float()ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic
- getid3_quicktime::ftell()
- getid3_quicktime::fseek()
- getid3_quicktime::LociString()
Used by · 2
Source code
public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) { // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm // https://code.google.com/p/mp4v2/wiki/iTunesMetadata $info = &$this->getid3->info; $atom_parent = end($atomHierarchy); // not array_pop($atomHierarchy); see https://www.getid3.org/phpBB3/viewtopic.php?t=1717 array_push($atomHierarchy, $atomname); $atom_structure = array(); $atom_structure['hierarchy'] = implode(' ', $atomHierarchy); $atom_structure['name'] = $atomname; $atom_structure['size'] = $atomsize; $atom_structure['offset'] = $baseoffset; if (substr($atomname, 0, 3) == "\x00\x00\x00") { // https://github.com/JamesHeinrich/getID3/issues/139 $atomname = getid3_lib::BigEndian2Int($atomname); $atom_structure['name'] = $atomname; $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms); } else { switch ($atomname) { case 'moov': // MOVie container atom case 'moof': // MOvie Fragment box case 'trak': // TRAcK container atom case 'traf': // TRAck Fragment box case 'clip': // CLIPping container atom case 'matt': // track MATTe container atom case 'edts': // EDiTS container atom case 'tref': // Track REFerence container atom case 'mdia': // MeDIA container atom case 'minf': // Media INFormation container atom case 'dinf': // Data INFormation container atom case 'nmhd': // Null Media HeaDer container atom case 'udta': // User DaTA container atom case 'cmov': // Compressed MOVie container atom case 'rmra': // Reference Movie Record Atom case 'rmda': // Reference Movie Descriptor Atom case 'gmhd': // Generic Media info HeaDer atom (seen on QTVR) $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms); break; case 'ilst': // Item LiST container atom if ($atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms)) { // some "ilst" atoms contain data atoms that have a numeric name, and the data is far more accessible if the returned array is compacted $allnumericnames = true; foreach ($atom_structure['subatoms'] as $subatomarray) { if (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) != 1)) { $allnumericnames = false; break; } } if ($allnumericnames) { $newData = array(); foreach ($atom_structure['subatoms'] as $subatomarray) { foreach ($subatomarray['subatoms'] as $newData_subatomarray) { unset($newData_subatomarray['hierarchy'], $newData_subatomarray['name']); $newData[$subatomarray['name']] = $newData_subatomarray; break; } } $atom_structure['data'] = $newData; unset($atom_structure['subatoms']); } } break; case 'stbl': // Sample TaBLe container atom $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms); $isVideo = false; $framerate = 0; $framecount = 0; foreach ($atom_structure['subatoms'] as $key => $value_array) { if (isset($value_array['sample_description_table'])) { foreach ($value_array['sample_description_table'] as $key2 => $value_array2) { if (isset($value_array2['data_format'])) { switch ($value_array2['data_format']) { case 'avc1': case 'mp4v': // video data $isVideo = true; break;Changelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/ID3/module.audio-video.quicktime.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.