adams.flow.sink.ffmpeg
Class AbstractFFmpegPlugin

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.sink.ffmpeg.AbstractFFmpegPlugin
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable
Direct Known Subclasses:
AbstractFFmpegPluginWithOptions, GenericPlugin

public abstract class AbstractFFmpegPlugin
extends AbstractOptionHandler

Ancestor for FFmpeg plugins.

Version:
$Revision: 6327 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  String m_AdditionalInputOptions
          additional input options to use for ffmpeg.
protected  String m_AdditionalOutputOptions
          additional output options to use for ffmpeg.
protected  int m_BitRate
          the bitrate in kbits to use.
protected  int m_FramesPerSecond
          the frames per second to use.
protected  PlaceholderFile m_Input
          the input file.
protected  FFmpeg m_Owner
          the owning actor.
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractFFmpegPlugin()
           
 
Method Summary
protected abstract  String assembleInputOptions()
          Assembles the input command-line options.
protected abstract  String assembleOutputOptions()
          Assembles the ouput command-line options.
 String bitRateTipText()
          Returns the tip text for this property.
 void defineOptions()
          Adds options to the internal list of options.
 String execute()
          Performs the ffmpeg execution.
 String framesPerSecondTipText()
          Returns the tip text for this property.
 int getBitRate()
          Returns the bit rate in kbits to use.
protected  PlaceholderFile getExecutable()
          Returns the ffmpeg executable.
 int getFramesPerSecond()
          Returns the frames per second to use.
 PlaceholderFile getInput()
          Returns the input file.
 FFmpeg getOwner()
          Sets the owner.
 String getQuickInfo()
          Returns a quick info about the plugin, which will be displayed in the GUI.
protected  String handleException(String msg, Throwable t)
          Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.
protected  void initialize()
          Initializes the members.
protected  void reset()
          Resets the scheme.
 void setBitRate(int value)
          Sets the bit rate in kbits to use.
 void setFramesPerSecond(int value)
          Sets the frames per second to use.
 void setInput(PlaceholderFile value)
          Sets the input file.
 void setOwner(FFmpeg owner)
          Sets the owner.
 String setUp()
          Checks the configuration.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Owner

protected FFmpeg m_Owner
the owning actor.


m_Input

protected PlaceholderFile m_Input
the input file.


m_BitRate

protected int m_BitRate
the bitrate in kbits to use.


m_FramesPerSecond

protected int m_FramesPerSecond
the frames per second to use.


m_AdditionalInputOptions

protected String m_AdditionalInputOptions
additional input options to use for ffmpeg.


m_AdditionalOutputOptions

protected String m_AdditionalOutputOptions
additional output options to use for ffmpeg.

Constructor Detail

AbstractFFmpegPlugin

public AbstractFFmpegPlugin()
Method Detail

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractOptionHandler

initialize

protected void initialize()
Initializes the members.

Overrides:
initialize in class AbstractOptionHandler

reset

protected void reset()
Resets the scheme.

Overrides:
reset in class AbstractOptionHandler

setOwner

public void setOwner(FFmpeg owner)
Sets the owner.

Parameters:
owner - the owner

getOwner

public FFmpeg getOwner()
Sets the owner.


getQuickInfo

public String getQuickInfo()
Returns a quick info about the plugin, which will be displayed in the GUI.

Returns:
null if no info available, otherwise short string

setFramesPerSecond

public void setFramesPerSecond(int value)
Sets the frames per second to use.

Parameters:
value - the fps

getFramesPerSecond

public int getFramesPerSecond()
Returns the frames per second to use.

Returns:
the options

framesPerSecondTipText

public String framesPerSecondTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setBitRate

public void setBitRate(int value)
Sets the bit rate in kbits to use.

Parameters:
value - the bit rate

getBitRate

public int getBitRate()
Returns the bit rate in kbits to use.

Returns:
the bit rate

bitRateTipText

public String bitRateTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setInput

public void setInput(PlaceholderFile value)
Sets the input file.

Parameters:
value - the input file

getInput

public PlaceholderFile getInput()
Returns the input file.

Returns:
the input file, null if none set

getExecutable

protected PlaceholderFile getExecutable()
Returns the ffmpeg executable.

Returns:
the executable, null if not available or no owner set

setUp

public String setUp()
Checks the configuration.

Default implementation only checks whether owner is set.

Returns:
null if setup ok, otherwise error message
See Also:
getOwner()

handleException

protected String handleException(String msg,
                                 Throwable t)
Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.

Parameters:
msg - the message for the exception
t - the exception
Returns:
the full error message (message + stacktrace)

assembleInputOptions

protected abstract String assembleInputOptions()
Assembles the input command-line options.

Returns:
the command-line

assembleOutputOptions

protected abstract String assembleOutputOptions()
Assembles the ouput command-line options.

Returns:
the command-line

execute

public String execute()
Performs the ffmpeg execution.

Returns:
null if successful, otherwise error message


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.