Package com.castlabs.sdk.base.subtitles
Class SubtitleParserHelper
java.lang.Object
com.castlabs.sdk.base.subtitles.SubtitleParserHelper
- All Implemented Interfaces:
Handler.Callback
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
static @interface
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the input buffer for subsequent read operationvoid
Internal method that sends a dispose indicator to the background thread that will remove the native instance of this helpervoid
enqueueInputBuffer
(BaseSubtitleInputBuffer buffer, String baseUrl, boolean parse) Sets the input buffer after a read operationprotected void
finalize()
void
flush()
Flushes the helper, canceling the current parsing operation, if there is one.boolean
handleMessage
(Message msg) void
initializeWithWebvtt
(String text) void
setFormat
(SubtitleFormat format) Sets the format of subsequent samples.void
updatePlayerPosition
(long playerPositionUs) Sets the current player position.
-
Field Details
-
MIME_TYPE_VTT
- See Also:
-
MIME_TYPE_MP4_VTT
- See Also:
-
MIME_TYPE_TTML
- See Also:
-
MIME_TYPE_SRT
- See Also:
-
MIME_TYPE_CEA608
- See Also:
-
MIME_TYPE_DVBSUBS
- See Also:
-
MIME_TYPE_DVBTTX
- See Also:
-
-
Constructor Details
-
SubtitleParserHelper
- Parameters:
looper
- TheLooper
associated with the thread on which parsing should occur.rendererHandler
- the ui thread parserHandler
-
-
Method Details
-
imagePool
-
disposeWhenReady
public void disposeWhenReady()Internal method that sends a dispose indicator to the background thread that will remove the native instance of this helper -
flush
public void flush()Flushes the helper, canceling the current parsing operation, if there is one. -
dequeueInputBuffer
Gets the input buffer for subsequent read operation- Returns:
- Available input buffer or
null
otherwise
-
enqueueInputBuffer
public void enqueueInputBuffer(@NonNull BaseSubtitleInputBuffer buffer, @NonNull String baseUrl, boolean parse) Sets the input buffer after a read operation- Parameters:
buffer
- The input buffer with data read
-
setFormat
Sets the format of subsequent samples.- Parameters:
format
- The format.
-
updatePlayerPosition
public void updatePlayerPosition(long playerPositionUs) Sets the current player position.- Parameters:
playerPositionUs
- Current player position in microseconds
-
initializeWithWebvtt
- Throws:
Exception
-
handleMessage
- Specified by:
handleMessage
in interfaceHandler.Callback
-
finalize
-