Record Class FfmpegMedia.SubtitleTrack

java.lang.Object
java.lang.Record
limn.video.ffmpeg.FfmpegMedia.SubtitleTrack
Record Components:
index - this track's position in FfmpegMedia.subtitleTracks(), and what FfmpegMedia.selectSubtitles(int) takes. Not a container stream index
streamIndex - the container's own index for this stream, for a diagnostic; nothing in this API takes it
codec - the codec's name as libavcodec spells it: mov_text, subrip, ass, webvtt
language - the language tag the container states, or null when it states none, on the same rule as FfmpegMedia.AudioTrack.language()
text - whether the format is text rather than a picture. False is a refusal, not a warning: PGS, VobSub and DVB subtitles are paletted bitmaps with their own rectangle and palette, and this SPI carries text cues only, so FfmpegMedia.selectSubtitles(int) throws for one. Such a track is still listed, because a film with one text track and one bitmap track has two subtitle tracks and hiding one would say otherwise. This is the codec's own property and not the build's, so it stays the answer in a build someone compiled a bitmap decoder into
decodable - whether this build has a decoder for it. The other reason selecting a track can be refused, and a separate one: a trimmed build carries a few codecs, and which they are can change without the format changing
isDefault - whether the container marks this track as its default. Reported and not acted on: nothing is selected when a container opens, because whether a viewer wants subtitles is not a fact about the file
forced - whether the container marks this track as forced: the subset a viewer wants even with subtitles off, for the foreign-language lines inside a film. Reported for an application that wants to honour it
Enclosing class:
FfmpegMedia

public static record FfmpegMedia.SubtitleTrack(int index, int streamIndex, String codec, String language, boolean text, boolean decodable, boolean isDefault, boolean forced) extends Record
One of a container's subtitle tracks, as the container describes it: read once at open, from the file's own stream headers, without opening a decoder for it.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubtitleTrack(int index, int streamIndex, String codec, String language, boolean text, boolean decodable, boolean isDefault, boolean forced)
    Creates an instance of a SubtitleTrack record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the codec record component.
    boolean
    Returns the value of the decodable record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the forced record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the index record component.
    boolean
    Returns the value of the isDefault record component.
    Returns the value of the language record component.
    int
    Returns the value of the streamIndex record component.
    boolean
    Returns the value of the text record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SubtitleTrack

      public SubtitleTrack(int index, int streamIndex, String codec, String language, boolean text, boolean decodable, boolean isDefault, boolean forced)
      Creates an instance of a SubtitleTrack record class.
      Parameters:
      index - the value for the index record component
      streamIndex - the value for the streamIndex record component
      codec - the value for the codec record component
      language - the value for the language record component
      text - the value for the text record component
      decodable - the value for the decodable record component
      isDefault - the value for the isDefault record component
      forced - the value for the forced record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • streamIndex

      public int streamIndex()
      Returns the value of the streamIndex record component.
      Returns:
      the value of the streamIndex record component
    • codec

      public String codec()
      Returns the value of the codec record component.
      Returns:
      the value of the codec record component
    • language

      public String language()
      Returns the value of the language record component.
      Returns:
      the value of the language record component
    • text

      public boolean text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • decodable

      public boolean decodable()
      Returns the value of the decodable record component.
      Returns:
      the value of the decodable record component
    • isDefault

      public boolean isDefault()
      Returns the value of the isDefault record component.
      Returns:
      the value of the isDefault record component
    • forced

      public boolean forced()
      Returns the value of the forced record component.
      Returns:
      the value of the forced record component