Class SubtitleParserHelper

java.lang.Object
com.castlabs.sdk.base.subtitles.SubtitleParserHelper
All Implemented Interfaces:
Handler.Callback

public class SubtitleParserHelper extends Object implements Handler.Callback
  • Field Details

  • Constructor Details

    • SubtitleParserHelper

      public SubtitleParserHelper(@NonNull Looper looper, Handler rendererHandler)
      Parameters:
      looper - The Looper associated with the thread on which parsing should occur.
      rendererHandler - the ui thread parserHandler
  • Method Details

    • imagePool

      public ImagePool 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

      @Nullable public BaseSubtitleInputBuffer 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

      public void setFormat(SubtitleFormat format)
      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

      public void initializeWithWebvtt(String text) throws Exception
      Throws:
      Exception
    • handleMessage

      public boolean handleMessage(Message msg)
      Specified by:
      handleMessage in interface Handler.Callback
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable