Class FixedIntervalBufferedImageSampler

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.Stoppable, Serializable

    public class FixedIntervalBufferedImageSampler
    extends AbstractBufferedImageMovieImageSampler
    Generates a specified number of image samples at fixed intervals.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -offset <adams.core.base.BaseTimeMsec> (property: offset)
        The offset for the samples, i.e., before starting the sampling.
        default: -INF
     
    -interval <int> (property: interval)
        The interval in milli-seconds between samples.
        default: 1000
        minimum: 1
     
    -num-samples <int> (property: numSamples)
        The number of samples to take.
        default: 10
        minimum: 1
     
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int m_Interval
      the interval in msec between the .
      protected long m_LastPtsWrite
      the last frame write.
      protected com.xuggle.mediatool.MediaListenerAdapter m_Listener
      the listener to use.
      protected long m_MicroSecondsBetweenFrames
      the interval for the frames.
      protected int m_NumSamples
      the number of samples to generate.
      protected adams.core.base.BaseTimeMsec m_Offset
      the offset.
      protected com.xuggle.mediatool.IMediaReader m_Reader
      the reader to use.
      protected List<adams.data.image.BufferedImageContainer> m_Samples
      the samples.
      protected int m_VideoStreamIndex
      The video stream index, used to ensure we display frames from one and only one video stream from the media container.
      • 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 Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      protected adams.data.image.BufferedImageContainer[] doSample​(File file)
      Samples images from a movie file.
      int getInterval()
      Returns the interval between samples in milli-seconds.
      int getNumSamples()
      Returns the number of samples to take.
      adams.core.base.BaseTimeMsec getOffset()
      Returns the offset for the samples.
      String globalInfo()
      Returns a string describing the object.
      String intervalTipText()
      Returns the tip text for this property.
      String numSamplesTipText()
      Returns the tip text for this property.
      String offsetTipText()
      Returns the tip text for this property.
      void setInterval​(int value)
      Sets the interval in milli-seconds between samples.
      void setNumSamples​(int value)
      Sets the number of samples to take.
      void setOffset​(adams.core.base.BaseTimeMsec value)
      Sets the offset for the samples.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
      • Methods inherited from class adams.core.logging.CustomLoggingLevelObject

        setLoggingLevel
      • 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_NumSamples

        protected int m_NumSamples
        the number of samples to generate.
      • m_Offset

        protected adams.core.base.BaseTimeMsec m_Offset
        the offset.
      • m_Interval

        protected int m_Interval
        the interval in msec between the .
      • m_Reader

        protected transient com.xuggle.mediatool.IMediaReader m_Reader
        the reader to use.
      • m_Listener

        protected transient com.xuggle.mediatool.MediaListenerAdapter m_Listener
        the listener to use.
      • m_LastPtsWrite

        protected long m_LastPtsWrite
        the last frame write.
      • m_MicroSecondsBetweenFrames

        protected long m_MicroSecondsBetweenFrames
        the interval for the frames.
      • m_VideoStreamIndex

        protected int m_VideoStreamIndex
        The video stream index, used to ensure we display frames from one and only one video stream from the media container.
      • m_Samples

        protected List<adams.data.image.BufferedImageContainer> m_Samples
        the samples.
    • Constructor Detail

      • FixedIntervalBufferedImageSampler

        public FixedIntervalBufferedImageSampler()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setOffset

        public void setOffset​(adams.core.base.BaseTimeMsec value)
        Sets the offset for the samples.
        Parameters:
        value - the offset
      • getOffset

        public adams.core.base.BaseTimeMsec getOffset()
        Returns the offset for the samples.
        Returns:
        the offset
      • offsetTipText

        public String offsetTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setInterval

        public void setInterval​(int value)
        Sets the interval in milli-seconds between samples.
        Parameters:
        value - the interval
      • getInterval

        public int getInterval()
        Returns the interval between samples in milli-seconds.
        Returns:
        the interval
      • intervalTipText

        public String intervalTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNumSamples

        public void setNumSamples​(int value)
        Sets the number of samples to take.
        Parameters:
        value - the number
      • getNumSamples

        public int getNumSamples()
        Returns the number of samples to take.
        Returns:
        the number
      • numSamplesTipText

        public String numSamplesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doSample

        protected adams.data.image.BufferedImageContainer[] doSample​(File file)
        Samples images from a movie file.
        Specified by:
        doSample in class AbstractMovieImageSampler<adams.data.image.BufferedImageContainer>
        Parameters:
        file - the movie to sample
        Returns:
        the samples