Get VdrAssistant at SourceForge.net. Fast, secure and Free Open Source software downloads

an Assistent not limited to conversion of VDR-recordings to DVD-images

build your own process definition

Overview

The Job-processor is designed to convert VDR-recordings to i.e. a DVD image. This conversion process can be selected by the Job-Manager. Default is to covert a recording into a DVD image, that can be burned on a DVD. The default processing library is SRDVDConversion.jar.

the cook-master

For an easy entry, just clone the directory SRDVDConversion to a directory of your choice and edit srbuild.xml to change the project name. srbuild.xml from the parent directory should be extended to get an entry for your freshly created library. Look for "filelist" with the id "prj.process" and add a new line for your directory.
Clone i.e. line 31 and change SRDVDConversion to the name of your freshly created directory.

Calling ant -f srbuild.xml in the VDRAssistant-directory you build all libraries - including your new library. After ant has terminated its job, you'll find your library in xdist/ext.

Look at the jars Manifest file. There you'll find an entry "Implementation-Type" with the value "ConversionProcess". That is important, cause VDRAssistant applications check the type of the Jar-files before using them.

If you're interested in the process of identifiing and loading a library, take a look at DefaultProcessFactory.

process definition

The internals are quite simple. We take a sample process, that talks about every step it performs - - an EchoProcess.

At first step, we need to extend the baseclass AbstractProcess:

public class EchoProcess extends AbstractProcess {
   public EchoProcess(Job job, String workDir, WorkerConfig config, boolean burnOnTheFlow) {
      super("myid", job, workDir, config, burnOnTheFlow);
   }
}
The constructor takes 4 parameters:
  • Job - the job-information from the database, telling what should be converted
  • String - the directory, where to put the working copies
  • WorkerConfig - the instance containing the Job-processors configuration
  • boolean - tells whether a disk should be burned right after processing
The first parameter at calling the parents constructor is an id to identify the conversion process. This id is an alias for your conversion. The Job-manager will use it at editing the job properties and the Job-processor uses it to select your conversion.

Heart of the conversion is the method protected List buildProcess(boolean burnOnTheFlow);, that returns your process definition.

A prozess definition is a list of at least one conversion step, the ProcessSteps. The default processing of VDRAssistant, which converts a VDR-recording into a DVD-image consists of these steps:

  • DemuxStep - divide the recording into separate streams
  • RequantStep - compress some of the streams
  • MuxStep - combine the desired streams into a new single file
  • AuthorStep - create the DVD-menue and master the DVD-image
  • ISOStep - build an ISO-file from the DVD-master directory
  • BurnStep - burn the image to disk

Steps

a process step is a class extending AbstractProcessStep

public class EchoStep extends AbstractProcessStep {
   public EchoStep(Job job, String workRoot, WorkerConfig config, PrintWriter logFile) {
      super(job, workRoot, config, logFile);
   }
}
The constructor takes 4 parameters again:
  • Job - the job-information from the database, telling what should be converted
  • String - the directory, where to put the working copies
  • WorkerConfig - the instance containing the Job-processors configuration
  • PrintWriter - the message writer to inform the user (administrator) about what has been done

storyboard

  • The game starts with a call to public boolean checkOutput() on every defined conversionstep, which determines, which conversionstep already has been executed successfully - to avoid double processing.
  • The fist converstionstep, that has no output, will be called with public boolean checkInput(). This method checks, whether all needed information or files are found to start the processing. If this call fails, the whole processing (the job) will be marked as failed and the processing will aborted.
  • If the input check passes, the processing of the step will be started by a call to public final void process(). That call from AbstractProcessStep divides the processing into 3 steps, that each conversion step has to implement:
    1. Step: prepare()
    2. Step: workOut()
    3. Step: cleanup()
  • After the processing, public boolean checkOutput() will be called again to check the result of the processing. Only if this call passes all checks, the processing will continue with the next conversion step.




 
change to english nach Deutsch wechseln