Class FixedIntervalBufferedImageSamplerVlcj
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.movieimagesampler.AbstractMovieImageSampler<adams.data.image.BufferedImageContainer>
-
- adams.flow.transformer.movieimagesampler.AbstractBufferedImageMovieImageSampler
-
- adams.flow.transformer.movieimagesampler.FixedIntervalBufferedImageSamplerVlcj
-
- 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 FixedIntervalBufferedImageSamplerVlcj extends AbstractBufferedImageMovieImageSampler
Generates a specified number of image samples at fixed intervals.- Version:
- $Revision$
- Author:
- sjb90 at waikato dot ac dot nz
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.image.BufferedImageContainer
m_CurrentImage
a container for storing the current imageprotected uk.co.caprica.vlcj.player.MediaPlayerFactory
m_Factory
a media player factory for getting the media playerprotected BufferedImage
m_Image
an image to feed the buffer intoprotected int
m_Interval
the interval in msec between the .protected uk.co.caprica.vlcj.player.direct.DirectMediaPlayer
m_MediaPlayer
headless media playerprotected int
m_NumSamples
the number of samples to generate.protected adams.core.base.BaseTimeMsec
m_Offset
the offset.protected adams.data.image.BufferedImageContainer
m_PreviousImage
a container for storing the previous imageprotected List<adams.data.image.BufferedImageContainer>
m_Samples
the samples.protected Dimension
m_VideoDimension
the dimensions of the video-
Fields inherited from class adams.flow.transformer.movieimagesampler.AbstractMovieImageSampler
m_Stopped
-
-
Constructor Summary
Constructors Constructor Description FixedIntervalBufferedImageSamplerVlcj()
-
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.protected void
initialize()
Initializes the members.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.flow.transformer.movieimagesampler.AbstractBufferedImageMovieImageSampler
generates
-
Methods inherited from class adams.flow.transformer.movieimagesampler.AbstractMovieImageSampler
check, sample, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
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_MediaPlayer
protected uk.co.caprica.vlcj.player.direct.DirectMediaPlayer m_MediaPlayer
headless media player
-
m_Samples
protected List<adams.data.image.BufferedImageContainer> m_Samples
the samples.
-
m_Factory
protected uk.co.caprica.vlcj.player.MediaPlayerFactory m_Factory
a media player factory for getting the media player
-
m_VideoDimension
protected Dimension m_VideoDimension
the dimensions of the video
-
m_Image
protected BufferedImage m_Image
an image to feed the buffer into
-
m_CurrentImage
protected adams.data.image.BufferedImageContainer m_CurrentImage
a container for storing the current image
-
m_PreviousImage
protected adams.data.image.BufferedImageContainer m_PreviousImage
a container for storing the previous image
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.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.
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.core.option.AbstractOptionHandler
-
doSample
protected adams.data.image.BufferedImageContainer[] doSample(File file)
Samples images from a movie file. Code adapted from https://github.com/caprica/vlcj/blob/vlcj-3.0.1/src/test/java/uk/co/caprica/vlcj/test/condition/ConditionTest.java- Specified by:
doSample
in classAbstractMovieImageSampler<adams.data.image.BufferedImageContainer>
- Parameters:
file
- the movie to sample- Returns:
- the samples, null if failed to sample
-
-