Package adams.flow.sink.ffmpeg
Class AbstractFFmpegPlugin
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.sink.ffmpeg.AbstractFFmpegPlugin
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.SizeOfHandler,Serializable
- Direct Known Subclasses:
AbstractFFmpegPluginWithOptions,GenericPlugin
public abstract class AbstractFFmpegPlugin extends adams.core.option.AbstractOptionHandler implements adams.core.QuickInfoSupporterAncestor forFFmpegplugins.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractFFmpegPlugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringassembleInputOptions()Assembles the input command-line options.protected abstract StringassembleOutputOptions()Assembles the ouput command-line options.Stringexecute()Performs the ffmpeg execution.protected adams.core.io.PlaceholderFilegetExecutable()Returns the ffmpeg executable.adams.core.io.PlaceholderFilegetInput()Returns the input file.FFmpeggetOwner()Sets the owner.StringgetQuickInfo()Returns a quick info about the plugin, which will be displayed in the GUI.protected StringhandleException(String msg, Throwable t)Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.protected voidinitialize()Initializes the members.protected voidreset()Resets the scheme.voidsetInput(adams.core.io.PlaceholderFile value)Sets the input file.voidsetOwner(FFmpeg owner)Sets the owner.StringsetUp()Checks the configuration.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Owner
protected FFmpeg m_Owner
the owning actor.
-
m_Input
protected adams.core.io.PlaceholderFile m_Input
the input file.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classadams.core.option.AbstractOptionHandler
-
setOwner
public void setOwner(FFmpeg owner)
Sets the owner.- Parameters:
owner- the owner
-
getOwner
public FFmpeg getOwner()
Sets the owner.- Returns:
- the owner
-
setInput
public void setInput(adams.core.io.PlaceholderFile value)
Sets the input file.- Parameters:
value- the input file
-
getInput
public adams.core.io.PlaceholderFile getInput()
Returns the input file.- Returns:
- the input file, null if none set
-
getExecutable
protected adams.core.io.PlaceholderFile getExecutable()
Returns the ffmpeg executable.- Returns:
- the executable, null if not available or no owner set
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the plugin, which will be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
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 exceptiont- 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
-
-