2 * Meviz - Various tools collection to work with multimedia.
3 * Copyright (C) 2012 -- 2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
10 package eu.svjatoslav.meviz.encoder.converters;
12 import eu.svjatoslav.meviz.encoder.EncodingOptions;
15 import java.util.ArrayList;
16 import java.util.Collections;
17 import java.util.List;
19 public abstract class AbstractConverter {
21 public abstract String getCommand(File inputFile, File targetFile,
22 EncodingOptions options, String targetFormat);
24 protected abstract List<String> getSourceFileExtensions();
26 protected abstract List<String> getTargetFileExtensions();
29 * For some reasons some encoders require terminal to run. Until this is
30 * resolved, encoder can request for terminal using this method.
32 public abstract boolean isTerminalMandatory();
34 public boolean supportsSource(final String format) {
35 return getSourceFileExtensions().contains(format);
38 public boolean supportsTarget(final String format) {
39 return getTargetFileExtensions().contains(format);
42 List<String> toList(final String... strings) {
43 final ArrayList<String> result = new ArrayList<>();
45 Collections.addAll(result, strings);