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 @interfaceCapture policies forAudioAttributes.static @interfaceFlags forAudioAttributes.static @interfaceAudio focus types.static @interfaceUsage types forAudioAttributes.static @interfaceFlags which can apply to a buffer containing a media sample.static @interfaceCrypto modes for a codec.static @interfaceTrack role flags.static @interfaceTrack selection flags.static @interfacestatic @interfaceVideo decoder output modes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final StringThe name of the ASCII charset.static final intstatic final intstatic final intstatic final intstatic final intstatic final intThe number of bits per byte.static final intIndicates that a buffer should be decoded but not rendered.static final intIndicates that a buffer is (at least partially) encrypted.static final intFlag for empty buffers that signal that the end of the stream was reached.static final intIndicates that a buffer has supplemental data.static final intIndicates that a buffer holds a synchronization sample.static final intIndicates that a buffer is known to contain the last media sample of the stream.static final intThe number of bytes per float.static final UUIDUUID for the ClearKey DRM scheme.static final UUIDUUID for the W3C Common PSSH box.static final intstatic final intstatic final intstatic final intstatic final intstatic final intRepresents an unset or unknown index.static final StringThe name of the ISO-8859-1 charset.static final StringRepresents an undetermined language as an ISO 639-2 language code.static final intRepresents an unset or unknown length.static final longThe number of microseconds in one second.static final longThe number of milliseconds in one second.static final longThe number of nanoseconds in one second.static final intRepresents an unset or unknown percentage.static final UUIDUUID for the PlayReady DRM scheme.static final intRepresents an unset or unknown position.static final intIndicates an alternate track.static final intIndicates the track contains captions.static final intIndicates the track contains commentary, for example from the director.static final intIndicates the track contains a textual description of music and sound.static final intIndicates the track contains an audio or textual description of a video track.static final intIndicates the track is in a different language from the original, for example dubbed audio or translated captions.static final intIndicates the track contains a text that has been edited for ease of reading.static final intIndicates the track contains information about a current emergency.static final intIndicates the track is designed for improved intelligibility of dialogue.static final intIndicates a main track.static final intIndicates the track contains a visual sign-language interpretation of an audio track.static final intIndicates the track contains subtitles.static final intIndicates a supplementary track, meaning the track has lower importance than the main track(s).static final intIndicates the track contains a transcription of spoken dialog.static final intIndicates the track is intended for trick play.static final StringThe name of the sans-serif font family.static final intIndicates that the player may choose to play the track in absence of an explicit user preference.static final intIndicates that the track should be selected if user preferences do not state otherwise.static final intIndicates that the track must be displayed.static final intA selection reason constant for an adaptive track selection.static final intApplications or extensions may define customSELECTION_REASON_*constants greater than or equal to this value.static final intA selection reason constant for an initial track selection.static final intA selection reason constant for an manual (i.e.static final intA selection reason constant for a trick play track selection.static final intA selection reason constant for selections whose reasons are unknown or unspecified.static final StringThe name of the serif font family.static final longSpecial constant representing a time corresponding to the end of a source.static final longSpecial constant representing an unset or unknown time or duration.static final intA type constant for audio tracks.static final intA type constant for camera motion tracks.static final intApplications or extensions may define customTRACK_TYPE_*constants greater than or equal to this value.static final intA type constant for tracks of some default type, where the type itself is unknown.static final intA type constant for metadata tracks.static final intA type constant for a dummy or empty track.static final intA type constant for text tracks.static final intA type constant for tracks of unknown type.static final intA type constant for video tracks.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final StringThe name of the UTF-16 charset.static final StringThe name of the UTF-16 little-endian charset.static final StringThe name of the UTF-8 charset.static final UUIDThe Nil UUID as defined by RFC4122.static final intVideo decoder output mode is not set.static final intVideo decoder output mode that renders 4:2:0 YUV planes directly to a surface.static final intVideo decoder output mode that outputs raw 4:2:0 YUV planes.static final UUIDUUID for the Widevine DRM scheme. -
Method Summary
Modifier and TypeMethodDescriptionstatic intgenerateAudioSessionIdV21(Context context) Returns a newly generated audio session identifier, orAudioManager.ERRORif an error occurred in which case audio playback may fail.static longmsToUs(long timeMs) Converts a time in milliseconds to the corresponding time in microseconds, preservingTIME_UNSETvalues andTIME_END_OF_SOURCEvalues.static longusToMs(long timeUs) Converts a time in microseconds to the corresponding time in milliseconds, preservingTIME_UNSETandTIME_END_OF_SOURCEvalues.
-
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- See Also:
-
CRYPTO_MODE_AES_CTR
public static final int CRYPTO_MODE_AES_CTR- See Also:
-
CRYPTO_MODE_AES_CBC
public static final int CRYPTO_MODE_AES_CBC- See Also:
-
ENCODING_INVALID
public static final int ENCODING_INVALID- See Also:
-
FLAG_AUDIBILITY_ENFORCED
public static final int FLAG_AUDIBILITY_ENFORCED- See Also:
-
USAGE_ALARM
public static final int USAGE_ALARM- See Also:
-
USAGE_ASSISTANCE_ACCESSIBILITY
public static final int USAGE_ASSISTANCE_ACCESSIBILITY- See Also:
-
USAGE_ASSISTANCE_NAVIGATION_GUIDANCE
public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE- See Also:
-
USAGE_ASSISTANCE_SONIFICATION
public static final int USAGE_ASSISTANCE_SONIFICATION- See Also:
-
USAGE_ASSISTANT
public static final int USAGE_ASSISTANT- See Also:
-
USAGE_GAME
public static final int USAGE_GAME- See Also:
-
USAGE_MEDIA
public static final int USAGE_MEDIA- See Also:
-
USAGE_NOTIFICATION
public static final int USAGE_NOTIFICATION- See Also:
-
USAGE_NOTIFICATION_COMMUNICATION_DELAYED
public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED- See Also:
-
USAGE_NOTIFICATION_COMMUNICATION_INSTANT
public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT- See Also:
-
USAGE_NOTIFICATION_COMMUNICATION_REQUEST
public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST- See Also:
-
USAGE_NOTIFICATION_EVENT
public static final int USAGE_NOTIFICATION_EVENT- See Also:
-
USAGE_NOTIFICATION_RINGTONE
public static final int USAGE_NOTIFICATION_RINGTONE- See Also:
-
USAGE_UNKNOWN
public static final int USAGE_UNKNOWN- See Also:
-
USAGE_VOICE_COMMUNICATION
public static final int USAGE_VOICE_COMMUNICATION- See Also:
-
USAGE_VOICE_COMMUNICATION_SIGNALLING
public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING- See Also:
-
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- See Also:
-
AUDIOFOCUS_GAIN
public static final int AUDIOFOCUS_GAIN- See Also:
-
AUDIOFOCUS_GAIN_TRANSIENT
public static final int AUDIOFOCUS_GAIN_TRANSIENT- See Also:
-
AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
public static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK- See Also:
-
AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
public static final int AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE- See Also:
-
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_UNSETandTIME_END_OF_SOURCEvalues.- 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_UNSETvalues andTIME_END_OF_SOURCEvalues.- Parameters:
timeMs- The time in milliseconds.- Returns:
- The corresponding time in microseconds.
-
generateAudioSessionIdV21
Returns a newly generated audio session identifier, orAudioManager.ERRORif an error occurred in which case audio playback may fail.- See Also:
-