logo       

[MediaWiki-CVS] SVN: [54063] trunk/extensions/WikiAtHome: msg#01441

mediawiki-cvs

Subject: [MediaWiki-CVS] SVN: [54063] trunk/extensions/WikiAtHome

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

Revision: 54063
Author: dale
Date: 2009-07-31 00:59:06 +0000 (Fri, 31 Jul 2009)

Log Message:
-----------
more wiki@home
* schema updates
* javascript flow update
* basic server side debug of uploaded media pieces

Modified Paths:
--------------
trunk/extensions/WikiAtHome/ApiWikiAtHome.php
trunk/extensions/WikiAtHome/NonFreeVideoHandler.php
trunk/extensions/WikiAtHome/WahJobManager.php
trunk/extensions/WikiAtHome/WikiAtHome.js
trunk/extensions/WikiAtHome/WikiAtHome.php
trunk/extensions/WikiAtHome/WikiAtHome.sql

Modified: trunk/extensions/WikiAtHome/ApiWikiAtHome.php
===================================================================
--- trunk/extensions/WikiAtHome/ApiWikiAtHome.php 2009-07-31 00:56:50 UTC
(rev 54062)
+++ trunk/extensions/WikiAtHome/ApiWikiAtHome.php 2009-07-31 00:59:06 UTC
(rev 54063)
@@ -52,26 +52,93 @@
$job4Client['job_key'] = $job->job_id . '_'.
sha1( $job->job_json );
$job4Client['job_title']= $job->title;
$job4Client['job_ns'] = $job->ns;
-
+ $job4Client['job_set_id'] = $job->job_set_id;
+
$tTitle = Title::newFromText($job->title,
$job->ns);
-
+
$job4Client['job_fullTitle'] =
$tTitle->getFullText();
-
+
//@@todo avoid an api round trip return url
here:
//$job4Client['job_url'] = $file->getFullURL();
-
+
$this->getResult()->addValue( null,
$this->getModuleName(),
array(
'job' => $job4Client
)
);
}
+ }else if ( $this->mParams['jobkey'] ){
+ print "have jobKey: " . $this->mParams['jobkey'] ;
+ //process the upload
+ //check if its a valid job key (job_number _
sh1(job_json) )
+ list($job_id, $json_sha1) = explode( '_',
$this->mParams['jobkey'] );
+ $job = WahJobManager::getJobById( $job_id );
+ if( !$job || sha1($job->job_json) != $json_sha1){
+ //die on bad job key
+ return $this->dieUsage('Your job key is not
valid', 'badjobkey' );
+ }
+ $jobSet = WahJobManager::getJobSetById(
$job->job_set_id );
+ //check if its a valid video ogg file (ffmpeg2theora
--info)
+ $uploadedJobFile = $this->getFileTempname('file');
+ $mediaMeta = wahGetMediaJsonMeta( $uploadedJobFile );
+
+ if( !$mediaMeta ){
+ //failed basic ffmpeg2theora video validation
+ return $this->dieUsage('Not a valid Video
File', 'badfile' );
+ }
+ //check for theora and vorbis streams in the metadata
output of the file:
+ if( class_exists( OggHandler ) ){
+ $isOgg = false;
+
+ if( OggHandler::audioTypes ){
+ $audioTypes = OggHandler::audioTypes;
+ }
+ foreach ( $mediaMeta['video'] as $videoStream )
{
+ if(in_array( ucfirst(
$videoStream->codec ), OggHandler::videoTypes))
+ $isOgg =true;
+ }
+ foreach ( $mediaMeta['audio'] as $audioStream )
{
+ if(in_array( ucfirst(
$audioStream->codec ), OggHandler::audioTypes))
+ $isOgg = true;
+ }
+ if(!$isOgg){
+ return $this->dieUsage('Not a valid Ogg
file', 'badfile' );
+ }
+ }
+ //all good so far put it into the derivative temp
folder by with each piece as it job_id name
+ //@@todo need to rework this a bit for flattening
"sequences"
+ $fTitle = Title::newFromText( $jobSet->set_title,
$jobSet->set_namespace );
+ $file =
RepoGroup::singleton()->getLocalRepo()->newFile( $fTitle );
+ $thumbPath = $file->getThumbPath(
$jobSet->set_encodekey );
+
+ $destTarget = $job_id . '.ogg';
+
+ //copy the current chunk to that path:
+ $status = RepoGroup::singleton()->getLocalRepo()->store(
+ $uploadedJobFile,
+ 'thumb',
+ $destTarget
+ );
+ if( !$status->isGood() ){
+ return $this->dieUsage( 'Could not Copy File');
+ }
+ return $this->dieUsage('copied file to: ' .
$destTarget);
+
+ //update the table with job done time & job user
+
+
+ //check if its the "last" job shell out a join command
+
+ //double check all the files exist.
+
+ //return success
+
}
}
public function getAllowedParams() {
return array(
'file' => null,
- 'job_key' => null,
+ 'jobkey' => null,
'getnewjob' => null,
'jobset' => null,
'token' => null
@@ -81,7 +148,7 @@
public function getParamDescription() {
return array(
'file' => 'the file or data being uploaded for
a given job',
- 'job_key' => 'used to submit the resulting file
of a given job key',
+ 'jobkey' => 'used to submit the resulting file
of a given job key',
'getnewjob' => 'set to ture to get a new job',
'jobset' => 'jobset used with getnewjob to set
jobset prefrence',
'token' => 'the edittoken (needed to submit job
chunks)'

Modified: trunk/extensions/WikiAtHome/NonFreeVideoHandler.php
===================================================================
--- trunk/extensions/WikiAtHome/NonFreeVideoHandler.php 2009-07-31 00:56:50 UTC
(rev 54062)
+++ trunk/extensions/WikiAtHome/NonFreeVideoHandler.php 2009-07-31 00:59:06 UTC
(rev 54063)
@@ -94,15 +94,10 @@
//if we have fffmpeg2theora
if( $wgffmpeg2theora && is_file( $wgffmpeg2theora ) ){

- $cmd = wfEscapeShellArg( $wgffmpeg2theora ) . ' ' .
wfEscapeShellArg ( $path ). ' --info';
- wfProfileIn( 'ffmpeg2theora' );
- wfDebug( __METHOD__.": $cmd\n" );
- $json_meta_str = wfShellExec( $cmd );
- wfProfileOut( 'ffmpeg2theora' );
+ $mediaMeta = wahGetMediaJsonMeta( $path );

- $json_file_meta = json_decode( $json_meta_str );
- if( $json_file_meta ){
- foreach($json_file_meta as $k=>$v){
+ if( $mediaMeta ){
+ foreach($mediaMeta as $k=>$v){
if( !isset( $metadata[ $k ]))
$metadata[ $k ] = $v;
}
@@ -138,8 +133,11 @@
$height = $srcWidth == 0 ? $srcHeight : $width * $srcHeight /
$srcWidth;
//set the width based on the requested width:

+ /*print_r($file);
+ print_r($params);
+ print " dpath: $dstPath, durl: $dstUrl <br>";
+ die();*/

-
//do some arbitrary derivative selection logic:
$encodeKey = $this->getTargetDerivative($width, $srcWidth);
//see if we have that encoding profile already:

Modified: trunk/extensions/WikiAtHome/WahJobManager.php
===================================================================
--- trunk/extensions/WikiAtHome/WahJobManager.php 2009-07-31 00:56:50 UTC
(rev 54062)
+++ trunk/extensions/WikiAtHome/WahJobManager.php 2009-07-31 00:59:06 UTC
(rev 54063)
@@ -16,7 +16,7 @@
$fname = 'WahJobManager::getDonePerc';
//grab the jobset
$dbr = &wfGetDb( DB_READ );
- $res = $dbr->select('wah_jobset',
+ $setRow = $dbr->selectRow('wah_jobset',
'*',
array(
'set_namespace' => $this->sNamespace,
@@ -25,30 +25,38 @@
),
__METHOD__
);
- if( $dbr->numRows( $res ) == 0 ){
+ if( !$setRow ){
//we should setup the job:
$this->doJobSetup();
//return 0 percent done
return 0;
}else{
- $setRow = $dbr->fetchObject( $res );
+ //quick check if we are done at the set level:
+ if( $setRow->set_done_time )
+ return 1;
+
+ //else check how done are we:
$this->sId = $setRow->set_id;
$this->sJobsCount = $setRow->set_jobs_count;
- //get an estimate of how many of the current job are
NULL (not completed)
+ //get an estimate of how many jobs are done (not null)
+ //@@note: estimateRowCount ~might be more appropriate
+ // but it was behaving inconsistently for me~
$doneRes = $dbr->select('wah_jobqueue',
'job_id',
array(
'job_set_id' => $this->sId,
'job_done_time IS NOT NULL'
),
- $fname
+ __METHOD__
);
$doneCount = $dbr->numRows( $doneRes );
- if( $doneCount == $this->sJobsCount )
+ if( $doneCount == $this->sJobsCount ){
+ //update the job_set (should already hae been
done)
return 1;
+ }
//return 1 when doneCount == sJobCount
//(we also set this at a higher level and avoid hitting
the wah_jobqueue table alltogehter)
- return round( $doneCount / $this->sJobsCount , 3);
+ return round( $doneCount / $this->sJobsCount , 2);
}
}
/*
@@ -65,79 +73,64 @@
//its always best to assigning from jobset (since the user
already has the data)
if( $jobset_id ){
//try to get one from the current jobset
- $res = $dbr->select( 'wah_jobqueue',
+ $job = $dbr->selectRow( 'wah_jobqueue',
'*',
array(
'job_set_id' => intval( $jobset_id ),
'job_done_time IS NULL',
'job_last_assigned_time < '.
$dbr->addQuotes( time() - $wgJobTimeOut )
),
- __METHOD__,
- array(
- 'LIMIT'=>1
- )
+ __METHOD__
);
- if( $dbr->numRows( $res ) != 0){
- $job = $dbr->fetchObject( $res );
+ if( $job ){
return WahJobManager::assignJob( $job );
}
}
-
+
//check if we already have a job given but never completed:
- $res = $dbr->select( 'wah_jobqueue',
+ $job = $dbr->selectRow( 'wah_jobqueue',
'*',
array(
'job_last_assigned_user_id' => $wgUser->getId()
),
- __METHOD__,
- array(
- 'LIMIT'=>1
- )
+ __METHOD__
);
- //re-assing the same job (don't update
- if( $dbr->numRows( $res ) != 0){
- $job = $dbr->fetchObject( $res );
- return WahJobManager::assignJob( $job , false, false);
+
+ //re-assign the same job (don't update anything so it can
timeout if they keep getting the same job)
+ if( $job ){
+ return WahJobManager::assignJob( $job , false, false);
}
-
+
//just do a normal select from jobset
- $setRes = $dbr->select( 'wah_jobset',
+ $jobSet = $dbr->selectRow( 'wah_jobset',
'*',
array(
'set_done_time IS NULL',
'set_client_count < '. $dbr->addQuotes(
$wgNumberOfClientsPerJobSet )
),
- __METHOD__,
- array(
- 'LIMIT' => 1
- )
+ __METHOD__
);
- if( $dbr->numRows( $setRes ) == 0){
- //no jobs:
+ if( $jobSet ){
+ //no jobs:
return false;
}else{
//get a job from the jobset and increment the
set_client_count
//(if the user has an unfinished job) re assign it (in
cases where job is lost in trasport)
- $jobSet = $dbr->fetchObject( $setRes );
//get a job from the selected jobset:
- $jobRes = $dbr->select('wah_jobqueue', '*',
+ $job = $dbr->selectRow('wah_jobqueue', '*',
array(
'job_set_id' => $jobSet->set_id,
'job_done_time IS NULL',
- 'job_last_assigned_time IS NULL
OR job_last_assigned_time < ' .
- $dbr->addQuotes(
time() - $wgJobTimeOut )
+ 'job_last_assigned_time IS NULL
OR job_last_assigned_time < ' .
+ $dbr->addQuotes(
time() - $wgJobTimeOut )
),
- __METHOD__,
- array(
- 'LIMIT' => 1
- )
+ __METHOD__
);
- if( $dbr->numRows( $jobRes ) == 0){

+ if( !$job ){
//no jobs in this jobset (return nojob)
//@@todo we could "retry" since we will get
here when a set has everything assigned in less than $wgJobTimeOut
return false;
}else{
- $job = $dbr->fetchObject( $jobRes );
return WahJobManager::assignJob( $job ,
$jobSet);
}
}
@@ -154,12 +147,12 @@
$dbr = wfGetDb( DB_READ );
$dbw = wfGetDb( DB_WRITE );
if( $jobSet == false ){
- $jobSet = self::getJobSetBySetId( $job->job_set_id );
+ $jobSet = self::getJobSetById( $job->job_set_id );
}
//set the title and namespace:
$job->title = $jobSet->set_title;
$job->ns = $jobSet->set_namespace;
-
+
//check if we should update the tables for the assigned Job
if( $doUpdate ){
//for jobqueue update: job_last_assigned_time,
job_last_assigned_user_id, job_assign_count
@@ -196,19 +189,23 @@
}
return $job;
}
- static function getJobSetBySetId( $set_id ){
+ static function getJobSetById( $set_id ){
$dbr = wfGetDb( DB_READ );
- $setRes = $dbr->select('wah_jobset', '*',
+ return $dbr->selectRow('wah_jobset', '*',
array(
'set_id' => $set_id
),
- __METHOD__,
+ __METHOD__
+ );
+ }
+ static function getJobById( $job_id ){
+ $dbr = wfGetDb( DB_READ );
+ return $dbr->selectRow('wah_jobset', '*',
array(
- 'LIMIT' => 1
- )
+ 'job_id' => $set_id
+ ),
+ __METHOD__
);
- $jobSet = $dbr->fetchObject( $setRes );
- return $jobSet;
}
/*
* setups up a new job
@@ -243,7 +240,7 @@
$encSettingsAry['endtime'] =
$encSettingsAry['starttime'] + $wgChunkDuration;

$jobJsonAry = array(
- 'jobType' => 'transcode',

+ 'jobType' => 'transcode',
'chunkNumber' => $i,
'encodeSettings'=> $encSettingsAry
);
@@ -251,7 +248,7 @@
//add starttime and endtime
$jobInsertArray[] =
array(
- 'job_set_id' => $this->sId,

+ 'job_set_id' => $this->sId,
'job_json' =>
ApiFormatJson::getJsonEncode( $jobJsonAry )
);
}

Modified: trunk/extensions/WikiAtHome/WikiAtHome.js
===================================================================
--- trunk/extensions/WikiAtHome/WikiAtHome.js 2009-07-31 00:56:50 UTC (rev
54062)
+++ trunk/extensions/WikiAtHome/WikiAtHome.js 2009-07-31 00:59:06 UTC (rev
54063)
@@ -2,19 +2,30 @@

//load msgs:
loadGM({
- 'wah-menu-jobs' : "Jobs",
- 'wah-menu-stats': "Stats",
- 'wah-menu-pref' : "Prefrences",
- 'wah-loading' : 'loading wiki@home interface <blink>...</blink>',
+ "wah-menu-jobs" : "Jobs",
+ "wah-menu-stats": "Stats",
+ "wah-menu-pref" : "Prefrences",
+ "wah-loading" : "loading Wiki@Home interface <blink>...</blink>",

- 'wah-lookingforjob' : "Looking For a Job <blink>...</blink>",
- 'wah-nojobfound' : "No Job Found, Will retry in $1 seconds",
- 'wah-notoken-login' : "Could not get a token. Are you logged in?",
+ "wah-lookingforjob" : "Looking For a Job <blink>...</blink>",

- 'wah-doing-job' : "Job: <i>$1</i> on: <i>$2</i>",
- 'wah-downloading' : "Downloading File <i>$1%</i> done",
- 'wah-needs-firefogg': "To particate in wiki@home you need to install
firefogg."
+ "wah-start-on-visit": "Start up Wiki@Home anytime I visit this site",
+ "wah-jobs-while-away": "Only run jobs when I have been away from my
browser for 20 minnutes",

+ "wah-nojobfound" : "No Job Found, Will retry in $1 seconds",
+
+ "wah-notoken-login" : "Could not get a token. Are you logged in?",
+ "wah-apioff" : "The api appears to be off. Please Contact
your Wiki Admin",
+
+ "wah-doing-job" : "Job: <i>$1</i> on: <i>$2</i>",
+ "wah-downloading" : "Downloading File <i>$1%</i> done",
+ "wah-encoding" : "Encoding File <i>$1%</i> done",
+ "wah-uploading" : "Uploading File <i>$i</i> done",
+ "wah-uploadfail" : "Uploading Failed",
+ "wah-doneuploading" : "Done Uploading. Thanks for your Contribution.",
+
+ "wah-needs-firefogg": "To particate in wiki@home you need to install
firefogg."
+
});


@@ -54,6 +65,11 @@
for(var i in wahConfig){
_this[i] = wahConfig[i];
}
+ //make sure api is "on"
+ if( !wgEnableAPI ){
+ $j( _this.wah_container ).html( gM('wah-apioff') );
+ return false;
+ }

//fist see if we are even logged in:
if( !wgUserName ){
@@ -100,14 +116,30 @@
select: function(event, ui) {

//_this.selectTab(
$j(ui.tab).attr('id').replace('rsd_tab_', '') );
}
- }).find(".ui-tabs-nav").sortable({axis:'x'});
-
+ }).find(".ui-tabs-nav").sortable({axis:'x'});
+
+ //set pref initial layout
+ $j('#tab-pref').html(
+ '<h2>' + gM('wah-menu-pref') + '</h2>' +
+ '<i>These prefrences are not yet active</i>' +
+ '<ul>' +
+ '<li><input type="checkbox">' +
gM('wah-start-on-visit') + '</li>' +
+ '<li><input type="checkbox">' +
gM('wah-jobs-while-away') + '</li>' +
+ '</ul>'
+ );
+
+ //set the initail stats layout
+ $j('#tab-stats').html(
+ '<h2>Some Cool Visual Stats Go here!</h2>'
+ )
+
//set tabs to initial layout
$j('#tab-jobs').html(
'<h2 class="wah-gen-status"></h2>' +
- '<div class="progress-bar"
style="width:400px;heigh:20px;"></div>' +
- '<div class="prograss-status"
style="width:400px;heigh:20px;"></div>'
+ '<div class="progress-bar"
style="width:400px;height:20px;"></div>' +
+ '<div class="prograss-status" ></div>'
);
+
//make sure we have firefogg
//check if we have firefogg installed (needed for
transcoding jobs)
this.myFogg = new mvFirefogg({
@@ -115,7 +147,9 @@
});

if(!this.myFogg.firefoggCheck() ){
- $j('#tab-jobs .progress-bar').hide().after(
gM('wah-needs-firefogg') );
+ $j('#tab-jobs .progress-bar').hide().after(
+ gM('wah-needs-firefogg')
+ );

//if we don't have 3.5 firefox update link:
if(!($j.browser.mozilla && $j.browser.version >=
'1.9.1')) {
@@ -130,19 +164,24 @@
}
return false;
}
+ //set up local fogg pointer:
+ this.fogg = this.myFogg.fogg;
return true;
},
- lookForJob: function(){
+ lookForJob: function( job_set_id ){
var _this = this;
//set the big status
$j('#tab-jobs .wah-gen-status').html( gM('wah-lookingforjob')
);
-
+ var reqObj = {
+ 'action' : 'wikiathome',
+ 'getnewjob' : true,
+ 'token' : _this.eToken
+ };
+ if( job_set_id ){
+ reqObj['jobset'] = job_set_id;
+ }
do_api_req({
- 'data':{
- 'action' : 'wikiathome',
- 'getnewjob' : true,
- 'token' : _this.eToken
- }
+ 'data' : reqObj
},function(data){
//if we have a job update status to proccessing
if( data.wikiathome.nojobs ){
@@ -153,6 +192,7 @@
}
});
},
+
delayLookForJob:function(){
var _this = this;
var i=0;
@@ -160,12 +200,14 @@
i++;
if(i == _this.jobsearch_delay){
_this.lookForJob();
+ return false;
}else{
//update the delay msg:
- $j('#tab-jobs .wah-gen-status').html( gM(
'wah-nojobfound', seconds2npt(i)) );
+ $j('#tab-jobs .wah-gen-status').html( gM(
'wah-nojobfound', seconds2npt( _this.jobsearch_delay - i )) );
}
+ setTimeout(delayJobUpdate, 1000);
}
- setTimeout(delayJobUpdate, 1000)
+ setTimeout(delayJobUpdate, 1000);
},
doProccessJob:function( job ){
var _this = this;
@@ -177,6 +219,9 @@
$j('#tab-jobs .progress-bar').progressbar({
value: 0
});
+ //set the jobKey:
+ _this.jobKey = job.job_key;
+
//start proccessing the work flow based on work type
if( job.job_json.jobType == 'transcode' ){
//download the source footage
@@ -196,26 +241,94 @@
},function(data){
for(var i in data.query.pages){
_this.source_url =
data.query.pages[i].imageinfo[0].url;
- }
+ }
//have firefogg download the file:
- _this.myFogg.selectVideoUrl( _this.source_url );
+ js_log("do selectVideoUrl:: " + _this.source_url);
+ _this.fogg.selectVideoUrl( _this.source_url );
//check firefogg state and update status:
- var updateDownoadState = function(){

- if( _this.myFogg.state == 'downloading'){
- var percDone =
_this.myFogg.downloadVideo.progress * 100;
- $j('#tab-jobs
.progress-bar').progressbar({
- value: percDone
- });
+ var updateDownloadState = function(){

+ if( _this.fogg.state == 'downloading'){
+ //update progress
+
_this.updateProgress(_this.fogg.progress(), 'wah-downloading');
+ //loop update:

+ setTimeout(updateDownloadState, 100);
+ }else if( _this.fogg.state == 'downloaded'){
+ js_log('downloaded is done, run
encode');
+ //we can now issue the encode
call
+ _this.fogg.encode(
+ JSON.stringify(
+
job.job_json.encodeSettings
+ )
+ );
+ updateEncodeState();

+ }else if( _this.fogg.state == "download
failed"){
+ js_log('download state failed');
+ }

+ }
+ //do the initial call to downloading state updates
+ if( _this.fogg.state == 'downloading'){
+ setTimeout(updateDownloadState, 100);
+ }
+
+ //our encode state update
+ var updateEncodeState = function(){

+ _this.updateProgress( _this.fogg.progress(),
'wah-encoding');
+ if( _this.fogg.state == 'encoding done' ){
+ js_log('encoding done , do upload');
+ _this.fogg.post( mwGetLocalApiUrl(),
+ 'file',
+ JSON.stringify({
+ 'action' :
'wikiathome',
+ 'token' :
_this.eToken,
+ 'jobkey' :
_this.jobKey
+ })
+ );
+ //do upload req
+ updateUploadState();
+ return true;
+ }
+ setTimeout(updateEncodeState, 100);

+ }
+ //our updateUploadState update
+ var updateUploadState = function(){

+ _this.updateProgress( _this.fogg.progress(),
'wah-uploading');
+ if( _this.fogg.state == 'upload done'){
+ //done uploading
+ //congradulate the user and issue new
job request
$j('#tab-jobs .prograss-status').html(
- gM('wah-downloading',percDone)
+ gM( 'wah-doneuploading' )
);
+ var getNextTranscodeJob = function(){

+ _this.lookForJob(
job.job_set_id );
+ }
+ //display the msg for 3 seconds
+ //setTimeout(getNextTranscodeJob, 3000);
+
+ return true;

+ }else if( _this.fogg.state == 'uplaod failed'){
+ $j('#tab-jobs .prograss-status').html(
+ gM( 'wah-uploadfail' )
+ );
}
- }
- setTimeout(updateDownoadState, 100);
+ setTimeout(updateUploadState, 100);
+ }
});


//for transcode jobs we have to download (unless we already
have the file)

+ },
+ updateProgress: function(perc, msgKey){
+ //get percent done with 2 decimals
+ var percDone = Math.round(perc * 10000) /100;
+ //update progress bar
+ $j('#tab-jobs .progress-bar').progressbar(
+ 'value',
+ Math.round( percDone )
+ );
+ //update status
+ $j('#tab-jobs .prograss-status').html(
+ gM(msgKey, percDone)
+ );
}
}
\ No newline at end of file

Modified: trunk/extensions/WikiAtHome/WikiAtHome.php
===================================================================
--- trunk/extensions/WikiAtHome/WikiAtHome.php 2009-07-31 00:56:50 UTC (rev
54062)
+++ trunk/extensions/WikiAtHome/WikiAtHome.php 2009-07-31 00:59:06 UTC (rev
54063)
@@ -56,6 +56,26 @@
const ENC_HQ_STREAM = 'high_quality';
}

+//GLOBAL FUNCTIONS:
+
+/*
+ * gets the json metadata from a given file (also validates it as a valid file)
+ */
+function wahGetMediaJsonMeta( $path ){
+ $cmd = wfEscapeShellArg( $wgffmpeg2theora ) . ' ' . wfEscapeShellArg (
$path ). ' --info';
+ wfProfileIn( 'ffmpeg2theora shellExec' );
+ wfDebug( __METHOD__.": $cmd\n" );
+ $json_meta_str = wfShellExec( $cmd );
+ wfProfileOut( 'ffmpeg2theora shellExec' );
+ $objMeta = json_decode( $json_meta_str );
+
+ //if we return the same string then json_decode has failed in php <
5.2.6
+ //workaround for bug http://bugs.php.net/bug.php?id=45989
+ if( $objMeta == $json_meta_str )
+ return false;
+ return $objMeta;
+}
+
/******************* CONFIGURATION STARTS HERE **********************/

//ffmpeg2theora path: enables us to get basic source file information

Modified: trunk/extensions/WikiAtHome/WikiAtHome.sql
===================================================================
--- trunk/extensions/WikiAtHome/WikiAtHome.sql 2009-07-31 00:56:50 UTC (rev
54062)
+++ trunk/extensions/WikiAtHome/WikiAtHome.sql 2009-07-31 00:59:06 UTC (rev
54063)
@@ -1,9 +1,7 @@
-
--
-- Table structure for table `wah_jobqueue`
--

-DROP TABLE IF EXISTS `wah_jobqueue`;
CREATE TABLE IF NOT EXISTS `wah_jobqueue` (
`job_id` int(12) unsigned NOT NULL auto_increment,
`job_set_id` int(12) unsigned NOT NULL,
@@ -14,8 +12,9 @@
`job_assign_count` int(4) unsigned NOT NULL default '0',
`job_json` blob NOT NULL,
PRIMARY KEY (`job_id`),
- KEY `job_set_id` (`job_set_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
+ KEY `job_set_id` (`job_set_id`),
+ KEY `job_last_assigned_user_id` (`job_last_assigned_user_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

@@ -23,18 +22,17 @@
-- Table structure for table `wah_jobset`
--

-DROP TABLE IF EXISTS `wah_jobset`;
CREATE TABLE IF NOT EXISTS `wah_jobset` (
`set_id` int(10) unsigned NOT NULL auto_increment,
`set_namespace` int(11) default NULL,
`set_title` varchar(255) default NULL,
`set_jobs_count` int(11) unsigned NOT NULL,
`set_encodekey` varchar(40) default NULL,
- `job_creation_time` int(14) NOT NULL,
+ `set_creation_time` int(14) NOT NULL,
`set_done_time` int(14) default NULL,
`set_client_count` int(5) NOT NULL default '0',
PRIMARY KEY (`set_id`),
KEY `set_namespace` (`set_namespace`,`set_title`),
KEY `set_done_time` (`set_done_time`),
KEY `set_client_count` (`set_client_count`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@xxxxxxxxxxxxxxxxxxx
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise