http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84453

Revision: 84453
Author:   catrope
Date:     2011-03-21 15:32:29 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
TimedMediaHandler: Some indentation fixes (tabs->spaces, mostly)

Modified Paths:
--------------
    trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php
    trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php
    
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php

Modified: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php
===================================================================
--- trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php    
2011-03-21 15:31:29 UTC (rev 84452)
+++ trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php    
2011-03-21 15:32:29 UTC (rev 84453)
@@ -83,27 +83,28 @@
        
        function getImagePopUp(){
                return Xml::tags( 'div' , array(
-                       'id' => "ogg_thumbplayer_" . 
TimedMediaTransformOutput::$serial++,
-                       'class' => 'PopUpMediaTransform',
-                       'style' => "width:" . intval( $this->width ) . 
"px;height:" . 
-                                               intval( 
$this->getPlayerHeight() ) . "px",
-                       'data-videopayload' => $this->getXmlMediaTagOutput( 
$this->getPopupPlayerSize() ),
+                               'id' => "ogg_thumbplayer_" . 
TimedMediaTransformOutput::$serial++,
+                               'class' => 'PopUpMediaTransform',
+                               'style' => "width:" . intval( $this->width ) . 
"px;height:" . 
+                                                       intval( 
$this->getPlayerHeight() ) . "px",
+                               'data-videopayload' => 
$this->getXmlMediaTagOutput( $this->getPopupPlayerSize() ),
                        ),
-                               Xml::tags( 'img', array(
-                                       'style' => 'width:100%;height:100%;',
-                                       'src' =>  $this->getUrl(),
-                               ),'')
-                               .
-                               // For javascript disabled browsers provide a 
link to the asset:
-                               Xml::tags( 'a', array(
+                       Xml::tags( 'img', array(
+                               'style' => 'width:100%;height:100%;',
+                               'src' =>  $this->getUrl(),
+                       ),'')
+                       .
+                       // For javascript disabled browsers provide a link to 
the asset:
+                       Xml::tags( 'a', array(
                                        'href'=> $this->file->getUrl(),
                                        'title' => wfMsg( 
'timedmedia-play-media' )
                                ), '<b></b>'. // why is the a child tag escaped 
unless there is an html string prefix? 
-                                       Xml::tags( 'div', array(
+                               Xml::tags( 'div', array(
                                                'target' => '_new',
                                                'class' => 'play-btn-large'
-                                       ), '')
+                                       ), ''
                                )
+                       )
                );
        }
        

Modified: 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php
===================================================================
--- trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php  
2011-03-21 15:31:29 UTC (rev 84452)
+++ trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php  
2011-03-21 15:32:29 UTC (rev 84453)
@@ -61,7 +61,7 @@
                                'bufDelay'                      => '128',
                                'videoCodec'                    => 'theora',
                        ),
-          WebVideoTranscode::ENC_OGV_4MBS =>
+               WebVideoTranscode::ENC_OGV_4MBS =>
                        array(
                                'maxSize'                       => '360',
                                'videoBitrate'          => '368',

Modified: 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php
===================================================================
--- 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php   
    2011-03-21 15:31:29 UTC (rev 84452)
+++ 
trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php   
    2011-03-21 15:32:29 UTC (rev 84453)
@@ -152,24 +152,24 @@
                        $cmd.= $this->ffmpegAddVideoOptions( $file, $target, 
$options, $pass );
                }
                                                           
-           // Check for start time
+               // Check for start time
                if( isset( $options['starttime'] ) ){
                        $cmd.= ' -ss ' . wfEscapeShellArg( 
$options['starttime'] );
                } else {
                        $options['starttime'] = 0;
                }
-           // Check for end time:
-           if( isset( $options['endtime'] ) ){
-               $cmd.= ' -t ' . intval( $options['endtime'] )  - 
intval($options['starttime'] ) ;
-           }
-           
-           if ( $pass == 1 || isset( $options['noaudio'] ) ) {
-               $cmd.= ' -an';
-           } else {
-               $cmd.= $this->ffmpegAddAudioOptions( $file, $target, $options, 
$pass );
-           }               
+               // Check for end time:
+               if( isset( $options['endtime'] ) ){
+               $cmd.= ' -t ' . intval( $options['endtime'] )  - 
intval($options['starttime'] ) ;
+               }
 
-           // Output WebM
+               if ( $pass == 1 || isset( $options['noaudio'] ) ) {
+               $cmd.= ' -an';
+               } else {
+               $cmd.= $this->ffmpegAddAudioOptions( $file, $target, $options, 
$pass );
+               }                   
+
+               // Output WebM
                $cmd.=" -f webm";
                
                if ( $pass != 0 ) {
@@ -230,56 +230,56 @@
                        // Get size transform ( if maxSize is > file, file size 
is used:
                        list( $width, $height ) = 
WebVideoTranscode::getMaxSizeTransform( $file, $options['maxSize'] );           
              
                        $cmd.= ' -s ' . intval( $width ) . 'x' . intval( 
$height );
-           } else if ( 
-               (isset( $options['width'] ) && $options['width'] > 0 ) 
+               } else if ( 
+                       (isset( $options['width'] ) && $options['width'] > 0 ) 
                        &&
                        (isset( $options['height'] ) && $options['height'] > 0 
) 
-           ){
+               ){
                        $cmd.= ' -s ' . intval( $options['width'] ) . 'x' . 
intval( $options['height'] );
-           }
-           
+               }
+               
                // Handle crop:
