Package org.opencastproject.composer.api
Class EncodingProfileImpl
java.lang.Object
org.opencastproject.composer.api.EncodingProfileImpl
- All Implemented Interfaces:
EncodingProfile
Default implementation for encoding profiles.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn extension property.Nested classes/interfaces inherited from interface org.opencastproject.composer.api.EncodingProfile
EncodingProfile.MediaType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EncodingProfile.MediaTypeThe track type that this profile may be applied toprotected List<EncodingProfileImpl.Extension> Installation-specific propertiesprotected StringThe profile identifierprotected Floatprotected StringMime typeprotected StringFormat descriptionprotected EncodingProfile.MediaTypeFormat typeprotected Object -
Constructor Summary
ConstructorsConstructorDescriptionEncodingProfileImpl(String identifier, String name, Object source) Private, since the profile should be created using the static factory method. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(String key, String value) Adds the given key-value pair to the extended configuration space of this media profile.booleanReturns the media format that can be used with this encoding profile.getExtension(String key) Returns the extension specified bykeyornullif no such key was defined.Returns a map containing the additional properties or an empty map if no additional properties were found.Returns the unique format identifier.floatReturns an estimate of the load a single job with this profile causes.Return the mimetype as stringgetName()Returns the encoding format's name.Returns the encoding format's media type, which is either video (plus audio) or audio only.Returns the source object that provided this encoding profileReturns a suffix of the files.Returns a suffix of the files for a certain tag.getTags()Returns a list of the tags for output files used in this requestbooleanReturnstrueif additional properties have been specified.inthashCode()booleanReturnstrueif the profile is applicable for the given track type.removeExtension(String key) Removes the specified property from the extended configuation space and returns either the property value ornullif no property was found.voidsetApplicableType(EncodingProfile.MediaType applicableType) Sets the applicable type.voidsetExtensions(Map<String, String> extension) Sets the extension properties for that profile.voidsetIdentifier(String id) Sets the identifiervoidsetJobLoad(Float jobLoad) Sets the job load for this encoding profilevoidsetMimeType(String mimeType) sets the mimetype of the output if applicablevoidSets the profile namevoidSets the output type.voidSets the suffix for encoded file names.voidSets the suffix for encoded file names.toString()
-
Field Details
-
identifier
The profile identifier -
name
Format description -
source
-
outputType
Format type -
mimeType
Mime type -
applicableType
The track type that this profile may be applied to -
extensions
Installation-specific properties -
suffixes
-
jobLoad
-
-
Constructor Details
-
EncodingProfileImpl
Private, since the profile should be created using the static factory method.- Parameters:
identifier- the profile identifiername- the profile name
-
EncodingProfileImpl
public EncodingProfileImpl()
-
-
Method Details
-
getIdentifier
Returns the unique format identifier.- Specified by:
getIdentifierin interfaceEncodingProfile- Returns:
- the format identifier
- See Also:
-
setIdentifier
Sets the identifier- Parameters:
id- the identifier
-
getName
Returns the encoding format's name.- Specified by:
getNamein interfaceEncodingProfile- Returns:
- the format name
- See Also:
-
setName
Sets the profile name- Parameters:
name- the profile name
-
getSource
Returns the source object that provided this encoding profile- Specified by:
getSourcein interfaceEncodingProfile- Returns:
- the source object that provided this profile
- See Also:
-
getOutputType
Returns the encoding format's media type, which is either video (plus audio) or audio only.- Specified by:
getOutputTypein interfaceEncodingProfile- Returns:
- the format type
- See Also:
-
setOutputType
Sets the output type.- Parameters:
type- the output type
-
getSuffix
Returns a suffix of the files. First tag found used if tags are used but not provided in the request- Specified by:
getSuffixin interfaceEncodingProfile- Returns:
- the suffix
- See Also:
-
setSuffix
Sets the suffix for encoded file names.- Parameters:
suffix- the file suffix
-
setSuffix
Sets the suffix for encoded file names.- Parameters:
suffix- the file suffix
-
getMimeType
Return the mimetype as string- Specified by:
getMimeTypein interfaceEncodingProfile- See Also:
-
setMimeType
sets the mimetype of the output if applicable- Specified by:
setMimeTypein interfaceEncodingProfile- Parameters:
mimeType-
-
getApplicableMediaType
Returns the media format that can be used with this encoding profile.- Specified by:
getApplicableMediaTypein interfaceEncodingProfile- Returns:
- the applicable input format
- See Also:
-
setApplicableType
Sets the applicable type.- Parameters:
applicableType- the applicableType to set
-
isApplicableTo
Returnstrueif the profile is applicable for the given track type.- Specified by:
isApplicableToin interfaceEncodingProfile- Parameters:
type- the track type- Returns:
trueif the profile is applicable- See Also:
-
getExtension
Returns the extension specified bykeyornullif no such key was defined.Note that
keymust not contain the media format prefix, so if the configured entry wasmediaformat.format.xyz.test, then the key to access the value must simply betest.- Specified by:
getExtensionin interfaceEncodingProfile- Parameters:
key- the extension key- Returns:
- the value or
null - See Also:
-
addExtension
Adds the given key-value pair to the extended configuration space of this media profile.- Parameters:
key- the property keyvalue- the property value
-
getExtensions
Returns a map containing the additional properties or an empty map if no additional properties were found.- Specified by:
getExtensionsin interfaceEncodingProfile- Returns:
- the additional properties
- See Also:
-
setExtensions
Sets the extension properties for that profile. These properties may be intepreted by the encoder engine.- Parameters:
extension- the extension properties
-
removeExtension
Removes the specified property from the extended configuation space and returns either the property value ornullif no property was found.- Parameters:
key- the property key- Returns:
- the property value or
null
-
hasExtensions
public boolean hasExtensions()Returnstrueif additional properties have been specified.- Specified by:
hasExtensionsin interfaceEncodingProfile- Returns:
trueif there are additional properties- See Also:
-
getJobLoad
public float getJobLoad()Returns an estimate of the load a single job with this profile causes. This should be roughly equal to the number of processor cores used at runtime.- Specified by:
getJobLoadin interfaceEncodingProfile- Returns:
- the load a single job with this profile causes
- See Also:
-
setJobLoad
Sets the job load for this encoding profile- Parameters:
jobLoad- the load caused by one instance of this encoding profile running
-
hashCode
public int hashCode() -
equals
-
toString
-
getSuffix
Description copied from interface:EncodingProfileReturns a suffix of the files for a certain tag.- Specified by:
getSuffixin interfaceEncodingProfile- Parameters:
tag- a tag that describes the aoutput file- Returns:
- the suffix
-
getTags
Description copied from interface:EncodingProfileReturns a list of the tags for output files used in this request- Specified by:
getTagsin interfaceEncodingProfile- Returns:
- a list of the used tags
-