wppaste
WordPress

getid3_quicktime

Source
wp-includes/ID3/module.audio-video.quicktime.php:24

Compatibility

WordPress
core
  • 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).

Properties · 3

$ReturnAtomDataboolpublic
audio-video.quicktime return all parsed data from all atoms if true, otherwise just returned parsed metadata
$ParseAllPossibleAtomsboolpublic
audio-video.quicktime return all parsed data from all atoms if true, otherwise just returned parsed metadata
$metaDATAkeyintprivate
real ugly, but so is the QuickTime structure that stores keys and values in different multi-nested locations that are hard to relate to each other https://github.com/JamesHeinrich/getID3/issues/214

Methods · 24

Source code

class getid3_quicktime extends getid3_handler{ 	/** audio-video.quicktime	 * return all parsed data from all atoms if true, otherwise just returned parsed metadata	 *	 * @var bool	 */	public $ReturnAtomData        = false; 	/** audio-video.quicktime	 * return all parsed data from all atoms if true, otherwise just returned parsed metadata	 *	 * @var bool	 */	public $ParseAllPossibleAtoms = false; 	/**	 * real ugly, but so is the QuickTime structure that stores keys and values in different multi-nested locations that are hard to relate to each other	 * https://github.com/JamesHeinrich/getID3/issues/214	 *	 * @var int	 */	private $metaDATAkey = 1; 	/**	 * @return bool	 */	public function Analyze() {		$info = &$this->getid3->info; 		$this->metaDATAkey = 1;		$info['fileformat'] = 'quicktime';		$info['quicktime']['hinting']    = false;		$info['quicktime']['controller'] = 'standard'; // may be overridden if 'ctyp' atom is present 		$this->fseek($info['avdataoffset']); 		$offset      = 0;		$atomcounter = 0;		$atom_data_read_buffer_size = $info['php_memory_limit'] ? round($info['php_memory_limit'] / 4) : $this->getid3->option_fread_buffer_size * 1024; // set read buffer to 25% of PHP memory limit (if one is specified), otherwise use option_fread_buffer_size [default: 32MB]		while ($offset < $info['avdataend']) {			if (!getid3_lib::intValueSupported($offset)) {				$this->error('Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions');				break;			}			$this->fseek($offset);			$AtomHeader = $this->fread(8); 			// https://github.com/JamesHeinrich/getID3/issues/382			// Atom sizes are stored as 32-bit number in most cases, but sometimes (notably for "mdat")			// a 64-bit value is required, in which case the normal 32-bit size field is set to 0x00000001			// and the 64-bit "real" size value is the next 8 bytes.			$atom_size_extended_bytes = 0;			$atomsize = getid3_lib::BigEndian2Int(substr($AtomHeader, 0, 4));			$atomname = substr($AtomHeader, 4, 4);			if ($atomsize == 1) {				$atom_size_extended_bytes = 8;				$atomsize = getid3_lib::BigEndian2Int($this->fread($atom_size_extended_bytes));			} 			if (($offset + $atomsize) > $info['avdataend']) {				$info['quicktime'][$atomname]['name']   = $atomname;				$info['quicktime'][$atomname]['size']   = $atomsize;				$info['quicktime'][$atomname]['offset'] = $offset;				$this->error('Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)');				return false;			}			if ($atomsize == 0) {				// Furthermore, for historical reasons the list of atoms is optionally				// terminated by a 32-bit integer set to 0. If you are writing a program				// to read user data atoms, you should allow for the terminating 0.				$info['quicktime'][$atomname]['name']   = $atomname;				$info['quicktime'][$atomname]['size']   = $atomsize;				$info['quicktime'][$atomname]['offset'] = $offset;				break;			}			$atomHierarchy = array();			$parsedAtomData = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize - $atom_size_extended_bytes, $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);			$parsedAtomData['name']   = $atomname;

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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.