Index: trunk/extensions/OggHandler/PEAR/File_Ogg/File/Ogg.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Capture pattern to determine if a file is an Ogg physical stream. |
54 | | - * |
| 54 | + * |
55 | 55 | * @access private |
56 | 56 | */ |
57 | 57 | define("OGG_CAPTURE_PATTERN", "OggS"); |
— | — | @@ -58,13 +58,13 @@ |
59 | 59 | * Maximum size of an Ogg stream page plus four. This value is specified to allow |
60 | 60 | * efficient parsing of the physical stream. The extra four is a paranoid measure |
61 | 61 | * to make sure a capture pattern is not split into two parts accidentally. |
62 | | - * |
| 62 | + * |
63 | 63 | * @access private |
64 | 64 | */ |
65 | 65 | define("OGG_MAXIMUM_PAGE_SIZE", 65311); |
66 | 66 | /** |
67 | 67 | * Capture pattern for an Ogg Vorbis logical stream. |
68 | | - * |
| 68 | + * |
69 | 69 | * @access private |
70 | 70 | */ |
71 | 71 | define("OGG_STREAM_CAPTURE_VORBIS", "vorbis"); |
— | — | @@ -75,38 +75,38 @@ |
76 | 76 | define("OGG_STREAM_CAPTURE_SPEEX", "Speex "); |
77 | 77 | /** |
78 | 78 | * Capture pattern for an Ogg FLAC logical stream. |
79 | | - * |
| 79 | + * |
80 | 80 | * @access private |
81 | 81 | */ |
82 | 82 | define("OGG_STREAM_CAPTURE_FLAC", "FLAC"); |
83 | 83 | /** |
84 | 84 | * Capture pattern for an Ogg Theora logical stream. |
85 | | - * |
| 85 | + * |
86 | 86 | * @access private |
87 | 87 | */ |
88 | 88 | define("OGG_STREAM_CAPTURE_THEORA", "theora"); |
89 | 89 | /** |
90 | 90 | * Error thrown if the file location passed is nonexistant or unreadable. |
91 | | - * |
| 91 | + * |
92 | 92 | * @access private |
93 | 93 | */ |
94 | 94 | define("OGG_ERROR_INVALID_FILE", 1); |
95 | 95 | /** |
96 | 96 | * Error thrown if the user attempts to extract an unsupported logical stream. |
97 | | - * |
| 97 | + * |
98 | 98 | * @access private |
99 | 99 | */ |
100 | 100 | define("OGG_ERROR_UNSUPPORTED", 2); |
101 | 101 | /** |
102 | 102 | * Error thrown if the user attempts to extract an logical stream with no |
103 | 103 | * corresponding serial number. |
104 | | - * |
| 104 | + * |
105 | 105 | * @access private |
106 | 106 | */ |
107 | 107 | define("OGG_ERROR_BAD_SERIAL", 3); |
108 | 108 | /** |
109 | 109 | * Error thrown if the stream appears to be corrupted. |
110 | | - * |
| 110 | + * |
111 | 111 | * @access private |
112 | 112 | */ |
113 | 113 | define("OGG_ERROR_UNDECODABLE", 4); |
— | — | @@ -220,13 +220,13 @@ |
221 | 221 | * Read a binary structure from a file. An array of unsigned integers are read. |
222 | 222 | * Large integers are upgraded to floating point on overflow. |
223 | 223 | * |
224 | | - * Format is big-endian as per Theora bit packing convention, this function |
| 224 | + * Format is big-endian as per Theora bit packing convention, this function |
225 | 225 | * won't work for Vorbis. |
226 | 226 | * |
227 | 227 | * @param resource $file |
228 | 228 | * @param array $fields Associative array mapping name to length in bits |
229 | 229 | */ |
230 | | - static function _readBigEndian($file, $fields) |
| 230 | + static function _readBigEndian($file, $fields) |
231 | 231 | { |
232 | 232 | $bufferLength = ceil(array_sum($fields) / 8); |
233 | 233 | $buffer = fread($file, $bufferLength); |
— | — | @@ -359,6 +359,7 @@ |
360 | 360 | |
361 | 361 | // Exact granule position |
362 | 362 | $abs_granule_pos = self::_littleEndianBin2Hex( substr($pageData, 6, 8)); |
| 363 | + |
363 | 364 | // Approximate (floating point) granule position |
364 | 365 | $pos = unpack("Va/Vb", substr($pageData, 6, 8)); |
365 | 366 | $approx_granule_pos = $pos['a'] + $pos['b'] * pow(2, 32); |
— | — | @@ -387,11 +388,11 @@ |
388 | 389 | 'data_length' => $pageFinish - $pageOffset, |
389 | 390 | 'group' => $groupId, |
390 | 391 | ); |
391 | | - |
392 | | - $this->_streamList[$stream_serial['data']]['stream_page'][$page_sequence['data']] = $page; |
| 392 | + $this->_streamList[$stream_serial['data']]['stream_page'][ $page_sequence['data'] ] = $page; |
| 393 | + $pageData = null; |
393 | 394 | return $page; |
394 | 395 | } |
395 | | - |
| 396 | + |
396 | 397 | /** |
397 | 398 | * @access private |
398 | 399 | */ |
— | — | @@ -426,7 +427,8 @@ |
427 | 428 | } |
428 | 429 | |
429 | 430 | $this_page_offset = $page['body_finish']; |
430 | | - fseek($this->_filePointer, $this_page_offset, SEEK_SET); |
| 431 | + fseek( $this->_filePointer, $this_page_offset, SEEK_SET ); |
| 432 | + unset( $pageData ); |
431 | 433 | } |
432 | 434 | // Loop through the streams, and find out what type of stream is available. |
433 | 435 | $groupLengths = array(); |
— | — | @@ -456,23 +458,23 @@ |
457 | 459 | if (isset($groupLengths[$group])) { |
458 | 460 | $groupLengths[$group] = max($groupLengths[$group], $stream->getLength()); |
459 | 461 | } else { |
460 | | - $groupLengths[$group] = $stream->getLength(); |
| 462 | + $groupLengths[$group] = $stream->getLength(); |
461 | 463 | } |
462 | 464 | //just store the startOffset for the first stream: |
463 | 465 | if( $this->_startOffset === false ){ |
464 | 466 | $this->_startOffset = $stream->getStartOffset(); |
465 | 467 | } |
466 | | - |
| 468 | + |
467 | 469 | } |
468 | 470 | } |
469 | 471 | $this->_groupLengths = $groupLengths; |
470 | 472 | $this->_totalLength = array_sum( $groupLengths ); |
471 | 473 | unset($this->_streamList); |
472 | 474 | } |
473 | | - |
| 475 | + |
474 | 476 | /** |
475 | 477 | * Returns the overead percentage used by the Ogg headers. |
476 | | - * |
| 478 | + * |
477 | 479 | * This function returns the percentage of the total stream size |
478 | 480 | * used for Ogg headers. |
479 | 481 | * |
— | — | @@ -489,7 +491,7 @@ |
490 | 492 | } |
491 | 493 | return sprintf("%0.2f", ($header_size / $stream_size) * 100); |
492 | 494 | } |
493 | | - |
| 495 | + |
494 | 496 | /** |
495 | 497 | * Returns the appropriate logical bitstream that corresponds to the provided serial. |
496 | 498 | * |
— | — | @@ -507,7 +509,7 @@ |
508 | 510 | |
509 | 511 | return $this->_streams[$streamSerial]; |
510 | 512 | } |
511 | | - |
| 513 | + |
512 | 514 | /** |
513 | 515 | * This function returns true if a logical bitstream of the requested type can be found. |
514 | 516 | * |
— | — | @@ -526,7 +528,7 @@ |
527 | 529 | } |
528 | 530 | return (false); |
529 | 531 | } |
530 | | - |
| 532 | + |
531 | 533 | /** |
532 | 534 | * Returns an array of logical streams inside this physical bitstream. |
533 | 535 | * |
— | — | @@ -563,7 +565,7 @@ |
564 | 566 | if (! isset($streams[$stream_type])) |
565 | 567 | // Initialise the result list for this stream type. |
566 | 568 | $streams[$stream_type] = array(); |
567 | | - |
| 569 | + |
568 | 570 | $streams[$stream_type][] = $serial; |
569 | 571 | } |
570 | 572 | |
Index: trunk/extensions/OggHandler/PEAR/File_Ogg/File/Ogg/Bitstream.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | * @var int |
63 | 63 | * @access private |
64 | 64 | */ |
65 | | - var $_lastGranulePos; |
| 65 | + var $_lastGranulePos; |
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Constructor for a generic logical stream. |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | { |
112 | 112 | return ($this->_streamSerial); |
113 | 113 | } |
114 | | - |
| 114 | + |
115 | 115 | /** |
116 | 116 | * Gives the size (in bits) of this stream. |
117 | 117 | * |
Index: trunk/extensions/OggHandler/PEAR/File_Ogg/File/Ogg/Theora.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | * @version CVS: $Id: Theora.php,v 1.9 2005/11/16 20:43:27 djg Exp $ |
42 | 42 | */ |
43 | 43 | class File_Ogg_Theora extends File_Ogg_Media |
44 | | -{ |
| 44 | +{ |
45 | 45 | /** |
46 | 46 | * @access private |
47 | 47 | */ |
— | — | @@ -50,41 +50,37 @@ |
51 | 51 | $this->_decodeIdentificationHeader(); |
52 | 52 | $this->_decodeCommentsHeader(); |
53 | 53 | $endSec = $this->getSecondsFromGranulePos( $this->_lastGranulePos ); |
54 | | - |
| 54 | + |
55 | 55 | $startSec = $this->getSecondsFromGranulePos( $this->_firstGranulePos ); |
56 | | - |
| 56 | + |
57 | 57 | //make sure the offset is worth taking into account oggz_chop related hack |
58 | 58 | if( $startSec > 1){ |
59 | 59 | $this->_streamLength = $endSec - $startSec; |
60 | | - $this->_startOffset = $startSec; |
| 60 | + $this->_startOffset = $startSec; |
61 | 61 | }else{ |
62 | 62 | $this->_streamLength = $endSec; |
63 | 63 | } |
64 | | - |
65 | | - /*print "last gran: $this->_lastGranulePos = $endSec \n |
66 | | -first gran: $this->_firstGranulePos = $startSec \n |
67 | | -stream len: $this->_streamLength;";*/ |
68 | 64 | |
69 | 65 | $this->_avgBitrate = $this->_streamLength ? ($this->_streamSize * 8) / $this->_streamLength : 0; |
70 | 66 | } |
71 | 67 | function getSecondsFromGranulePos($granulePos){ |
72 | 68 | // Calculate GranulePos seconds |
73 | 69 | // First make some "numeric strings" |
74 | | - // These might not fit into PHP's integer type, but they will fit into |
| 70 | + // These might not fit into PHP's integer type, but they will fit into |
75 | 71 | // the 53-bit mantissa of a double-precision number |
76 | 72 | $topWord = floatval( base_convert( substr( $granulePos, 0, 8 ), 16, 10 ) ); |
77 | 73 | $bottomWord = floatval( base_convert( substr( $granulePos, 8, 8 ), 16, 10 ) ); |
78 | 74 | // Calculate the keyframe position by shifting right by KFGSHIFT |
79 | 75 | // We don't use PHP's shift operators because they're terribly broken |
80 | 76 | // This is made slightly simpler by the fact that KFGSHIFT < 32 |
81 | | - $keyFramePos = $topWord / pow(2, $this->_kfgShift - 32) + |
| 77 | + $keyFramePos = $topWord / pow(2, $this->_kfgShift - 32) + |
82 | 78 | floor( $bottomWord / pow(2, $this->_kfgShift) ); |
83 | 79 | // Calculate the frame offset by masking off the top 64-KFGSHIFT bits |
84 | 80 | // This requires a bit of floating point trickery |
85 | 81 | $offset = fmod( $bottomWord, pow(2, $this->_kfgShift) ); |
86 | 82 | // They didn't teach you that one at school did they? |
87 | 83 | // Now put it together with the frame rate to calculate time in seconds |
88 | | - return ( $keyFramePos + $offset ) / $this->_frameRate; |
| 84 | + return ( $keyFramePos + $offset ) / $this->_frameRate; |
89 | 85 | } |
90 | 86 | /** |
91 | 87 | * Get the 6-byte identification string expected in the common header |
— | — | @@ -138,7 +134,7 @@ |
139 | 135 | } |
140 | 136 | $this->_frameWidth = $h['FMBW'] * 16; |
141 | 137 | $this->_frameHeight = $h['FMBH'] * 16; |
142 | | - |
| 138 | + |
143 | 139 | // Picture height/width |
144 | 140 | if ( $h['PICW'] > $this->_frameWidth || $h['PICH'] > $this->_frameHeight ) { |
145 | 141 | throw new PEAR_Exception("Stream is undecodable because the picture width is greater than the frame width.", OGG_ERROR_UNDECODABLE); |
— | — | @@ -174,7 +170,7 @@ |
175 | 171 | |
176 | 172 | $this->_quality = $h['QUAL']; |
177 | 173 | $this->_kfgShift = $h['KFGSHIFT']; |
178 | | - |
| 174 | + |
179 | 175 | $pixelFormats = array( |
180 | 176 | 0 => '4:2:0', |
181 | 177 | 1 => 'Unknown (reserved)', |
— | — | @@ -184,25 +180,25 @@ |
185 | 181 | $this->_pixelFormat = $pixelFormats[$h['PF']]; |
186 | 182 | |
187 | 183 | switch ( $h['PF'] ) { |
188 | | - case 0: |
189 | | - $h['NSBS'] = |
190 | | - floor( ($h['FMBW'] + 1) / 2 ) * |
191 | | - floor( ($h['FMBH'] + 1) / 2 ) + 2 * |
192 | | - floor( ($h['FMBW'] + 3) / 4 ) * |
| 184 | + case 0: |
| 185 | + $h['NSBS'] = |
| 186 | + floor( ($h['FMBW'] + 1) / 2 ) * |
| 187 | + floor( ($h['FMBH'] + 1) / 2 ) + 2 * |
| 188 | + floor( ($h['FMBW'] + 3) / 4 ) * |
193 | 189 | floor( ($h['FMBH'] + 3) / 4 ); |
194 | 190 | $h['NBS'] = 6 * $h['FMBW'] * $h['FMBH']; |
195 | 191 | break; |
196 | 192 | case 2: |
197 | | - $h['NSBS'] = |
198 | | - floor( ($h['FMBW'] + 1) / 2 ) * |
199 | | - floor( ($h['FMBH'] + 1) / 2 ) + 2 * |
200 | | - floor( ($h['FMBW'] + 3) / 4 ) * |
| 193 | + $h['NSBS'] = |
| 194 | + floor( ($h['FMBW'] + 1) / 2 ) * |
| 195 | + floor( ($h['FMBH'] + 1) / 2 ) + 2 * |
| 196 | + floor( ($h['FMBW'] + 3) / 4 ) * |
201 | 197 | floor( ($h['FMBH'] + 1) / 2 ); |
202 | 198 | $h['NBS'] = 8 * $h['FMBW'] * $h['FMBH']; |
203 | 199 | break; |
204 | 200 | case 3: |
205 | | - $h['NSBS'] = |
206 | | - 3 * floor( ($h['FMBW'] + 1) / 2 ) * |
| 201 | + $h['NSBS'] = |
| 202 | + 3 * floor( ($h['FMBW'] + 1) / 2 ) * |
207 | 203 | floor( ($h['FMBH'] + 1) / 2 ); |
208 | 204 | $h['NBS'] = 12 * $h['FMBW'] * $h['FMBH']; |
209 | 205 | break; |
Index: trunk/extensions/OggHandler/PEAR/File_Ogg/File/Ogg/Vorbis.php |
— | — | @@ -25,32 +25,32 @@ |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Check number for the first header in a Vorbis stream. |
29 | | - * |
| 29 | + * |
30 | 30 | * @access private |
31 | 31 | */ |
32 | 32 | define("OGG_VORBIS_IDENTIFICATION_HEADER", 1); |
33 | 33 | /** |
34 | 34 | * Check number for the second header in a Vorbis stream. |
35 | | - * |
| 35 | + * |
36 | 36 | * @access private |
37 | 37 | */ |
38 | 38 | define("OGG_VORBIS_COMMENTS_HEADER", 3); |
39 | 39 | /** |
40 | 40 | * Check number for the third header in a Vorbis stream. |
41 | | - * |
| 41 | + * |
42 | 42 | * @access private |
43 | 43 | */ |
44 | 44 | define("OGG_VORBIS_SETUP_HEADER", 5); |
45 | 45 | /** |
46 | 46 | * Error thrown if the stream appears to be corrupted. |
47 | | - * |
| 47 | + * |
48 | 48 | * @access private |
49 | 49 | */ |
50 | 50 | define("OGG_VORBIS_ERROR_UNDECODABLE", OGG_ERROR_UNDECODABLE); |
51 | 51 | /** |
52 | 52 | * Error thrown if the user attempts to extract a comment using a comment key |
53 | 53 | * that does not exist. |
54 | | - * |
| 54 | + * |
55 | 55 | * @access private |
56 | 56 | */ |
57 | 57 | define("OGG_VORBIS_ERROR_INVALID_COMMENT", 2); |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | /** |
63 | 63 | * Error thrown if the user attempts to write a comment containing an illegal |
64 | 64 | * character |
65 | | - * |
| 65 | + * |
66 | 66 | * @access private |
67 | 67 | */ |
68 | 68 | define("OGG_VORBIS_ERROR_ILLEGAL_COMMENT", 3); |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | * @access private |
150 | 150 | * @var int |
151 | 151 | */ |
152 | | - var $_streamLength; |
| 152 | + var $_streamLength; |
153 | 153 | |
154 | 154 | /** |
155 | 155 | * the start offset of this stream in seconds |
— | — | @@ -171,15 +171,10 @@ |
172 | 172 | parent::__construct($streamSerial, $streamData, $filePointer); |
173 | 173 | $this->_decodeIdentificationHeader(); |
174 | 174 | $this->_decodeCommentsHeader(OGG_VORBIS_COMMENTS_HEADER, OGG_VORBIS_COMMENTS_PAGE_OFFSET); |
175 | | - $endSec = (( '0x' . substr( $this->_lastGranulePos, 0, 8 ) ) * pow(2, 32) |
176 | | - + ( '0x' . substr( $this->_lastGranulePos, 8, 8 ) )) |
177 | | - / $this->_idHeader['audio_sample_rate']; |
178 | | - |
179 | | - |
180 | | - $startSec = (( '0x' . substr( $this->_firstGranulePos, 0, 8 ) ) * pow(2, 32) |
181 | | - + ( '0x' . substr( $this->_firstGranulePos, 8, 8 ) )) |
182 | | - / $this->_idHeader['audio_sample_rate']; |
183 | | - |
| 175 | + |
| 176 | + $endSec = $this->getSecondsFromGranulePos( $this->_lastGranulePos ); |
| 177 | + $startSec = $this->getSecondsFromGranulePos( $this->_firstGranulePos ); |
| 178 | + |
184 | 179 | //make sure the offset is worth taking into account oggz_chop related hack |
185 | 180 | if( $startSec > 1){ |
186 | 181 | $this->_streamLength = $endSec - $startSec; |
— | — | @@ -187,16 +182,20 @@ |
188 | 183 | }else{ |
189 | 184 | $this->_streamLength = $endSec; |
190 | 185 | } |
191 | | - |
| 186 | + |
192 | 187 | $this->_avgBitrate = $this->_streamLength ? ($this->_streamSize * 8) / $this->_streamLength : 0; |
193 | 188 | } |
194 | | - |
| 189 | + function getSecondsFromGranulePos( $granulePos ){ |
| 190 | + return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) |
| 191 | + + ( '0x' . substr( $granulePos, 8, 8 ) )) |
| 192 | + / $this->_idHeader['audio_sample_rate']; |
| 193 | + } |
195 | 194 | /** |
196 | 195 | * Get a short string describing the type of the stream |
197 | 196 | */ |
198 | | - function getType() |
| 197 | + function getType() |
199 | 198 | { |
200 | | - return 'Vorbis'; |
| 199 | + return 'Vorbis'; |
201 | 200 | } |
202 | 201 | |
203 | 202 | /** |
— | — | @@ -230,42 +229,42 @@ |
231 | 230 | $this->_version = $h['vorbis_version']; |
232 | 231 | else |
233 | 232 | throw new PEAR_Exception("Stream is undecodable due to an invalid vorbis stream version.", OGG_VORBIS_ERROR_UNDECODABLE); |
234 | | - |
| 233 | + |
235 | 234 | // The number of channels MUST be greater than 0. |
236 | 235 | if ($h['audio_channels'] == 0) |
237 | 236 | throw new PEAR_Exception("Stream is undecodable due to zero channels.", OGG_VORBIS_ERROR_UNDECODABLE); |
238 | 237 | else |
239 | 238 | $this->_channels = $h['audio_channels']; |
240 | | - |
| 239 | + |
241 | 240 | // The sample rate MUST be greater than 0. |
242 | 241 | if ($h['audio_sample_rate'] == 0) |
243 | 242 | throw new PEAR_Exception("Stream is undecodable due to a zero sample rate.", OGG_VORBIS_ERROR_UNDECODABLE); |
244 | 243 | else |
245 | 244 | $this->_sampleRate = $h['audio_sample_rate']; |
246 | | - |
| 245 | + |
247 | 246 | // Extract the various bitrates |
248 | 247 | $this->_maxBitrate = $h['bitrate_maximum']; |
249 | 248 | $this->_nomBitrate = $h['bitrate_nominal']; |
250 | 249 | $this->_minBitrate = $h['bitrate_minimum']; |
251 | | - |
| 250 | + |
252 | 251 | // Powers of two between 6 and 13 inclusive. |
253 | 252 | $valid_block_sizes = array(64, 128, 256, 512, 1024, 2048, 4096, 8192); |
254 | | - |
| 253 | + |
255 | 254 | // blocksize_0 MUST be a valid blocksize. |
256 | 255 | $blocksize_0 = pow(2, $h['blocksize_0']); |
257 | 256 | if (FALSE == in_array($blocksize_0, $valid_block_sizes)) |
258 | 257 | throw new PEAR_Exception("Stream is undecodable because blocksize_0 is $blocksize_0, which is not a valid size.", OGG_VORBIS_ERROR_UNDECODABLE); |
259 | | - |
| 258 | + |
260 | 259 | // Extract bits 5 to 8 from the character data. |
261 | 260 | // blocksize_1 MUST be a valid blocksize. |
262 | 261 | $blocksize_1 = pow(2, $h['blocksize_1']); |
263 | 262 | if (FALSE == in_array($blocksize_1, $valid_block_sizes)) |
264 | 263 | throw new PEAR_Exception("Stream is undecodable because blocksize_1 is not a valid size.", OGG_VORBIS_ERROR_UNDECODABLE); |
265 | | - |
| 264 | + |
266 | 265 | // blocksize 0 MUST be less than or equal to blocksize 1. |
267 | 266 | if ($blocksize_0 > $blocksize_1) |
268 | 267 | throw new PEAR_Exception("Stream is undecodable because blocksize_0 is not less than or equal to blocksize_1.", OGG_VORBIS_ERROR_UNDECODABLE); |
269 | | - |
| 268 | + |
270 | 269 | // The framing bit MUST be set to mark the end of the identification header. |
271 | 270 | // Some encoders are broken though -- TS |
272 | 271 | /* |
— | — | @@ -298,7 +297,7 @@ |
299 | 298 | function getIdentificationString() { |
300 | 299 | return OGG_STREAM_CAPTURE_VORBIS; |
301 | 300 | } |
302 | | - |
| 301 | + |
303 | 302 | /** |
304 | 303 | * Version of the Vorbis specification referred to in the encoding of this stream. |
305 | 304 | * |
— | — | @@ -407,7 +406,7 @@ |
408 | 407 | { |
409 | 408 | return ($this->_channels == 1); |
410 | 409 | } |
411 | | - |
| 410 | + |
412 | 411 | /** |
413 | 412 | * States whether this logical stream was encoded in stereo. |
414 | 413 | * |
— | — | @@ -418,7 +417,7 @@ |
419 | 418 | { |
420 | 419 | return ($this->_channels == 2); |
421 | 420 | } |
422 | | - |
| 421 | + |
423 | 422 | /** |
424 | 423 | * States whether this logical stream was encoded in quadrophonic sound. |
425 | 424 | * |
— | — | @@ -429,7 +428,7 @@ |
430 | 429 | { |
431 | 430 | return ($this->_channels == 4); |
432 | 431 | } |
433 | | - |
| 432 | + |
434 | 433 | /** |
435 | 434 | * The title of this track, e.g. "What's Up Pussycat?". |
436 | 435 | * |
— | — | @@ -440,7 +439,7 @@ |
441 | 440 | { |
442 | 441 | return ($this->getField("TITLE")); |
443 | 442 | } |
444 | | - |
| 443 | + |
445 | 444 | /** |
446 | 445 | * Set the title of this track. |
447 | 446 | * |
— | — | @@ -452,7 +451,7 @@ |
453 | 452 | { |
454 | 453 | $this->setField("TITLE", $title, $replace); |
455 | 454 | } |
456 | | - |
| 455 | + |
457 | 456 | /** |
458 | 457 | * The version of the track, such as a remix. |
459 | 458 | * |
— | — | @@ -463,7 +462,7 @@ |
464 | 463 | { |
465 | 464 | return $this->getField("VERSION"); |
466 | 465 | } |
467 | | - |
| 466 | + |
468 | 467 | /** |
469 | 468 | * Set the version of this track. |
470 | 469 | * |
— | — | @@ -475,7 +474,7 @@ |
476 | 475 | { |
477 | 476 | $this->setField("VERSION", $version, $replace); |
478 | 477 | } |
479 | | - |
| 478 | + |
480 | 479 | /** |
481 | 480 | * The album or collection from which this track comes. |
482 | 481 | * |
— | — | @@ -486,7 +485,7 @@ |
487 | 486 | { |
488 | 487 | return ($this->getField("ALBUM")); |
489 | 488 | } |
490 | | - |
| 489 | + |
491 | 490 | /** |
492 | 491 | * Set the album or collection for this track. |
493 | 492 | * |
— | — | @@ -498,7 +497,7 @@ |
499 | 498 | { |
500 | 499 | $this->setField("ALBUM", $album, $replace); |
501 | 500 | } |
502 | | - |
| 501 | + |
503 | 502 | /** |
504 | 503 | * The number of this track if it is part of a larger collection. |
505 | 504 | * |
— | — | @@ -509,7 +508,7 @@ |
510 | 509 | { |
511 | 510 | return ($this->getField("TRACKNUMBER")); |
512 | 511 | } |
513 | | - |
| 512 | + |
514 | 513 | /** |
515 | 514 | * Set the number of this relative to the collection. |
516 | 515 | * |
— | — | @@ -521,7 +520,7 @@ |
522 | 521 | { |
523 | 522 | $this->setField("TRACKNUMBER", $number, $replace); |
524 | 523 | } |
525 | | - |
| 524 | + |
526 | 525 | /** |
527 | 526 | * The artist responsible for this track. |
528 | 527 | * |
— | — | @@ -535,7 +534,7 @@ |
536 | 535 | { |
537 | 536 | return ($this->getField("ARTIST")); |
538 | 537 | } |
539 | | - |
| 538 | + |
540 | 539 | /** |
541 | 540 | * Set the artist of this track. |
542 | 541 | * |
— | — | @@ -547,7 +546,7 @@ |
548 | 547 | { |
549 | 548 | $this->setField("ARTIST", $artist, $replace = true); |
550 | 549 | } |
551 | | - |
| 550 | + |
552 | 551 | /** |
553 | 552 | * The performer of this track, such as an orchestra |
554 | 553 | * |
— | — | @@ -558,7 +557,7 @@ |
559 | 558 | { |
560 | 559 | return ($this->getField("PERFORMER")); |
561 | 560 | } |
562 | | - |
| 561 | + |
563 | 562 | /** |
564 | 563 | * Set the performer of this track. |
565 | 564 | * |
— | — | @@ -570,7 +569,7 @@ |
571 | 570 | { |
572 | 571 | $this->setField("PERFORMER", $performer, $replace); |
573 | 572 | } |
574 | | - |
| 573 | + |
575 | 574 | /** |
576 | 575 | * The copyright attribution for this track. |
577 | 576 | * |
— | — | @@ -581,7 +580,7 @@ |
582 | 581 | { |
583 | 582 | return ($this->getField("COPYRIGHT")); |
584 | 583 | } |
585 | | - |
| 584 | + |
586 | 585 | /** |
587 | 586 | * Set the copyright attribution for this track. |
588 | 587 | * |
— | — | @@ -593,7 +592,7 @@ |
594 | 593 | { |
595 | 594 | $this->setField("COPYRIGHT", $copyright, $replace); |
596 | 595 | } |
597 | | - |
| 596 | + |
598 | 597 | /** |
599 | 598 | * The rights of distribution for this track. |
600 | 599 | * |
— | — | @@ -607,7 +606,7 @@ |
608 | 607 | { |
609 | 608 | return ($this->getField("LICENSE")); |
610 | 609 | } |
611 | | - |
| 610 | + |
612 | 611 | /** |
613 | 612 | * Set the distribution rights for this track. |
614 | 613 | * |
— | — | @@ -619,11 +618,11 @@ |
620 | 619 | { |
621 | 620 | $this->setField("LICENSE", $license, $replace); |
622 | 621 | } |
623 | | - |
| 622 | + |
624 | 623 | /** |
625 | 624 | * The organisation responsible for this track. |
626 | 625 | * |
627 | | - * This function returns the name of the organisation responsible for |
| 626 | + * This function returns the name of the organisation responsible for |
628 | 627 | * the production of this track, such as the record label. |
629 | 628 | * |
630 | 629 | * @access public |
— | — | @@ -633,7 +632,7 @@ |
634 | 633 | { |
635 | 634 | return ($this->getField("ORGANIZATION")); |
636 | 635 | } |
637 | | - |
| 636 | + |
638 | 637 | /** |
639 | 638 | * Set the organisation responsible for this track. |
640 | 639 | * |
— | — | @@ -645,7 +644,7 @@ |
646 | 645 | { |
647 | 646 | $this->setField("ORGANIZATION", $organization, $replace); |
648 | 647 | } |
649 | | - |
| 648 | + |
650 | 649 | /** |
651 | 650 | * A short description of the contents of this track. |
652 | 651 | * |
— | — | @@ -659,7 +658,7 @@ |
660 | 659 | { |
661 | 660 | return ($this->getField("DESCRIPTION")); |
662 | 661 | } |
663 | | - |
| 662 | + |
664 | 663 | /** |
665 | 664 | * Set the description of this track. |
666 | 665 | * |
— | — | @@ -671,7 +670,7 @@ |
672 | 671 | { |
673 | 672 | $this->setField("DESCRIPTION", $replace); |
674 | 673 | } |
675 | | - |
| 674 | + |
676 | 675 | /** |
677 | 676 | * The genre of this recording (e.g. Rock) |
678 | 677 | * |
— | — | @@ -685,7 +684,7 @@ |
686 | 685 | { |
687 | 686 | return ($this->getField("GENRE")); |
688 | 687 | } |
689 | | - |
| 688 | + |
690 | 689 | /** |
691 | 690 | * Set the genre of this track. |
692 | 691 | * |
— | — | @@ -697,7 +696,7 @@ |
698 | 697 | { |
699 | 698 | $this->setField("GENRE", $genre, $replace); |
700 | 699 | } |
701 | | - |
| 700 | + |
702 | 701 | /** |
703 | 702 | * The date of the recording of this track. |
704 | 703 | * |
— | — | @@ -711,7 +710,7 @@ |
712 | 711 | { |
713 | 712 | return ($this->getField("DATE")); |
714 | 713 | } |
715 | | - |
| 714 | + |
716 | 715 | /** |
717 | 716 | * Set the date of recording for this track. |
718 | 717 | * |
— | — | @@ -723,7 +722,7 @@ |
724 | 723 | { |
725 | 724 | $this->setField("DATE", $date, $replace); |
726 | 725 | } |
727 | | - |
| 726 | + |
728 | 727 | /** |
729 | 728 | * Where this recording was made. |
730 | 729 | * |
— | — | @@ -737,7 +736,7 @@ |
738 | 737 | { |
739 | 738 | return ($this->getField("LOCATION")); |
740 | 739 | } |
741 | | - |
| 740 | + |
742 | 741 | /** |
743 | 742 | * Set the location of the recording of this track. |
744 | 743 | * |
— | — | @@ -749,7 +748,7 @@ |
750 | 749 | { |
751 | 750 | $this->setField("LOCATION", $location, $replace); |
752 | 751 | } |
753 | | - |
| 752 | + |
754 | 753 | /** |
755 | 754 | * @access public |
756 | 755 | * @return string |
— | — | @@ -758,7 +757,7 @@ |
759 | 758 | { |
760 | 759 | return ($this->getField("CONTACT")); |
761 | 760 | } |
762 | | - |
| 761 | + |
763 | 762 | /** |
764 | 763 | * Set the contact information for this track. |
765 | 764 | * |
— | — | @@ -770,7 +769,7 @@ |
771 | 770 | { |
772 | 771 | $this->setField("CONTACT", $contact, $replace); |
773 | 772 | } |
774 | | - |
| 773 | + |
775 | 774 | /** |
776 | 775 | * International Standard Recording Code. |
777 | 776 | * |
— | — | @@ -784,7 +783,7 @@ |
785 | 784 | { |
786 | 785 | return ($this->getField("ISRC")); |
787 | 786 | } |
788 | | - |
| 787 | + |
789 | 788 | /** |
790 | 789 | * Set the ISRC for this track. |
791 | 790 | * |
Index: trunk/extensions/OggHandler/OggHandler.php |
— | — | @@ -62,6 +62,9 @@ |
63 | 63 | //Location of oggThumb binary (used over the ffmpeg version) |
64 | 64 | $wgOggThumbLocation = '/usr/bin/oggThumb'; |
65 | 65 | |
| 66 | +//the location of ffmpeg2theora |
| 67 | +$wgffmpeg2theoraPath ='/usr/bin/ffmpeg2theora'; |
| 68 | + |
66 | 69 | // Location of the FFmpeg binary |
67 | 70 | $wgFFmpegLocation = '/usr/bin/ffmpeg'; |
68 | 71 | |