Package org.opencastproject.caption.api
Interface CaptionConverter
- All Known Implementing Classes:
DFXPCaptionConverter,GoogleSpeechCaptionConverter,IBMWatsonCaptionConverter,Mpeg7CaptionConverter,SubRipCaptionConverter,WebVttCaptionConverter
public interface CaptionConverter
Imports caption catalogs to a list of caption objects and exports these objects to catalog presentations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidexportCaption(OutputStream outputStream, List<Caption> captions, String language) Exports caption collection.Get type of specific caption element (Catalog, Attachment).Get extension of specific caption format.String[]getLanguageList(InputStream inputStream) Reads captions and return information about language if such information is available.importCaption(InputStream inputStream, String language) Imports captions toList.
-
Method Details
-
importCaption
List<Caption> importCaption(InputStream inputStream, String language) throws CaptionConverterException Imports captions toList. If caption format is capable of containing more than one language, language parameter is used to define which captions are parsed.- Parameters:
inputStream- stream from where captions are readlanguage- (optional) captions' language- Returns:
ListList of captions- Throws:
CaptionConverterException- if parser encounters an exception
-
exportCaption
void exportCaption(OutputStream outputStream, List<Caption> captions, String language) throws IOException Exports caption collection. Language parameter is used to set language of the captions for those caption format that are capable of storing information about language.- Parameters:
outputStream- stream to which captions are writtencaptions- collection to be exportedlanguage- (optional) captions' language- Throws:
IOException- if exception occurs writing to output stream
-
getLanguageList
Reads captions and return information about language if such information is available. Returns empty list otherwise.- Parameters:
inputStream- stream from where captions are read- Returns:
- Array containing languages in captions
- Throws:
CaptionConverterException- if parser encounters exception
-
getExtension
String getExtension()Get extension of specific caption format.- Returns:
- caption format extension
-
getElementType
MediaPackageElement.Type getElementType()Get type of specific caption element (Catalog, Attachment).- Returns:
- type
-