Class WaveformServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.waveform.ffmpeg.WaveformServiceImpl
- All Implemented Interfaces:
JobProducer,WaveformService,org.osgi.service.cm.ManagedService
public class WaveformServiceImpl
extends AbstractJobProducer
implements WaveformService, org.osgi.service.cm.ManagedService
This service creates a waveform image from a media file with at least one audio channel.
This will be done using ffmpeg.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringPath to the executablestatic final StringResulting collection in the working file repositorystatic final StringThe default path to the ffmpeg binarystatic final String[]The default waveform colors per audio channelstatic final Stringstatic final StringThe default filter to be optionally appended to the showwavespic filterstatic final StringThe default filter to be optionally prepended to the showwavespic filterstatic final floatThe default job load of a waveform jobstatic final StringThe default waveform image scale algorithmstatic final booleanThe default value if the waveforms (per audio channel) should be renderen next to each other (if true) or on top of each other (if false)static final StringThe key to look for in the service configuration file to override the DEFAULT_FFMPEG_BINARYprotected static final org.slf4j.LoggerThe logging facilitystatic final StringThe key to look for in the service configuration file to override the DEFAULT_WAVEFORM_COLORstatic final Stringstatic final StringThe key to look for in the service configuration file to override the DEFAULT_WAVEFORM_FILTER_POSTstatic final StringThe key to look for in the service configuration file to override the DEFAULT_WAVEFORM_FILTER_PREstatic final StringThe key to look for in the service configuration file to override the DEFAULT_WAVEFORM_JOB_LOADstatic final StringThe key to look for in the service configuration file to override the DEFAULT_WAVEFORM_SCALEstatic final StringThe key to look for in the service configuration file to override the DEFAULT_WAVEFORM_SPLIT_CHANNELSFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobTypeFields inherited from interface org.opencastproject.waveform.api.WaveformService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGI activate method.createWaveformImage(Track sourceTrack, int pixelsPerMinute, int minWidth, int maxWidth, int height, String color) Takes the given track and returns the job that will create a waveform image.protected OrganizationDirectoryServiceReturns a reference to the organization directory service.protected SecurityServiceReturns a reference to the security serviceprotected ServiceRegistryReturns a reference to the service registry.protected UserDirectoryServiceReturns a reference to the user directory serviceprotected StringAsks the overriding class to process the arguments using the given operation.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(SecurityService securityService) voidsetServiceRegistry(ServiceRegistry serviceRegistry) voidsetUserDirectoryService(UserDirectoryService userDirectoryService) voidsetWorkspace(Workspace workspace) voidupdated(Dictionary<String, ?> properties) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
logger
protected static final org.slf4j.Logger loggerThe logging facility -
binary
Path to the executable -
WAVEFORM_JOB_LOAD_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_WAVEFORM_JOB_LOAD- See Also:
-
DEFAULT_WAVEFORM_JOB_LOAD
public static final float DEFAULT_WAVEFORM_JOB_LOADThe default job load of a waveform job- See Also:
-
FFMPEG_BINARY_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_FFMPEG_BINARY- See Also:
-
DEFAULT_FFMPEG_BINARY
The default path to the ffmpeg binary- See Also:
-
DEFAULT_WAVEFORM_SCALE
The default waveform image scale algorithm- See Also:
-
WAVEFORM_SCALE_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_WAVEFORM_SCALE- See Also:
-
DEFAULT_WAVEFORM_SPLIT_CHANNELS
public static final boolean DEFAULT_WAVEFORM_SPLIT_CHANNELSThe default value if the waveforms (per audio channel) should be renderen next to each other (if true) or on top of each other (if false)- See Also:
-
WAVEFORM_SPLIT_CHANNELS_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_WAVEFORM_SPLIT_CHANNELS- See Also:
-
DEFAULT_WAVEFORM_COLOR
The default waveform colors per audio channel -
WAVEFORM_COLOR_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_WAVEFORM_COLOR- See Also:
-
DEFAULT_WAVEFORM_FILTER_MODE
- See Also:
-
WAVEFORM_FILTER_MODE_CONFIG_KEY
- See Also:
-
DEFAULT_WAVEFORM_FILTER_PRE
The default filter to be optionally prepended to the showwavespic filter -
WAVEFORM_FILTER_PRE_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_WAVEFORM_FILTER_PRE- See Also:
-
DEFAULT_WAVEFORM_FILTER_POST
The default filter to be optionally appended to the showwavespic filter -
WAVEFORM_FILTER_POST_CONFIG_KEY
The key to look for in the service configuration file to override the DEFAULT_WAVEFORM_FILTER_POST- See Also:
-
COLLECTION_ID
Resulting collection in the working file repository- See Also:
-
-
Constructor Details
-
WaveformServiceImpl
public WaveformServiceImpl()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) Description copied from class:AbstractJobProducerOSGI activate method.- Overrides:
activatein classAbstractJobProducer- Parameters:
cc- OSGI component context
-
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationException- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
createWaveformImage
public Job createWaveformImage(Track sourceTrack, int pixelsPerMinute, int minWidth, int maxWidth, int height, String color) throws MediaPackageException, WaveformServiceException Takes the given track and returns the job that will create a waveform image.- Specified by:
createWaveformImagein interfaceWaveformService- Parameters:
sourceTrack- the track to create waveform image frompixelsPerMinute- the width of the waveform image in pixels per minuteminWidth- the minimum width of the waveform imagemaxWidth- the maximum width of the waveform imageheight- the height of the waveform imagecolor- the color of the waveform image- Returns:
- a job that will create a waveform image
- Throws:
MediaPackageException- if the serialization of the given track failsWaveformServiceException- if the job can't be created for any reason- See Also:
-
process
Asks the overriding class to process the arguments using the given operation. The result will be added to the associated job as the payload.- Specified by:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
Exception- See Also:
-
getServiceRegistry
Description copied from class:AbstractJobProducerReturns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
-
getSecurityService
Description copied from class:AbstractJobProducerReturns a reference to the security service- Specified by:
getSecurityServicein classAbstractJobProducer- Returns:
- the security service
-
getUserDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the user directory service- Specified by:
getUserDirectoryServicein classAbstractJobProducer- Returns:
- the user directory service
-
getOrganizationDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the organization directory service.- Specified by:
getOrganizationDirectoryServicein classAbstractJobProducer- Returns:
- the organization directory service
-
setServiceRegistry
-
setSecurityService
-
setUserDirectoryService
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) -
setWorkspace
-