Package com.castlabs.sdk.base.subtitles.utilities

# Class SubtitleFormat

java.lang.Object
com.castlabs.sdk.base.subtitles.utilities.SubtitleFormat

All Implemented Interfaces:
  `Parcelable`

public class SubtitleFormat extends Object implements Parcelable

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface android.os.Parcelable

  `Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final int`
  `accessibilityChannel`
  The Accessibility channel, or `NO_VALUE` if not known or applicable.
  `final int`
  `bitrate`
  The average bandwidth in bits per second, or `NO_VALUE` if unknown or not applicable.
  `final String`
  `codecs`
  Codecs of the SubtitleFormat as described in RFC 6381, or null if unknown or not applicable.
  `final String`
  `containerMimeType`
  The mime type of the container, or null if unknown or not applicable.
  `static final Parcelable.Creator<SubtitleFormat>`
  `CREATOR`
  `final DrmInitData`
  `drmInitData`
  DRM initialization data if the stream is protected, or null otherwise.
  `final String`
  `id`
  An identifier for the SubtitleFormat, or null if unknown or not applicable.
  `final List<byte[]>`
  `initializationData`
  Initialization data that must be provided to the decoder.
  `final String`
  `label`
  The human readable label, or null if unknown or not applicable.
  `final String`
  `language`
  The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable.
  `static final int`
  `NO_VALUE`
  A value for various fields to indicate that the field's value is unknown or not applicable.
  `static final long`
  `OFFSET_SAMPLE_RELATIVE`
  A value to indicate that subsample timestamps are relative to the timestamps of their parent samples.
  `final String`
  `originalLanguage`
  The language as present in manifest language tag, or null if unknown or not applicable.
  `final int`
  `roleFlags`
  Track role flags.
  `final String`
  `sampleMimeType`
  The mime type of the elementary stream (i.e.
  `final int`
  `selectionFlags`
  Track selection flags.

  ### Fields inherited from interface android.os.Parcelable

  `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SubtitleFormat`
  `copyWithManifestSubtitleFormatInfo(SubtitleFormat manifestSubtitleFormat)`
  `SubtitleFormat`
  `copyWithManifestSubtitleFormatInfo(SubtitleFormat manifestSubtitleFormat, boolean forceInStreamDrmInitData)`
  `static SubtitleFormat`
  `createTextSampleSubtitleFormat(String id, String label, int selectionFlags, int roleFlags, int bitrate, String codecs, String containerMimeType, String sampleMimeType, List<byte[]> initializationData, DrmInitData drmInitData, String language, String originalLanguage, int accessibilityChannel)`
  `static SubtitleFormat`
  `createTextSampleSubtitleFormat(String id, String sampleMimeType, int selectionFlags, String language, List<byte[]> initializationData)`
  `static SubtitleFormat`
  `createTextSampleSubtitleFormat(String id, String sampleMimeType, String codecs, int bitrate, int selectionFlags, String language, int accessibilityChannel, DrmInitData drmInitData)`
  `int`
  `describeContents()`
  `boolean`
  `equals(Object obj)`
  `int`
  `hashCode()`
  `boolean`
  `initializationDataEquals(SubtitleFormat other)`
  Returns whether the `initializationData`s belonging to this SubtitleFormat and `other` are equal.
  `static String`
  `toLogString(SubtitleFormat SubtitleFormat)`
  Returns a prettier `String` than `toString()`, intended for logging.
  `String`
  `toString()`
  `void`
  `writeToParcel(Parcel dest, int flags)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### NO_VALUE

    public static final int NO_VALUE
    A value for various fields to indicate that the field's value is unknown or not applicable.
    See Also:
      - Constant Field Values

  - ### OFFSET_SAMPLE_RELATIVE

    public static final long OFFSET_SAMPLE_RELATIVE
    A value to indicate that subsample timestamps are relative to the timestamps of their parent samples.
    See Also:
      - Constant Field Values

  - ### id

    @Nullable public final String id
    An identifier for the SubtitleFormat, or null if unknown or not applicable.

  - ### label

    @Nullable public final String label
    The human readable label, or null if unknown or not applicable.

  - ### selectionFlags

    @SelectionFlags public final int selectionFlags
    Track selection flags.

  - ### roleFlags

    @RoleFlags public final int roleFlags
    Track role flags.

  - ### bitrate

    public final int bitrate
    The average bandwidth in bits per second, or `NO_VALUE` if unknown or not applicable.

  - ### codecs

    @Nullable public final String codecs
    Codecs of the SubtitleFormat as described in RFC 6381, or null if unknown or not applicable.

  - ### containerMimeType

    @Nullable public final String containerMimeType
    The mime type of the container, or null if unknown or not applicable.

  - ### sampleMimeType

    @Nullable public final String sampleMimeType
    The mime type of the elementary stream (i.e. the individual samples), or null if unknown or not applicable.

  - ### initializationData

    public final List<byte[]> initializationData
    Initialization data that must be provided to the decoder. Will not be null, but may be empty if initialization data is not required.

  - ### drmInitData

    @Nullable public final DrmInitData drmInitData
    DRM initialization data if the stream is protected, or null otherwise.

  - ### language

    @Nullable public final String language
    The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable.

  - ### originalLanguage

    @Nullable public final String originalLanguage
    The language as present in manifest language tag, or null if unknown or not applicable.

  - ### accessibilityChannel

    public final int accessibilityChannel
    The Accessibility channel, or `NO_VALUE` if not known or applicable.

  - ### CREATOR

    public static final Parcelable.Creator<SubtitleFormat> CREATOR

- ## Method Details

  - ### createTextSampleSubtitleFormat

    public static SubtitleFormat createTextSampleSubtitleFormat(@Nullable String id, @Nullable String sampleMimeType, @SelectionFlags int selectionFlags, @Nullable String language, @Nullable List<byte[]> initializationData)

  - ### createTextSampleSubtitleFormat

    public static SubtitleFormat createTextSampleSubtitleFormat(@Nullable String id, @Nullable String sampleMimeType, @Nullable String codecs, int bitrate, @SelectionFlags int selectionFlags, @Nullable String language, int accessibilityChannel, @Nullable DrmInitData drmInitData)

  - ### createTextSampleSubtitleFormat

    public static SubtitleFormat createTextSampleSubtitleFormat(@Nullable String id, @Nullable String label, @SelectionFlags int selectionFlags, @RoleFlags int roleFlags, int bitrate, @Nullable String codecs, @Nullable String containerMimeType, @Nullable String sampleMimeType, @Nullable List<byte[]> initializationData, @Nullable DrmInitData drmInitData, @Nullable String language, @Nullable String originalLanguage, int accessibilityChannel)

  - ### copyWithManifestSubtitleFormatInfo

    public SubtitleFormat copyWithManifestSubtitleFormatInfo(SubtitleFormat manifestSubtitleFormat)

  - ### copyWithManifestSubtitleFormatInfo

    public SubtitleFormat copyWithManifestSubtitleFormatInfo(SubtitleFormat manifestSubtitleFormat, boolean forceInStreamDrmInitData)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(@Nullable Object obj)
    Overrides:
      `equals` in class `Object`

  - ### initializationDataEquals

    public boolean initializationDataEquals(SubtitleFormat other)
    Returns whether the `initializationData`s belonging to this SubtitleFormat and `other` are equal.
    Parameters:
      `other` - The other SubtitleFormat whose `initializationData` is being compared.
    Returns:
      Whether the `initializationData`s belonging to this SubtitleFormat and `other` are equal.

  - ### toLogString

    public static String toLogString(@Nullable SubtitleFormat SubtitleFormat)
    Returns a prettier `String` than `toString()`, intended for logging.

  - ### describeContents

    public int describeContents()
    Specified by:
      `describeContents` in interface `Parcelable`

  - ### writeToParcel

    public void writeToParcel(Parcel dest, int flags)
    Specified by:
      `writeToParcel` in interface `Parcelable`