Package com.castlabs.sdk.debug

# Class DebugPlugin.Builder

java.lang.Object
com.castlabs.sdk.debug.DebugPlugin.Builder

Enclosing class:
  `DebugPlugin`

public static class DebugPlugin.Builder extends Object
Use this builder to create new instances of the `DebugPlugin`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Constructs a new Builder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DebugPlugin.Builder`
  `debugOverlay(boolean value)`
  Enables or disables the debug overlay.
  `DebugPlugin.Builder`
  `debugOverlayPosition(DebugPlugin.DebugOverlayPosition value)`
  Sets the position of the debug overlay.
  `DebugPlugin.Builder`
  `enableRateLimiter(boolean value, long initialLimitBps)`
  Enabled or disable rate limiting and set the initial rate limit.
  `DebugPlugin`
  `get()`
  Create an instance of the debug plugin from this builder.
  `DebugPlugin.Builder`
  `logAll(boolean value)`
  Enable or disable all debug logging
  `DebugPlugin.Builder`
  `logAudioPtsParsing(boolean value)`
  If enabled, logs audio PTS at parsing time.
  `DebugPlugin.Builder`
  `logAudioRendererEvents(boolean value)`
  If enabled, logs audio renderer events.
  `DebugPlugin.Builder`
  `logDecoderCounters(boolean value)`
  If enabled, logs decoder counters.
  `DebugPlugin.Builder`
  `logDownloadCanceled(boolean value)`
  If enabled, logs when a download is canceled.
  `DebugPlugin.Builder`
  `logDownloadCompleted(boolean value)`
  If enabled, logs when a download completes.
  `DebugPlugin.Builder`
  `logDownloadError(boolean value)`
  If enabled, logs download errors.
  `DebugPlugin.Builder`
  `logDownloadStarted(boolean value)`
  If enabled, logs when a download starts.
  `DebugPlugin.Builder`
  `logDownloadUpstreamDiscarded(boolean value)`
  If enabled, logs when downloaded data is discarded from upstream.
  `DebugPlugin.Builder`
  `logHlsTagParsing(boolean value)`
  If enabled, logs HLS tag parsing details.
  `DebugPlugin.Builder`
  `logLoadControl(boolean value)`
  If enabled, logs load control events.
  `DebugPlugin.Builder`
  `logOpenBundle(boolean value)`
  If enabled, Bundle key values pairs passed to `PlayerController.open(Bundle)` will be logged.
  `DebugPlugin.Builder`
  `logPeriodInfo(boolean logPeriodInfo)`
  Enables logging for period change events.
  `DebugPlugin.Builder`
  `logRequestType(int type)`
  Adds a request type to be logged.
  `DebugPlugin.Builder`
  `logResponseType(int type)`
  Adds a response type to be logged.
  `DebugPlugin.Builder`
  `logSupportedDrm(boolean value)`
  If enabled, logs supported DRM systems.
  `DebugPlugin.Builder`
  `logTimingDebugInfo(boolean value)`
  If enabled, logs timing debug information.
  `DebugPlugin.Builder`
  `logTransferInfo(boolean logTransferInfo)`
  Enables detailed logging for network transfer events.
  `DebugPlugin.Builder`
  `logVideoFrameMetadata(boolean value, long logAVSyncThresholdUs, long logMeanAndDeviationPeriodUs)`
  Enable or disable the AV sync measurements.
  `DebugPlugin.Builder`
  `logVideoRendererEvents(boolean value)`
  If enabled, logs video renderer events.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new Builder.

- ## Method Details

  - ### logAll

    @NonNull public DebugPlugin.Builder logAll(boolean value)
    Enable or disable all debug logging
    Parameters:
      `value` - The value
    Returns:
      The builder

  - ### logOpenBundle

    @NonNull public DebugPlugin.Builder logOpenBundle(boolean value)
    If enabled, Bundle key values pairs passed to `PlayerController.open(Bundle)` will be logged.
    Parameters:
      `value` - enable or disable
    Returns:
      The builder

  - ### logDownloadStarted

    @NonNull public DebugPlugin.Builder logDownloadStarted(boolean value)
    If enabled, logs when a download starts.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logDownloadCompleted

    @NonNull public DebugPlugin.Builder logDownloadCompleted(boolean value)
    If enabled, logs when a download completes.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logDownloadCanceled

    @NonNull public DebugPlugin.Builder logDownloadCanceled(boolean value)
    If enabled, logs when a download is canceled.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logDownloadUpstreamDiscarded

    public DebugPlugin.Builder logDownloadUpstreamDiscarded(boolean value)
    If enabled, logs when downloaded data is discarded from upstream.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logVideoRendererEvents

    @NonNull public DebugPlugin.Builder logVideoRendererEvents(boolean value)
    If enabled, logs video renderer events.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logAudioRendererEvents

    @NonNull public DebugPlugin.Builder logAudioRendererEvents(boolean value)
    If enabled, logs audio renderer events.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logDecoderCounters

    @NonNull public DebugPlugin.Builder logDecoderCounters(boolean value)
    If enabled, logs decoder counters.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### debugOverlay

    @NonNull public DebugPlugin.Builder debugOverlay(boolean value)
    Enables or disables the debug overlay.

    By default the Debug overlay is not shown. In order to show it you need to enable it upon playback start as follows:

         OverlayControllerComponent overlayController = DebugPlugin.getOverlayController(playerController);
         if (overlayController != null) {
           overlayController.enableDebugOverlay();
         }

    Parameters:
      `value` - true to enable the debug overlay, false to disable.
    Returns:
      The builder.

  - ### debugOverlayPosition

    public DebugPlugin.Builder debugOverlayPosition(DebugPlugin.DebugOverlayPosition value)
    Sets the position of the debug overlay.
    Parameters:
      `value` - The desired position of the debug overlay.
    Returns:
      The builder.

  - ### logDownloadError

    @NonNull public DebugPlugin.Builder logDownloadError(boolean value)
    If enabled, logs download errors.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logSupportedDrm

    public DebugPlugin.Builder logSupportedDrm(boolean value)
    If enabled, logs supported DRM systems.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logLoadControl

    @NonNull public DebugPlugin.Builder logLoadControl(boolean value)
    If enabled, logs load control events.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logTimingDebugInfo

    @NonNull public DebugPlugin.Builder logTimingDebugInfo(boolean value)
    If enabled, logs timing debug information.
    Parameters:
      `value` - true to enable logging, false to disable.
    Returns:
      The builder.

  - ### logHlsTagParsing

    @NonNull public DebugPlugin.Builder logHlsTagParsing(boolean value)
    If enabled, logs HLS tag parsing details.
    Parameters:
      `value` - true to enable logging, false otherwise.
    Returns:
      The builder.

  - ### logAudioPtsParsing

    @NonNull public DebugPlugin.Builder logAudioPtsParsing(boolean value)
    If enabled, logs audio PTS at parsing time.
    Parameters:
      `value` - true to enable logging, false otherwise.
    Returns:
      The builder.

  - ### logRequestType

    @NonNull public DebugPlugin.Builder logRequestType(int type)
    Adds a request type to be logged.
    Parameters:
      `type` - The request type to log.
    Returns:
      The builder.

  - ### logResponseType

    @NonNull public DebugPlugin.Builder logResponseType(int type)
    Adds a response type to be logged.
    Parameters:
      `type` - The response type to log.
    Returns:
      The builder.

  - ### enableRateLimiter

    @NonNull public DebugPlugin.Builder enableRateLimiter(boolean value, long initialLimitBps)
    Enabled or disable rate limiting and set the initial rate limit. A value < 0 will disable rate limiting.
    Parameters:
      `value` - Enable or disable the rate limiter
      `initialLimitBps` - The initial rate limit
    Returns:
      The builder

  - ### logVideoFrameMetadata

    @NonNull public DebugPlugin.Builder logVideoFrameMetadata(boolean value, long logAVSyncThresholdUs, long logMeanAndDeviationPeriodUs)
    Enable or disable the AV sync measurements. Setup a threshold when to log AV sync values, per frame. Setup a period to log AV sync calculated mean and deviation values.
    Parameters:
      `value` - Enable or disable the measurements
      `logAVSyncThresholdUs` - AV sync threshold in us, exceeding which will result in logging PTS and calculated AV sync values per frame
      `logMeanAndDeviationPeriodUs` - Period in us, how frequent to log AV sync mean and deviation values
    Returns:
      The builder

  - ### logTransferInfo

    @NonNull public DebugPlugin.Builder logTransferInfo(boolean logTransferInfo)
    Enables detailed logging for network transfer events. Note that this provoke a lot of logging.
    Parameters:
      `logTransferInfo` - Enable or disable transfer info logging.
    Returns:
      The builder

  - ### logPeriodInfo

    @NonNull public DebugPlugin.Builder logPeriodInfo(boolean logPeriodInfo)
    Enables logging for period change events.
    Parameters:
      `logPeriodInfo` - Enable or disable logging.
    Returns:
      The builder

  - ### get

    @NonNull public DebugPlugin get()
    Create an instance of the debug plugin from this builder.
    Returns:
      The debug plugin instance