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 @interfacestatic @interfacestatic @interfacestatic @interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the input buffer for subsequent read operationvoidInternal method that sends a dispose indicator to the background thread that will remove the native instance of this helpervoidenqueueInputBuffer(BaseSubtitleInputBuffer buffer, String baseUrl, boolean parse) Sets the input buffer after a read operationprotected voidfinalize()voidflush()Flushes the helper, canceling the current parsing operation, if there is one.booleanhandleMessage(Message msg) voidinitializeWithWebvtt(String text) voidsetFormat(SubtitleFormat format) Sets the format of subsequent samples.voidupdatePlayerPosition(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- TheLooperassociated 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
nullotherwise
-
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:
handleMessagein interfaceHandler.Callback
-
finalize
-