You are here

function video_scheduler_select in Video 6.3

Same name and namespace in other branches
  1. 5 plugins/video_ffmpeg_helper/video_scheduler.php \video_scheduler_select()
  2. 6 plugins/video_ffmpeg_helper/video_scheduler.php \video_scheduler_select()
  3. 6.2 plugins/video_ffmpeg_helper/video_scheduler.php \video_scheduler_select()

Select VIDEO_RENDERING_FFMPEG_INSTANCES jobs from the queue

Return value

an array containing jobs

1 call to video_scheduler_select()
video_scheduler_main in ./video_scheduler.php
Main for video_scheduler.php

File

./video_scheduler.php, line 99
Implement video rendering scheduling. If you are not using sites/default/settings.php as your settings file, add an optional parameter for the drupal site url: "php video_scheduler.php http://example.com/" or "php video_scheduler.php…

Code

function video_scheduler_select() {

  // load node and its file object
  module_load_include('inc', 'uploadfield', '/uploadfield_convert');
  $jobs = array();
  $i = 0;
  $result = db_query_range('SELECT f.fid, f.filepath, f.filesize, f.filename, f.filemime, f.status FROM {video_rendering} vr INNER JOIN {files}
      f ON vr.fid = f.fid WHERE vr.fid = f.fid AND vr.status = %d AND f.status = %d AND vr.transcoder IN ("ffmpeg_wrapper", "ffmpeg") ORDER BY f.timestamp', VIDEO_RENDERING_PENDING, FILE_STATUS_PERMANENT, 0, VIDEO_RENDERING_FFMPEG_INSTANCES);
  while ($job = db_fetch_object($result)) {
    $jobs[] = $job;
  }

  //  print_r($jobs);
  //  exit;
  return $jobs;
}