getid3_quicktime::QuicktimeVideoCodecLookup

Advertisement

Syntax Syntax

getid3_quicktime::QuicktimeVideoCodecLookup( string $codecid )

Parameters Parameters

$codecid

(Required)

Return Return

(string)

Source Source

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

				// 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.
				if (strlen($atom_data) > 12) {
					$subatomoffset += 4;
					continue;
				}
				return $atom_structure;
			}
			if (strlen($subatomdata) < ($subatomsize - 8)) {
			    // we don't have enough data to decode the subatom.
			    // this may be because we are refusing to parse large subatoms, or it may be because this atom had its size set too large
			    // so we passed in the start of a following atom incorrectly?
			    return $atom_structure;
			}
			$atom_structure[$subatomcounter++] = $this->QuicktimeParseAtom($subatomname, $subatomsize, $subatomdata, $baseoffset + $subatomoffset, $atomHierarchy, $ParseAllPossibleAtoms);
			$subatomoffset += $subatomsize;
		}
		return $atom_structure;
	}

	/**
	 * @param string $data
	 * @param int    $offset
	 *
	 * @return int
	 */
	public function quicktime_read_mp4_descr_length($data, &$offset) {
		// http://libquicktime.sourcearchive.com/documentation/2:1.0.2plus-pdebian-2build1/esds_8c-source.html
		$num_bytes = 0;
		$length    = 0;
		do {
			$b = ord(substr($data, $offset++, 1));
			$length = ($length << 7) | ($b & 0x7F);
		} while (($b & 0x80) && ($num_bytes++ < 4));
		return $length;
	}

	/**
	 * @param int $languageid
	 *
	 * @return string
	 */
	public function QuicktimeLanguageLookup($languageid) {
		// http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
		static $QuicktimeLanguageLookup = array();
		if (empty($QuicktimeLanguageLookup)) {
			$QuicktimeLanguageLookup[0]     = 'English';
			$QuicktimeLanguageLookup[1]     = 'French';
			$QuicktimeLanguageLookup[2]     = 'German';
			$QuicktimeLanguageLookup[3]     = 'Italian';
			$QuicktimeLanguageLookup[4]     = 'Dutch';
			$QuicktimeLanguageLookup[5]     = 'Swedish';
			$QuicktimeLanguageLookup[6]     = 'Spanish';
			$QuicktimeLanguageLookup[7]     = 'Danish';
			$QuicktimeLanguageLookup[8]     = 'Portuguese';
			$QuicktimeLanguageLookup[9]     = 'Norwegian';
			$QuicktimeLanguageLookup[10]    = 'Hebrew';

Advertisement

Advertisement

Leave a Reply