Package org.opencastproject.sox.impl
Class SoxServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.sox.impl.SoxServiceImpl
- All Implemented Interfaces:
JobProducer,SoxService,org.osgi.service.cm.ManagedService
public class SoxServiceImpl
extends AbstractJobProducer
implements SoxService, org.osgi.service.cm.ManagedService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key to look for in the service configuration file to override theDEFAULT_ANALYZE_JOB_LOADstatic final StringThe collection namestatic final Stringstatic final floatThe load introduced on the system by creating a analyze jobstatic final floatThe load introduced on the system by creating a normalize jobstatic final StringThe key to look for in the service configuration file to override theDEFAULT_NORMALIZE_JOB_LOADprotected OrganizationDirectoryServiceThe organization directory serviceprotected SecurityServiceThe security servicestatic final StringDefault location of the SoX binary (resembling the installer)protected UserDirectoryServiceThe user directory serviceFields 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.sox.api.SoxService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGi callback on component activation.Get audio statistics, using that track's audio streams.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 serviceNormalize the audio stream of that track.protected StringAsks the overriding class to process the arguments using the given operation.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetSecurityService(SecurityService securityService) Callback for setting the security service.protected voidsetServiceRegistry(ServiceRegistry serviceRegistry) Sets the service registryvoidsetUserDirectoryService(UserDirectoryService userDirectoryService) Callback for setting the user directory service.protected voidsetWorkspace(Workspace workspace) Sets the workspacevoidupdated(Dictionary properties) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
SOX_BINARY_DEFAULT
Default location of the SoX binary (resembling the installer)- See Also:
-
CONFIG_SOX_PATH
- See Also:
-
DEFAULT_ANALYZE_JOB_LOAD
public static final float DEFAULT_ANALYZE_JOB_LOADThe load introduced on the system by creating a analyze job- See Also:
-
ANALYZE_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_ANALYZE_JOB_LOAD- See Also:
-
DEFAULT_NORMALIZE_JOB_LOAD
public static final float DEFAULT_NORMALIZE_JOB_LOADThe load introduced on the system by creating a normalize job- See Also:
-
NORMALIZE_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_NORMALIZE_JOB_LOAD- See Also:
-
COLLECTION
The collection name- See Also:
-
securityService
The security service -
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service
-
-
Constructor Details
-
SoxServiceImpl
public SoxServiceImpl()Creates a new composer service instance.
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) OSGi callback on component activation.- Overrides:
activatein classAbstractJobProducer- Parameters:
cc- the component context
-
analyze
Get audio statistics, using that track's audio streams.- Specified by:
analyzein interfaceSoxService- Parameters:
sourceAudioTrack- The source audio track- Returns:
- The receipt for this audio processing job.
- Throws:
MediaPackageException- if the mediapackage is invalidSoxException- if audio processing fails- See Also:
-
normalize
public Job normalize(Track sourceAudioTrack, Float targetRmsLevDb) throws MediaPackageException, SoxException Normalize the audio stream of that track.- Specified by:
normalizein interfaceSoxService- Parameters:
sourceAudioTrack- The source audio tracktargetRmsLevDb- The target RMS Lev dB- Returns:
- The receipt for this audio processing job
- Throws:
MediaPackageException- if the mediapackage is invalidSoxException- if audio processing fails- 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:
-
analyze
- Throws:
SoxException
-
setWorkspace
Sets the workspace- Parameters:
workspace- an instance of the workspace
-
setServiceRegistry
Sets the service registry- Parameters:
serviceRegistry- the service registry
-
getServiceRegistry
Returns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
- See Also:
-
setSecurityService
Callback for setting the security service.- Parameters:
securityService- the securityService to set
-
setUserDirectoryService
Callback for setting the user directory service.- Parameters:
userDirectoryService- the userDirectoryService to set
-
setOrganizationDirectoryService
Sets a reference to the organization directory service.- Parameters:
organizationDirectory- the organization directory
-
getSecurityService
Returns a reference to the security service- Specified by:
getSecurityServicein classAbstractJobProducer- Returns:
- the security service
- See Also:
-
getUserDirectoryService
Returns a reference to the user directory service- Specified by:
getUserDirectoryServicein classAbstractJobProducer- Returns:
- the user directory service
- See Also:
-
getOrganizationDirectoryService
Returns a reference to the organization directory service.- Specified by:
getOrganizationDirectoryServicein classAbstractJobProducer- Returns:
- the organization directory service
- See Also:
-
updated
- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-