Class 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.QuickInfoSupporter
    Ancestor for FFmpeg plugins.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.core.io.PlaceholderFile m_Input
      the input file.
      protected FFmpeg m_Owner
      the owning actor.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract String assembleInputOptions()
      Assembles the input command-line options.
      protected abstract String assembleOutputOptions()
      Assembles the ouput command-line options.
      String execute()
      Performs the ffmpeg execution.
      protected adams.core.io.PlaceholderFile getExecutable()
      Returns the ffmpeg executable.
      adams.core.io.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 setInput​(adams.core.io.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, 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
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Owner

        protected FFmpeg m_Owner
        the owning actor.
      • m_Input

        protected adams.core.io.PlaceholderFile m_Input
        the input file.
    • Constructor Detail

      • AbstractFFmpegPlugin

        public AbstractFFmpegPlugin()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.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:
        getQuickInfo in interface adams.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 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