getid3_asf::Analyze(): bool
- Source
wp-includes/ID3/module.audio-video.asf.php:59
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.
Return value
bool
Performance profile
How much work a call to getid3_asf::Analyze() 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
- 133–171
- Plugin surface
- None
- Called by
- 0
Touches nothing outside its own arguments.
The body loops, so the work grows with how much data it finds.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 2892.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What one call costs · 1 distinct outcome
One number would be a lie: the work depends on which branch runs. These are every distinct cost getid3_asf::Analyze() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!$HeaderObjectsCounter && !isset($thisfile_asf_streambitratepropertiesobject) && !isset($thisfile_asf) && !isset($thisfile_asf_codeclistobject) && !isset($thisfile_audio) && !isset($info) | 133–171 | ->fseek(), ->fread(), ->BytestringToGUID(), ::getid3_lib(), ::getid3_lib(), ::getid3_lib(), ::getid3_lib(), ->ftell(), ->fread(), ->ftell() |
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 | 2892 | 133–171 | 200 | |
| 8.5 | 2892 | 133–171 | 200 | |
| 8.4 | 2892 | 133–171 | 200 | 430 fewer instructions than PHP 8.3 |
| 8.3 | 3322 | 148–186 | 200 | |
| 8.2 | 3322 | 148–186 | 200 | 19 more instructions than PHP 8.1 |
| 8.1 | 3303 | 148–186 | 200 | 12 fewer instructions than PHP 7.4 |
| 7.4 | 3315 | 148–190 | 200 |
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 · 21
- getid3_asf::fseek()
- getid3_asf::fread()
- getid3_asf::BytestringToGUID()
- getid3_asf::error()
- getid3_lib::LittleEndian2Int()
- getid3_asf::ftell()
- getid3_asf::FILETIMEtoUNIXtime()
- getid3_lib::SafeDiv()Perform a division, guarding against division by zero
- getid3_riff::parseWAVEFORMATex()
- getid3_lib::array_merge_noclobber()
- getid3_asf::warning()
- getid3_asf::HeaderExtensionObjectDataParse()
Show all 21
- getid3_asf::GUIDtoBytestring()
- getid3_asf::codecListObjectTypeLookup()
- getid3_asf::TrimConvert()Remove terminator 00 00 and convert UTF-16LE to Latin-1.
- getid3_asf::TrimTerm()Remove terminator 00 00.
- getid3_id3v2::__construct()
- getid3_asf::ASF_WMpicture()
- getid3_asf::GUIDname()
- getid3_riff::fourccLookup()
- getid3_asf::ASFIndexObjectIndexTypeLookup()
Source code
public function Analyze() { $info = &$this->getid3->info; // Shortcuts $thisfile_audio = &$info['audio']; $thisfile_video = &$info['video']; $info['asf'] = array(); $thisfile_asf = &$info['asf']; $thisfile_asf['comments'] = array(); $thisfile_asf_comments = &$thisfile_asf['comments']; $thisfile_asf['header_object'] = array(); $thisfile_asf_headerobject = &$thisfile_asf['header_object']; // ASF structure: // * Header Object [required] // * File Properties Object [required] (global file attributes) // * Stream Properties Object [required] (defines media stream & characteristics) // * Header Extension Object [required] (additional functionality) // * Content Description Object (bibliographic information) // * Script Command Object (commands for during playback) // * Marker Object (named jumped points within the file) // * Data Object [required] // * Data Packets // * Index Object // Header Object: (mandatory, one only) // Field Name Field Type Size (bits) // Object ID GUID 128 // GUID for header object - GETID3_ASF_Header_Object // Object Size QWORD 64 // size of header object, including 30 bytes of Header Object header // Number of Header Objects DWORD 32 // number of objects in header object // Reserved1 BYTE 8 // hardcoded: 0x01 // Reserved2 BYTE 8 // hardcoded: 0x02 $info['fileformat'] = 'asf'; $this->fseek($info['avdataoffset']); $HeaderObjectData = $this->fread(30); $thisfile_asf_headerobject['objectid'] = substr($HeaderObjectData, 0, 16); $thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']); if ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) { unset($info['fileformat'], $info['asf']); return $this->error('ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}'); } $thisfile_asf_headerobject['objectsize'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8)); $thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4)); $thisfile_asf_headerobject['reserved1'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1)); $thisfile_asf_headerobject['reserved2'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1)); $NextObjectOffset = $this->ftell(); $ASFHeaderData = $this->fread($thisfile_asf_headerobject['objectsize'] - 30); $offset = 0; $thisfile_asf_streambitratepropertiesobject = array(); $thisfile_asf_codeclistobject = array(); $StreamPropertiesObjectData = array(); for ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) { $NextObjectGUID = substr($ASFHeaderData, $offset, 16); $offset += 16; $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID); $NextObjectSize = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); $offset += 8; switch ($NextObjectGUID) { case GETID3_ASF_File_Properties_Object: // File Properties Object: (mandatory, one only) // Field Name Field Type Size (bits) // Object ID GUID 128 // GUID for file properties object - GETID3_ASF_File_Properties_Object // Object Size QWORD 64 // size of file properties object, including 104 bytes of File Properties Object header // File ID GUID 128 // unique ID - identical to File ID in Data Object // File Size QWORD 64 // entire file in bytes. Invalid if Broadcast Flag == 1 // Creation Date QWORD 64 // date & time of file creation. Maybe invalid if Broadcast Flag == 1 // Data Packets Count QWORD 64 // number of data packets in Data Object. Invalid if Broadcast Flag == 1 // Play Duration QWORD 64 // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1 // Send Duration QWORD 64 // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1 // Preroll QWORD 64 // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount // Flags DWORD 32 // // * Broadcast Flag bits 1 (0x01) // file is currently being written, some header values are invalid // * Seekable Flag bits 1 (0x02) // is file seekableChangelog
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.asf.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.