001package net.bramp.ffmpeg.info;
002
003import org.apache.commons.lang3.builder.EqualsBuilder;
004import org.apache.commons.lang3.builder.HashCodeBuilder;
005
006/** Represents an FFmpeg filter with its capabilities and input/output patterns. */
007public class Filter {
008  /** Is timeline editing supported. */
009  private final boolean timelineSupported;
010
011  /** Is slice based multi-threading supported. */
012  private final boolean sliceThreading;
013
014  /** Are there command line options. */
015  private final boolean commandSupport;
016
017  /** The filters name. */
018  private final String name;
019
020  /** The input filter pattern. */
021  private final FilterPattern inputPattern;
022
023  /** The output filter pattern. */
024  private final FilterPattern outputPattern;
025
026  /** A short description of the filter. */
027  private final String description;
028
029  /** Constructs a new Filter with the given properties. */
030  public Filter(
031      boolean timelineSupported,
032      boolean sliceThreading,
033      boolean commandSupport,
034      String name,
035      FilterPattern inputPattern,
036      FilterPattern outputPattern,
037      String description) {
038    this.timelineSupported = timelineSupported;
039    this.sliceThreading = sliceThreading;
040    this.commandSupport = commandSupport;
041    this.name = name;
042    this.inputPattern = inputPattern;
043    this.outputPattern = outputPattern;
044    this.description = description;
045  }
046
047  public boolean isTimelineSupported() {
048    return timelineSupported;
049  }
050
051  public boolean isSliceThreading() {
052    return sliceThreading;
053  }
054
055  public boolean isCommandSupport() {
056    return commandSupport;
057  }
058
059  public String getName() {
060    return name;
061  }
062
063  public FilterPattern getInputPattern() {
064    return inputPattern;
065  }
066
067  public FilterPattern getOutputPattern() {
068    return outputPattern;
069  }
070
071  public String getDescription() {
072    return description;
073  }
074
075  @Override
076  public boolean equals(Object obj) {
077    return EqualsBuilder.reflectionEquals(this, obj);
078  }
079
080  @Override
081  public String toString() {
082    return name;
083  }
084
085  @Override
086  public int hashCode() {
087    return HashCodeBuilder.reflectionHashCode(this);
088  }
089}