/[drupal]/contributions/modules/video/plugins/video_ffmpeg_helper/video_scheduler.php
ViewVC logotype

Diff of /contributions/modules/video/plugins/video_ffmpeg_helper/video_scheduler.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5.2.1, Wed May 27 01:48:28 2009 UTC revision 1.5.2.2, Mon Jun 1 01:10:32 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  //$Id$  //$Id: video_scheduler.php,v 1.5.2.1 2009/05/27 01:48:28 heshanmw Exp $
3  /**  /**
4   * @file   * @file
5   * Implement video rendering scheduling.   * Implement video rendering scheduling.
# Line 20  Line 20 
20  */  */
21    
22  // set to the ffmpeg executable  // set to the ffmpeg executable
23  define('VIDEO_RENDERING_FFMPEG_PATH', '/usr/bin/ffmpeg');  define('VIDEO_RENDERING_FFMPEG_PATH', '/home2/heidisof/bin/./ffmpeg');
24    
25  // set to the temp file path.  // set to the temp file path.
26  //IMPORTANT: the user who runs this script must have permissions to create files there. If this is not the case the default php temporary folder will be used.  //IMPORTANT: the user who runs this script must have permissions to create files there. If this is not the case the default php temporary folder will be used.
# Line 48  if (isset($_SERVER['argv'][1])) { Line 48  if (isset($_SERVER['argv'][1])) {
48    $_SERVER['HTTP_HOST'] = $url['host'];    $_SERVER['HTTP_HOST'] = $url['host'];
49  }  }
50    
51  module_load_include('/includes/bootstrap.inc', 'video_scheduler', 'includes/bootstrap');  include_once('./includes/bootstrap.inc');
52    //module_load_include('/includes/bootstrap.inc', 'video_scheduler', 'includes/bootstrap');
53  // disable error reporting for bootstrap process  // disable error reporting for bootstrap process
54  error_reporting(E_ERROR);  error_reporting(E_ERROR);
55  // let's bootstrap: we will be able to use drupal apis  // let's bootstrap: we will be able to use drupal apis
# Line 107  function video_scheduler_select() { Line 108  function video_scheduler_select() {
108    // TODO: use db_query_range    // TODO: use db_query_range
109    $jobs = array();    $jobs = array();
110    $i = 0;    $i = 0;
111    $count = db_num_rows($result);    $count = db_result(db_query('SELECT COUNT(*) FROM {video_rendering} vr INNER JOIN {node} n ON vr.vid = n.vid INNER JOIN {video} v ON n.vid = v.vid WHERE n.nid = v.nid AND vr.nid = n.nid AND vr.status = %d ORDER BY n.created', VIDEO_RENDERING_PENDING));
112    while($i < $count && $i < VIDEO_RENDERING_FFMPEG_INSTANCES) {    while($i < $count && $i < VIDEO_RENDERING_FFMPEG_INSTANCES) {
113      $jobs[] = db_fetch_object($result);      $jobs[] = db_fetch_object($result);
114      $i++;      $i++;
115    }    }
116    //print_r($jobs);
117    return $jobs;    return $jobs;
118  }  }
119    

Legend:
Removed from v.1.5.2.1  
changed lines
  Added in v.1.5.2.2

  ViewVC Help
Powered by ViewVC 1.1.2