Interface IMediaConverterBase
Base interface for all Media converters
Inherited Members
Namespace: ImageVault.Core.Common.Conversion
Assembly: ImageVault.Core.dll
Syntax
public interface IMediaConverterBase : ICorePlugin
Remarks
All registered converters will be questioned (CanConvert(DbMediaContentReference, MediaFormatBase)) in order if they can perform a specific conversion. The first positive converter will be registered as the assigned converter for the job. The converter will later be called when the actual conversion should be made. 2011-02-18 dan: Created
Methods
ApplyFormatOnMedia(IMediaFormat, Media)
Applies the supplied format on the media according to the converter rules
Declaration
void ApplyFormatOnMedia(IMediaFormat format, Media media)
Parameters
Type | Name | Description |
---|---|---|
IMediaFormat | format | The IMediaFormat to apply |
Media | media | The Media to apply the format to |
CanConvert(DbMediaContentReference, MediaFormatBase)
Controls if a specific conversion can be performed
Declaration
bool CanConvert(DbMediaContentReference sourceReference, MediaFormatBase targetFormat)
Parameters
Type | Name | Description |
---|---|---|
DbMediaContentReference | sourceReference | The source data to convert |
MediaFormatBase | targetFormat | The target format for the conversion |
Returns
Type | Description |
---|---|
System.Boolean | True if the conversion can be performed by the converter, false otherwise. |
Convert(DbMediaContentReference, MediaFormatBase, AreaOfInterest, ExportMetadataInfo)
Converts the supplied source to the targetConversion with help of the mediaContentService
Declaration
MediaContent Convert(DbMediaContentReference sourceReference, MediaFormatBase targetFormat, AreaOfInterest areaOfInterest, ExportMetadataInfo exportMetadataInfo)
Parameters
Type | Name | Description |
---|---|---|
DbMediaContentReference | sourceReference | The DbMediaContentReference referring to the source media |
MediaFormatBase | targetFormat | The MediaFormatBase describing the output format |
AreaOfInterest | areaOfInterest | Area of interest for the source reference |
ExportMetadataInfo | exportMetadataInfo | Info about metadata export |
Returns
Type | Description |
---|---|
MediaContent | The converted MediaContent or null if the type of conversion is not supported |
Exceptions
Type | Condition |
---|---|
TemporaryConversionException | If the conversion cannot be completed for temporary reasons and the converter would like to try again a bit later the method can throw this exception and provide a TemporaryContent to use in the meanwhile. Be sure to set expiration of the content, for example use the CacheTimeout to a value when the client is allowed to try again. |