$controller
$controller : object
If MediaJob was instantiated in the web app, the controller that instatiated it
Media Job used to convert videos uploaded to the wiki or group feeds to a common format (mp4)
Subclasses should implement methods they use among init(), checkPrerequisites(), nondistributedTasks(), prepareTasks(), finishTasks(), getTasks(), doTasks(), and putTask(). MediaUpdating can be configured to run in either distributed or nameserver only mode. In the former mode, prepareTasks(), finishTasks() run on the name server, getTasks() and putTask() run in the name server's web app, and doTasks() run on any MediaUpdater clients. In the latter mode, only the method nondistributedTasks() is called by the MediaUpdater and by only the updater on the name server.
__construct(object $media_updater = null, object $controller = null)
Instiates the MediaJob with a reference to the object that instatiated it
object | $media_updater | a reference to the media updater that instatiated this object (if being run in MediaUpdater) |
object | $controller | a reference to the controller that instantiated this object (if being run in the web app) |
doTasks(array $tasks) : mixed
Called from run() with conversion tasks from name server. If there are any mov or avi segmentconverts them mp4 This function would only be called by client media updaters.
array | $tasks | data that the MediaJob running on a client MediaUpdater needs to process |
the result of carrying out that processing
getTasks(integer $machine_id, array $data = null) : array
Handles the request to get the video file from the video directory for conversion. This selection is based upon if the file was taken previously or not. If it was then its timestamp is checked.
Otherwise new file is sent for conversion along with its folder name.
integer | $machine_id | not used |
array | $data | not used |
an associate array with info on a file to convert
putTasks(integer $machine_id, array $data) : string
Handles request to upload the posted data (video file data) in correct location as per the request attributes such as folder name and file name.
integer | $machine_id | id of client that is sending data to name server |
array | $data | results of computation done by client |
message concerning success or non-success of upload
execNameServer(string $command, string $args = null) : array
Executes a method on the name server's JobController.
It will typically execute either getTask or putTask for a specific Mediajob or getUpdateProperties to find out the current MediaUpdater should be configured.
string | $command | the method to invoke on the name server |
string | $args | additional arguments to be passed to the name server |
data returned by the name server.
mergeVideo( $text_file_name, string $file_name, string $destination_directory)
Concatenates split video files to generate one video file
$text_file_name | ||
string | $file_name | name of video file to be given to output file. |
string | $destination_directory | destination directory name where concatenated file would be produced |