Class Constants
java.lang.Object
com.castlabs.sdk.base.subtitles.utilities.Constants
Defines constants used by the library.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Capture policies forAudioAttributes
.static @interface
Flags forAudioAttributes
.static @interface
Audio focus types.static @interface
Usage types forAudioAttributes
.static @interface
Flags which can apply to a buffer containing a media sample.static @interface
Crypto modes for a codec.static @interface
Track role flags.static @interface
Track selection flags.static @interface
static @interface
Video decoder output modes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final String
The name of the ASCII charset.static final int
static final int
static final int
static final int
static final int
static final int
The number of bits per byte.static final int
Indicates that a buffer should be decoded but not rendered.static final int
Indicates that a buffer is (at least partially) encrypted.static final int
Flag for empty buffers that signal that the end of the stream was reached.static final int
Indicates that a buffer has supplemental data.static final int
Indicates that a buffer holds a synchronization sample.static final int
Indicates that a buffer is known to contain the last media sample of the stream.static final int
The number of bytes per float.static final UUID
UUID for the ClearKey DRM scheme.static final UUID
UUID for the W3C Common PSSH box.static final int
static final int
static final int
static final int
static final int
static final int
Represents an unset or unknown index.static final String
The name of the ISO-8859-1 charset.static final String
Represents an undetermined language as an ISO 639-2 language code.static final int
Represents an unset or unknown length.static final long
The number of microseconds in one second.static final long
The number of milliseconds in one second.static final long
The number of nanoseconds in one second.static final int
Represents an unset or unknown percentage.static final UUID
UUID for the PlayReady DRM scheme.static final int
Represents an unset or unknown position.static final int
Indicates an alternate track.static final int
Indicates the track contains captions.static final int
Indicates the track contains commentary, for example from the director.static final int
Indicates the track contains a textual description of music and sound.static final int
Indicates the track contains an audio or textual description of a video track.static final int
Indicates the track is in a different language from the original, for example dubbed audio or translated captions.static final int
Indicates the track contains a text that has been edited for ease of reading.static final int
Indicates the track contains information about a current emergency.static final int
Indicates the track is designed for improved intelligibility of dialogue.static final int
Indicates a main track.static final int
Indicates the track contains a visual sign-language interpretation of an audio track.static final int
Indicates the track contains subtitles.static final int
Indicates a supplementary track, meaning the track has lower importance than the main track(s).static final int
Indicates the track contains a transcription of spoken dialog.static final int
Indicates the track is intended for trick play.static final String
The name of the sans-serif font family.static final int
Indicates that the player may choose to play the track in absence of an explicit user preference.static final int
Indicates that the track should be selected if user preferences do not state otherwise.static final int
Indicates that the track must be displayed.static final int
A selection reason constant for an adaptive track selection.static final int
Applications or extensions may define customSELECTION_REASON_*
constants greater than or equal to this value.static final int
A selection reason constant for an initial track selection.static final int
A selection reason constant for an manual (i.e.static final int
A selection reason constant for a trick play track selection.static final int
A selection reason constant for selections whose reasons are unknown or unspecified.static final String
The name of the serif font family.static final long
Special constant representing a time corresponding to the end of a source.static final long
Special constant representing an unset or unknown time or duration.static final int
A type constant for audio tracks.static final int
A type constant for camera motion tracks.static final int
Applications or extensions may define customTRACK_TYPE_*
constants greater than or equal to this value.static final int
A type constant for tracks of some default type, where the type itself is unknown.static final int
A type constant for metadata tracks.static final int
A type constant for a dummy or empty track.static final int
A type constant for text tracks.static final int
A type constant for tracks of unknown type.static final int
A type constant for video tracks.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String
The name of the UTF-16 charset.static final String
The name of the UTF-16 little-endian charset.static final String
The name of the UTF-8 charset.static final UUID
The Nil UUID as defined by RFC4122.static final int
Video decoder output mode is not set.static final int
Video decoder output mode that renders 4:2:0 YUV planes directly to a surface.static final int
Video decoder output mode that outputs raw 4:2:0 YUV planes.static final UUID
UUID for the Widevine DRM scheme. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
generateAudioSessionIdV21
(Context context) Returns a newly generated audio session identifier, orAudioManager.ERROR
if an error occurred in which case audio playback may fail.static long
msToUs
(long timeMs) Converts a time in milliseconds to the corresponding time in microseconds, preservingTIME_UNSET
values andTIME_END_OF_SOURCE
values.static long
usToMs
(long timeUs) Converts a time in microseconds to the corresponding time in milliseconds, preservingTIME_UNSET
andTIME_END_OF_SOURCE
values.
-
Field Details
-
TIME_END_OF_SOURCE
public static final long TIME_END_OF_SOURCESpecial constant representing a time corresponding to the end of a source. Suitable for use in any time base.- See Also:
-
TIME_UNSET
public static final long TIME_UNSETSpecial constant representing an unset or unknown time or duration. Suitable for use in any time base.- See Also:
-
INDEX_UNSET
public static final int INDEX_UNSETRepresents an unset or unknown index.- See Also:
-
POSITION_UNSET
public static final int POSITION_UNSETRepresents an unset or unknown position.- See Also:
-
LENGTH_UNSET
public static final int LENGTH_UNSETRepresents an unset or unknown length.- See Also:
-
PERCENTAGE_UNSET
public static final int PERCENTAGE_UNSETRepresents an unset or unknown percentage.- See Also:
-
MILLIS_PER_SECOND
public static final long MILLIS_PER_SECONDThe number of milliseconds in one second.- See Also:
-
MICROS_PER_SECOND
public static final long MICROS_PER_SECONDThe number of microseconds in one second.- See Also:
-
NANOS_PER_SECOND
public static final long NANOS_PER_SECONDThe number of nanoseconds in one second.- See Also:
-
BITS_PER_BYTE
public static final int BITS_PER_BYTEThe number of bits per byte.- See Also:
-
BYTES_PER_FLOAT
public static final int BYTES_PER_FLOATThe number of bytes per float.- See Also:
-
ASCII_NAME
The name of the ASCII charset.- See Also:
-
UTF8_NAME
The name of the UTF-8 charset.- See Also:
-
ISO88591_NAME
The name of the ISO-8859-1 charset.- See Also:
-
UTF16_NAME
The name of the UTF-16 charset.- See Also:
-
UTF16LE_NAME
The name of the UTF-16 little-endian charset.- See Also:
-
SERIF_NAME
The name of the serif font family.- See Also:
-
SANS_SERIF_NAME
The name of the sans-serif font family.- See Also:
-
TRACK_TYPE_UNKNOWN
public static final int TRACK_TYPE_UNKNOWNA type constant for tracks of unknown type.- See Also:
-
TRACK_TYPE_DEFAULT
public static final int TRACK_TYPE_DEFAULTA type constant for tracks of some default type, where the type itself is unknown.- See Also:
-
TRACK_TYPE_AUDIO
public static final int TRACK_TYPE_AUDIOA type constant for audio tracks.- See Also:
-
TRACK_TYPE_VIDEO
public static final int TRACK_TYPE_VIDEOA type constant for video tracks.- See Also:
-
TRACK_TYPE_TEXT
public static final int TRACK_TYPE_TEXTA type constant for text tracks.- See Also:
-
TRACK_TYPE_METADATA
public static final int TRACK_TYPE_METADATAA type constant for metadata tracks.- See Also:
-
TRACK_TYPE_CAMERA_MOTION
public static final int TRACK_TYPE_CAMERA_MOTIONA type constant for camera motion tracks.- See Also:
-
TRACK_TYPE_NONE
public static final int TRACK_TYPE_NONEA type constant for a dummy or empty track.- See Also:
-
TRACK_TYPE_CUSTOM_BASE
public static final int TRACK_TYPE_CUSTOM_BASEApplications or extensions may define customTRACK_TYPE_*
constants greater than or equal to this value.- See Also:
-
SELECTION_REASON_UNKNOWN
public static final int SELECTION_REASON_UNKNOWNA selection reason constant for selections whose reasons are unknown or unspecified.- See Also:
-
SELECTION_REASON_INITIAL
public static final int SELECTION_REASON_INITIALA selection reason constant for an initial track selection.- See Also:
-
SELECTION_REASON_MANUAL
public static final int SELECTION_REASON_MANUALA selection reason constant for an manual (i.e. user initiated) track selection.- See Also:
-
SELECTION_REASON_ADAPTIVE
public static final int SELECTION_REASON_ADAPTIVEA selection reason constant for an adaptive track selection.- See Also:
-
SELECTION_REASON_TRICK_PLAY
public static final int SELECTION_REASON_TRICK_PLAYA selection reason constant for a trick play track selection.- See Also:
-
SELECTION_REASON_CUSTOM_BASE
public static final int SELECTION_REASON_CUSTOM_BASEApplications or extensions may define customSELECTION_REASON_*
constants greater than or equal to this value.- See Also:
-
CRYPTO_MODE_UNENCRYPTED
public static final int CRYPTO_MODE_UNENCRYPTED -
CRYPTO_MODE_AES_CTR
public static final int CRYPTO_MODE_AES_CTR -
CRYPTO_MODE_AES_CBC
public static final int CRYPTO_MODE_AES_CBC -
ENCODING_INVALID
public static final int ENCODING_INVALID- See Also:
-
FLAG_AUDIBILITY_ENFORCED
public static final int FLAG_AUDIBILITY_ENFORCED -
USAGE_ALARM
public static final int USAGE_ALARM -
USAGE_ASSISTANCE_ACCESSIBILITY
public static final int USAGE_ASSISTANCE_ACCESSIBILITY -
USAGE_ASSISTANCE_NAVIGATION_GUIDANCE
public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE -
USAGE_ASSISTANCE_SONIFICATION
public static final int USAGE_ASSISTANCE_SONIFICATION -
USAGE_ASSISTANT
public static final int USAGE_ASSISTANT -
USAGE_GAME
public static final int USAGE_GAME -
USAGE_MEDIA
public static final int USAGE_MEDIA -
USAGE_NOTIFICATION
public static final int USAGE_NOTIFICATION -
USAGE_NOTIFICATION_COMMUNICATION_DELAYED
public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED -
USAGE_NOTIFICATION_COMMUNICATION_INSTANT
public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT -
USAGE_NOTIFICATION_COMMUNICATION_REQUEST
public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST -
USAGE_NOTIFICATION_EVENT
public static final int USAGE_NOTIFICATION_EVENT -
USAGE_NOTIFICATION_RINGTONE
public static final int USAGE_NOTIFICATION_RINGTONE -
USAGE_UNKNOWN
public static final int USAGE_UNKNOWN -
USAGE_VOICE_COMMUNICATION
public static final int USAGE_VOICE_COMMUNICATION -
USAGE_VOICE_COMMUNICATION_SIGNALLING
public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING -
ALLOW_CAPTURE_BY_ALL
public static final int ALLOW_CAPTURE_BY_ALL- See Also:
-
ALLOW_CAPTURE_BY_NONE
public static final int ALLOW_CAPTURE_BY_NONE- See Also:
-
ALLOW_CAPTURE_BY_SYSTEM
public static final int ALLOW_CAPTURE_BY_SYSTEM- See Also:
-
AUDIOFOCUS_NONE
public static final int AUDIOFOCUS_NONE -
AUDIOFOCUS_GAIN
public static final int AUDIOFOCUS_GAIN -
AUDIOFOCUS_GAIN_TRANSIENT
public static final int AUDIOFOCUS_GAIN_TRANSIENT -
AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
public static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK -
AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
public static final int AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE -
BUFFER_FLAG_KEY_FRAME
public static final int BUFFER_FLAG_KEY_FRAMEIndicates that a buffer holds a synchronization sample.- See Also:
-
BUFFER_FLAG_END_OF_STREAM
public static final int BUFFER_FLAG_END_OF_STREAMFlag for empty buffers that signal that the end of the stream was reached.- See Also:
-
BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA
public static final int BUFFER_FLAG_HAS_SUPPLEMENTAL_DATAIndicates that a buffer has supplemental data.- See Also:
-
BUFFER_FLAG_LAST_SAMPLE
public static final int BUFFER_FLAG_LAST_SAMPLEIndicates that a buffer is known to contain the last media sample of the stream.- See Also:
-
BUFFER_FLAG_ENCRYPTED
public static final int BUFFER_FLAG_ENCRYPTEDIndicates that a buffer is (at least partially) encrypted.- See Also:
-
BUFFER_FLAG_DECODE_ONLY
public static final int BUFFER_FLAG_DECODE_ONLYIndicates that a buffer should be decoded but not rendered.- See Also:
-
VIDEO_OUTPUT_MODE_NONE
public static final int VIDEO_OUTPUT_MODE_NONEVideo decoder output mode is not set.- See Also:
-
VIDEO_OUTPUT_MODE_YUV
public static final int VIDEO_OUTPUT_MODE_YUVVideo decoder output mode that outputs raw 4:2:0 YUV planes.- See Also:
-
VIDEO_OUTPUT_MODE_SURFACE_YUV
public static final int VIDEO_OUTPUT_MODE_SURFACE_YUVVideo decoder output mode that renders 4:2:0 YUV planes directly to a surface.- See Also:
-
SELECTION_FLAG_DEFAULT
public static final int SELECTION_FLAG_DEFAULTIndicates that the track should be selected if user preferences do not state otherwise.- See Also:
-
SELECTION_FLAG_FORCED
public static final int SELECTION_FLAG_FORCEDIndicates that the track must be displayed. Only applies to text tracks.- See Also:
-
SELECTION_FLAG_AUTOSELECT
public static final int SELECTION_FLAG_AUTOSELECTIndicates that the player may choose to play the track in absence of an explicit user preference.- See Also:
-
LANGUAGE_UNDETERMINED
Represents an undetermined language as an ISO 639-2 language code.- See Also:
-
UUID_NIL
The Nil UUID as defined by RFC4122. -
COMMON_PSSH_UUID
UUID for the W3C Common PSSH box. -
CLEARKEY_UUID
UUID for the ClearKey DRM scheme.ClearKey is supported on Android devices running Android 5.0 (API Level 21) and up.
-
WIDEVINE_UUID
UUID for the Widevine DRM scheme.Widevine is supported on Android devices running Android 4.3 (API Level 18) and up.
-
PLAYREADY_UUID
UUID for the PlayReady DRM scheme.PlayReady is supported on all AndroidTV devices. Note that most other Android devices do not provide PlayReady support.
-
ROLE_FLAG_MAIN
public static final int ROLE_FLAG_MAINIndicates a main track.- See Also:
-
ROLE_FLAG_ALTERNATE
public static final int ROLE_FLAG_ALTERNATEIndicates an alternate track. For example a video track recorded from an different view point than the main track(s).- See Also:
-
ROLE_FLAG_SUPPLEMENTARY
public static final int ROLE_FLAG_SUPPLEMENTARYIndicates a supplementary track, meaning the track has lower importance than the main track(s). For example a video track that provides a visual accompaniment to a main audio track.- See Also:
-
ROLE_FLAG_COMMENTARY
public static final int ROLE_FLAG_COMMENTARYIndicates the track contains commentary, for example from the director.- See Also:
-
ROLE_FLAG_DUB
public static final int ROLE_FLAG_DUBIndicates the track is in a different language from the original, for example dubbed audio or translated captions.- See Also:
-
ROLE_FLAG_EMERGENCY
public static final int ROLE_FLAG_EMERGENCYIndicates the track contains information about a current emergency.- See Also:
-
ROLE_FLAG_CAPTION
public static final int ROLE_FLAG_CAPTIONIndicates the track contains captions. This flag may be set on video tracks to indicate the presence of burned in captions.- See Also:
-
ROLE_FLAG_SUBTITLE
public static final int ROLE_FLAG_SUBTITLEIndicates the track contains subtitles. This flag may be set on video tracks to indicate the presence of burned in subtitles.- See Also:
-
ROLE_FLAG_SIGN
public static final int ROLE_FLAG_SIGNIndicates the track contains a visual sign-language interpretation of an audio track.- See Also:
-
ROLE_FLAG_DESCRIBES_VIDEO
public static final int ROLE_FLAG_DESCRIBES_VIDEOIndicates the track contains an audio or textual description of a video track.- See Also:
-
ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND
public static final int ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUNDIndicates the track contains a textual description of music and sound.- See Also:
-
ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY
public static final int ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITYIndicates the track is designed for improved intelligibility of dialogue.- See Also:
-
ROLE_FLAG_TRANSCRIBES_DIALOG
public static final int ROLE_FLAG_TRANSCRIBES_DIALOGIndicates the track contains a transcription of spoken dialog.- See Also:
-
ROLE_FLAG_EASY_TO_READ
public static final int ROLE_FLAG_EASY_TO_READIndicates the track contains a text that has been edited for ease of reading.- See Also:
-
ROLE_FLAG_TRICK_PLAY
public static final int ROLE_FLAG_TRICK_PLAYIndicates the track is intended for trick play.- See Also:
-
-
Method Details
-
usToMs
public static long usToMs(long timeUs) Converts a time in microseconds to the corresponding time in milliseconds, preservingTIME_UNSET
andTIME_END_OF_SOURCE
values.- Parameters:
timeUs
- The time in microseconds.- Returns:
- The corresponding time in milliseconds.
-
msToUs
public static long msToUs(long timeMs) Converts a time in milliseconds to the corresponding time in microseconds, preservingTIME_UNSET
values andTIME_END_OF_SOURCE
values.- Parameters:
timeMs
- The time in milliseconds.- Returns:
- The corresponding time in microseconds.
-
generateAudioSessionIdV21
Returns a newly generated audio session identifier, orAudioManager.ERROR
if an error occurred in which case audio playback may fail.- See Also:
-