Class MediaConverterBase
Summary description for MediaConverterBase.
Inheritance
Inherited Members
Namespace: ImageVault.Core.Conversion
Assembly: ImageVault.Core.dll
Syntax
public abstract class MediaConverterBase : IMediaConverter3, IMediaConverterBase, ICorePlugin
Constructors
MediaConverterBase()
Declaration
protected MediaConverterBase()
Properties
MediaContentService
Get/Sets the MediaContentService of the MediaConverterBase
Declaration
protected IMediaContentService MediaContentService { get; }
Property Value
| Type | Description |
|---|---|
| IMediaContentService |
ServiceFactory
Gets the ServiceFactory of the MediaConverterBase
Declaration
protected IServiceFactory ServiceFactory { get; }
Property Value
| Type | Description |
|---|---|
| IServiceFactory |
Methods
ApplyFormatOnMedia(IMediaFormat, Media)
Applies the supplied format on the media according to the converter rules
Declaration
public abstract 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 |
CalculateContentType(DbMediaContentReference, MediaFormatBase)
Calculates the output content type by the supplied format
Declaration
public abstract string CalculateContentType(DbMediaContentReference originalContentReference, MediaFormatBase format)
Parameters
| Type | Name | Description |
|---|---|---|
| DbMediaContentReference | originalContentReference | |
| MediaFormatBase | format |
Returns
| Type | Description |
|---|---|
| System.String |
CalculateMediaName(DbMediaContentReference, MediaFormatBase, String)
Calculates the name of the media for the given conversion
Declaration
public virtual string CalculateMediaName(DbMediaContentReference originalContentReference, MediaFormatBase format, string contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| DbMediaContentReference | originalContentReference | |
| MediaFormatBase | format | |
| System.String | contentType |
Returns
| Type | Description |
|---|---|
| System.String |
CanConvert(DbMediaContentReference, MediaFormatBase)
Controls if a specific conversion can be performed
Declaration
public abstract 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
public abstract 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. |
Init(IServiceFactory)
Initiates the plug-in. This method is called once when the Plug-in has been created.
Declaration
public virtual void Init(IServiceFactory serviceFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceFactory | serviceFactory | The IServiceFactory that the plug-in should use. |