Package com.castlabs.android.hybridads

# Class HybridAdTrackRendererBuilder

java.lang.Object
com.castlabs.android.hybridads.HybridAdTrackRendererBuilder

All Implemented Interfaces:
  `TrackRendererPlugin.TrackRendererBuilder`

public class HybridAdTrackRendererBuilder extends Object implements TrackRendererPlugin.TrackRendererBuilder
A TrackRendererBuilder that creates renderers for hybrid ads. These renderers use a native decoder to decode ad content.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HybridAdTrackRendererBuilder(com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, int playerServiceInstance, long splicePts, long adDuration, HybridAdView view, boolean doesVideoUseSharedMemory, boolean doesAudioUseSharedMemory, int videoSharedMemorySizeInBytes, int audioSharedMemorySizeInBytes)`
  Creates a new HybridAdTrackRendererBuilder.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TrackRendererPlugin.TrackRendererContainer`
  `createRenderer(TrackRendererPlugin.Type type, PlayerController playerController, DrmConfiguration configuration)`
  `com.google.android.exoplayer2.RendererCapabilities`
  `getRendererCapabilities(Context context, TrackRendererPlugin.Type type, DrmConfiguration drmConfiguration)`
  `boolean`
  `isDefault()`
  `boolean`
  `isTypeSupported(TrackRendererPlugin.Type type, DrmConfiguration configuration)`

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

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

- ## Constructor Details

  - ### HybridAdTrackRendererBuilder

    public HybridAdTrackRendererBuilder(com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, int playerServiceInstance, long splicePts, long adDuration, HybridAdView view, boolean doesVideoUseSharedMemory, boolean doesAudioUseSharedMemory, int videoSharedMemorySizeInBytes, int audioSharedMemorySizeInBytes)
    Creates a new HybridAdTrackRendererBuilder.
    Parameters:
      `tunerhalPlayerService` - The player service to use for ad playback.
      `playerServiceInstance` - The instance of the player service.
      `splicePts` - The presentation timestamp (PTS) at which the ad should be spliced into the main content.
      `adDuration` - The duration of the ad in microseconds.
      `view` - The HybridAdView that will display the ad.
      `doesVideoUseSharedMemory` - Whether the video renderer should use shared memory.
      `doesAudioUseSharedMemory` - Whether the audio renderer should use shared memory.
      `videoSharedMemorySizeInBytes` - The size of the shared memory for video in bytes.
      `audioSharedMemorySizeInBytes` - The size of the shared memory for audio in bytes.

- ## Method Details

  - ### isTypeSupported

    public boolean isTypeSupported(@NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration configuration)
    Specified by:
      `isTypeSupported` in interface `TrackRendererPlugin.TrackRendererBuilder`

  - ### isDefault

    public boolean isDefault()
    Specified by:
      `isDefault` in interface `TrackRendererPlugin.TrackRendererBuilder`

  - ### getRendererCapabilities

    @Nullable public com.google.android.exoplayer2.RendererCapabilities getRendererCapabilities(@NonNull Context context, @NonNull TrackRendererPlugin.Type type, @Nullable DrmConfiguration drmConfiguration)
    Specified by:
      `getRendererCapabilities` in interface `TrackRendererPlugin.TrackRendererBuilder`

  - ### createRenderer

    @Nullable public TrackRendererPlugin.TrackRendererContainer createRenderer(@NonNull TrackRendererPlugin.Type type, @NonNull PlayerController playerController, @Nullable DrmConfiguration configuration) throws CastlabsPlayerException
    Specified by:
      `createRenderer` in interface `TrackRendererPlugin.TrackRendererBuilder`
    Throws:
      `CastlabsPlayerException`