Package limn.video.ffmpeg
Record Class FfmpegMedia.SubtitleTrack
java.lang.Object
java.lang.Record
limn.video.ffmpeg.FfmpegMedia.SubtitleTrack
- Record Components:
index- this track's position inFfmpegMedia.subtitleTracks(), and whatFfmpegMedia.selectSubtitles(int)takes. Not a container stream indexstreamIndex- the container's own index for this stream, for a diagnostic; nothing in this API takes itcodec- the codec's name as libavcodec spells it:mov_text,subrip,ass,webvttlanguage- the language tag the container states, or null when it states none, on the same rule asFfmpegMedia.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, soFfmpegMedia.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 intodecodable- 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 changingisDefault- 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 fileforced- 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
ConstructorsConstructorDescriptionSubtitleTrack(int index, int streamIndex, String codec, String language, boolean text, boolean decodable, boolean isDefault, boolean forced) Creates an instance of aSubtitleTrackrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the value of thecodecrecord component.booleanReturns the value of thedecodablerecord component.final booleanIndicates whether some other object is "equal to" this one.booleanforced()Returns the value of theforcedrecord component.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.booleanReturns the value of theisDefaultrecord component.language()Returns the value of thelanguagerecord component.intReturns the value of thestreamIndexrecord component.booleantext()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aSubtitleTrackrecord class.- Parameters:
index- the value for theindexrecord componentstreamIndex- the value for thestreamIndexrecord componentcodec- the value for thecodecrecord componentlanguage- the value for thelanguagerecord componenttext- the value for thetextrecord componentdecodable- the value for thedecodablerecord componentisDefault- the value for theisDefaultrecord componentforced- the value for theforcedrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
streamIndex
public int streamIndex()Returns the value of thestreamIndexrecord component.- Returns:
- the value of the
streamIndexrecord component
-
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
language
Returns the value of thelanguagerecord component.- Returns:
- the value of the
languagerecord component
-
text
public boolean text()Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
decodable
public boolean decodable()Returns the value of thedecodablerecord component.- Returns:
- the value of the
decodablerecord component
-
isDefault
public boolean isDefault()Returns the value of theisDefaultrecord component.- Returns:
- the value of the
isDefaultrecord component
-
forced
public boolean forced()Returns the value of theforcedrecord component.- Returns:
- the value of the
forcedrecord component
-