use of org.fagu.fmv.core.exec.FilterExec in project fmv by f-agu.
the class GenericFilterExec method populateWithIdentifiables.
// *************************************************************
/**
* @param filterComplex
* @param cache
* @param builder
* @return
*/
protected Set<Type> populateWithIdentifiables(FilterComplexBase filterComplex, Cache cache, FFMPEGExecutorBuilder builder) {
Set<Type> undeclaredTypes = new HashSet<>(filterComplex.getTypes());
for (Identifiable identifiable : getIdentifiableChildren()) {
if (identifiable.isExecutable()) {
File file = getProject().getFileCache().getFile((Executable) identifiable, cache);
InputProcessor inputProcessor = builder.addMediaInputFile(file);
addInputIntoFilter(filterComplex, inputProcessor, undeclaredTypes);
} else if (identifiable.isSource()) {
FilterInput filterInput = ((Source) identifiable).createAndAdd(builder);
addInputIntoFilter(filterComplex, filterInput, undeclaredTypes);
} else if (identifiable.isFilterExec()) {
Filter inFilter = ((FilterExec) identifiable).makeFilter(builder, cache);
addInputIntoFilter(filterComplex, (FilterComplexBase) inFilter, undeclaredTypes);
}
}
return undeclaredTypes;
}
use of org.fagu.fmv.core.exec.FilterExec in project fmv by f-agu.
the class GenericExecutable method populateWithIdentifiables.
// *******************************************************
/**
* @param toFile
* @param cache
* @param builder
*/
protected List<FilterInput> populateWithIdentifiables(File toFile, Cache cache, FFMPEGExecutorBuilder builder) {
List<FilterInput> filterInputs = new ArrayList<>();
// executable
for (Executable executable : executables) {
File file = getProject().getFileCache().getFile(executable, cache);
filterInputs.add(builder.addMediaInputFile(file));
}
// source
for (Source source : sources) {
filterInputs.add(source.createAndAdd(builder));
}
// filters
for (FilterExec filterExec : getFilters()) {
Filter filter = filterExec.makeFilter(builder, cache);
builder.filter(filter);
if (filter instanceof FilterComplexBase) {
filterInputs.add((FilterComplexBase) filter);
}
}
return filterInputs;
}
Aggregations