001package net.bramp.ffmpeg.probe;
002
003import com.google.common.collect.ImmutableList;
004import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
005import java.util.Collections;
006import java.util.List;
007
008/** TODO Make this immutable */
009@SuppressFBWarnings(
010    value = {"UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"},
011    justification = "POJO objects where the fields are populated by gson")
012public class FFmpegProbeResult {
013  public FFmpegError error;
014  public FFmpegFormat format;
015  public List<FFmpegStream> streams;
016  public List<FFmpegChapter> chapters;
017
018  public FFmpegError getError() {
019    return error;
020  }
021
022  public boolean hasError() {
023    return error != null;
024  }
025
026  public FFmpegFormat getFormat() {
027    return format;
028  }
029
030  public List<FFmpegStream> getStreams() {
031    if (streams == null) return Collections.emptyList();
032    return ImmutableList.copyOf(streams);
033  }
034
035  public List<FFmpegChapter> getChapters() {
036    if (chapters == null) return Collections.emptyList();
037    return ImmutableList.copyOf(chapters);
038  }
039}