2 * Meviz - Various tools collection to work with multimedia. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
7 package eu.svjatoslav.meviz.encoder.converters;
9 import eu.svjatoslav.meviz.encoder.EncodingOptions;
12 import java.util.ArrayList;
13 import java.util.Collections;
14 import java.util.List;
16 public abstract class AbstractConverter {
18 public abstract String getCommand(File inputFile, File targetFile,
19 EncodingOptions options, String targetFormat);
21 public abstract List<String> getSourceFileExtensions();
23 public abstract List<String> getTargetFileExtensions();
26 * For some reasons some encoders require terminal to run. Until this is
27 * resolved, encoder can request for terminal using this method.
29 public abstract boolean isTerminalMandatory();
31 public boolean supportsSource(final String format) {
32 return getSourceFileExtensions().contains(format);
35 public boolean supportsTarget(final String format) {
36 return getTargetFileExtensions().contains(format);
39 List<String> toList(final String... strings) {
40 final ArrayList<String> result = new ArrayList<>();
42 Collections.addAll(result, strings);