-           $optionMap = array(
-               'cropTop' => '-croptop',
-               'cropBottom' => '-cropbottom',
-               'cropLeft' => '-cropleft',
-               'cropRight' => '-cropright'
-           );
-           foreach( $optionMap as $name => $cmdArg ){
-               if( isset($options[$name]) ){
-                       $cmd.= " $cmdArg " .  wfEscapeShellArg( $options[$name] 
);
-               }
-           }
-           
-           // Check for keyframeInterval
-           if( isset( $options['keyframeInterval'] ) ){
-               $cmd.= ' -g ' . wfEscapeShellArg( $options['keyframeInterval'] 
);
-               $cmd.= ' -keyint_min ' . wfEscapeShellArg( 
$options['keyframeInterval'] );
-           }
-           if( isset( $options['deinterlace'] ) ){
-               $cmd.= ' -deinterlace';
-           }
-           
-           return $cmd;
+               $optionMap = array(
+                       'cropTop' => '-croptop',
+                       'cropBottom' => '-cropbottom',
+                       'cropLeft' => '-cropleft',
+                       'cropRight' => '-cropright'
+               );
+               foreach( $optionMap as $name => $cmdArg ){
+                       if( isset($options[$name]) ){
+                               $cmd.= " $cmdArg " .  wfEscapeShellArg( 
$options[$name] );
+                       }
+               }
+
+               // Check for keyframeInterval
+               if( isset( $options['keyframeInterval'] ) ){
+                       $cmd.= ' -g ' . wfEscapeShellArg( 
$options['keyframeInterval'] );
+                       $cmd.= ' -keyint_min ' . wfEscapeShellArg( 
$options['keyframeInterval'] );
+               }
+               if( isset( $options['deinterlace'] ) ){
+                       $cmd.= ' -deinterlace';
+               }
+
+               return $cmd;
        }
-       
+
        function ffmpegAddAudioOptions( $file, $target, $options, $pass){
                $cmd ='';
                if( isset( $options['audioQuality'] ) ){
                        $cmd.= " -aq " . wfEscapeShellArg( 
$options['audioQuality'] );
                }                          
                if( isset( $options['audioBitrate'] )){
-               $cmd.= ' -ab ' . intval( $options['audioBitrate'] ) * 1000;
-           }
-           if( isset( $options['samplerate'] ) ){
-               $cmd.= " -ar " .  wfEscapeShellArg( $options['samplerate'] );
-           }
-           if( isset( $options['channels'] )){
-               $cmd.= " -ac " . wfEscapeShellArg( $options['channels'] );
-           }
-           // Always use vorbis for audio:
-               $cmd.= " -acodec libvorbis ";
-               return $cmd;
+                       $cmd.= ' -ab ' . intval( $options['audioBitrate'] ) * 
1000;
+               }
+               if( isset( $options['samplerate'] ) ){
+                       $cmd.= " -ar " .  wfEscapeShellArg( 
$options['samplerate'] );
+               }
+               if( isset( $options['channels'] )){
+                       $cmd.= " -ac " . wfEscapeShellArg( $options['channels'] 
);
+               }
+               // Always use vorbis for audio:
+               $cmd.= " -acodec libvorbis ";
+               return $cmd;
        }
        
        


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to