Package com.castlabs.android.hybridads

# Class AdNativeAudioRenderer

java.lang.Object
com.google.android.exoplayer2.BaseRenderer
com.google.android.exoplayer2.audio.DecoderAudioRenderer<AdNativeAudioDecoder>
com.castlabs.android.hybridads.AdNativeAudioRenderer

All Implemented Interfaces:
  `com.google.android.exoplayer2.PlayerMessage.Target`, `com.google.android.exoplayer2.Renderer`, `com.google.android.exoplayer2.RendererCapabilities`, `com.google.android.exoplayer2.util.MediaClock`

public class AdNativeAudioRenderer extends com.google.android.exoplayer2.audio.DecoderAudioRenderer<AdNativeAudioDecoder>
Renders audio that is decoded by a native audio decoder.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.google.android.exoplayer2.BaseRenderer

  `com.google.android.exoplayer2.BaseRenderer.RendererStreamException`

  ## Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Renderer

  `com.google.android.exoplayer2.Renderer.Listener, com.google.android.exoplayer2.Renderer.MessageType, com.google.android.exoplayer2.Renderer.State, com.google.android.exoplayer2.Renderer.WakeupListener`

  ## Nested classes/interfaces inherited from interface com.google.android.exoplayer2.RendererCapabilities

  `com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport, com.google.android.exoplayer2.RendererCapabilities.Capabilities, com.google.android.exoplayer2.RendererCapabilities.DecoderSupport, com.google.android.exoplayer2.RendererCapabilities.FormatSupport, com.google.android.exoplayer2.RendererCapabilities.HardwareAccelerationSupport, com.google.android.exoplayer2.RendererCapabilities.Listener, com.google.android.exoplayer2.RendererCapabilities.TunnelingSupport`

- ## Field Summary

  ### Fields inherited from interface com.google.android.exoplayer2.Renderer

  `MSG_CUSTOM_BASE, MSG_SET_AUDIO_ATTRIBUTES, MSG_SET_AUDIO_SESSION_ID, MSG_SET_AUX_EFFECT_INFO, MSG_SET_CAMERA_MOTION_LISTENER, MSG_SET_CHANGE_FRAME_RATE_STRATEGY, MSG_SET_EVENT_MESSAGE_CUE_EVENT, MSG_SET_PREFERRED_AUDIO_DEVICE, MSG_SET_SCALING_MODE, MSG_SET_SKIP_SILENCE_ENABLED, MSG_SET_VIDEO_EFFECTS, MSG_SET_VIDEO_FRAME_METADATA_LISTENER, MSG_SET_VIDEO_OUTPUT, MSG_SET_VIDEO_OUTPUT_RESOLUTION, MSG_SET_VOLUME, MSG_SET_WAKEUP_LISTENER, STATE_DISABLED, STATE_ENABLED, STATE_STARTED`

  ### Fields inherited from interface com.google.android.exoplayer2.RendererCapabilities

  `ADAPTIVE_NOT_SEAMLESS, ADAPTIVE_NOT_SUPPORTED, ADAPTIVE_SEAMLESS, ADAPTIVE_SUPPORT_MASK, DECODER_SUPPORT_FALLBACK, DECODER_SUPPORT_FALLBACK_MIMETYPE, DECODER_SUPPORT_PRIMARY, FORMAT_EXCEEDS_CAPABILITIES, FORMAT_HANDLED, FORMAT_SUPPORT_MASK, FORMAT_UNSUPPORTED_DRM, FORMAT_UNSUPPORTED_SUBTYPE, FORMAT_UNSUPPORTED_TYPE, HARDWARE_ACCELERATION_NOT_SUPPORTED, HARDWARE_ACCELERATION_SUPPORT_MASK, HARDWARE_ACCELERATION_SUPPORTED, MODE_SUPPORT_MASK, TUNNELING_NOT_SUPPORTED, TUNNELING_SUPPORT_MASK, TUNNELING_SUPPORTED`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AdNativeAudioRenderer(AdNativeDecoder decoder, com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, boolean rendererUsesSharedMemory, int sharedMemorySizeInBytes, Handler eventHandler, PlayerConfig playerConfig, com.google.android.exoplayer2.audio.AudioRendererEventListener eventListener, int playerServiceInstance, long splicePts, long adDuration, HybridAdView hybridAdView)`
  Creates a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName()`
  `long`
  `getPositionUs()`
  `boolean`
  `isReady()`
  `void`
  `render(long positionUs, long elapsedRealtimeUs)`

  ### Methods inherited from class com.google.android.exoplayer2.audio.DecoderAudioRenderer

  `experimentalSetEnableKeepAudioTrackOnSeek, getMediaClock, getPlaybackParameters, handleMessage, isEnded, setPlaybackParameters, supportsFormat`

  ### Methods inherited from class com.google.android.exoplayer2.BaseRenderer

  `clearListener, disable, enable, getCapabilities, getReadingPositionUs, getState, getStream, getStreamOffsetUs, getTrackType, hasReadStreamToEnd, init, isCurrentStreamFinal, maybeThrowStreamError, release, replaceStream, reset, resetPosition, setCurrentStreamFinal, setListener, setListener, setRenderingIntervalManager, start, stop, supportsMixedMimeTypeAdaptation`

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

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

  ### Methods inherited from interface com.google.android.exoplayer2.Renderer

  `setPlaybackSpeed`

- ## Constructor Details

  - ### AdNativeAudioRenderer

    public AdNativeAudioRenderer(AdNativeDecoder decoder, com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, boolean rendererUsesSharedMemory, int sharedMemorySizeInBytes, @Nullable Handler eventHandler, PlayerConfig playerConfig, @Nullable com.google.android.exoplayer2.audio.AudioRendererEventListener eventListener, int playerServiceInstance, long splicePts, long adDuration, HybridAdView hybridAdView) throws CastlabsPlayerException
    Creates a new instance.
    Parameters:
      `decoder` - The decoder to use.
      `tunerhalPlayerService` - The player service to use.
      `rendererUsesSharedMemory` - Whether the renderer uses shared memory.
      `sharedMemorySizeInBytes` - The size of the shared memory in bytes.
      `eventHandler` - A handler to use when delivering events to `eventListener`. May be null if delivery of events is not required.
      `playerConfig` - The player config to use.
      `eventListener` - A listener of events. May be null if delivery of events is not required.
      `playerServiceInstance` - The player service instance to use.
      `splicePts` - The splice point in presentation timestamps (PTS).
      `adDuration` - The duration of the ad in presentation timestamps (PTS).
      `hybridAdView` - The hybrid ad view to use.
    Throws:
      `CastlabsPlayerException` - If an error occurs.

- ## Method Details

  - ### isReady

    public boolean isReady()
    Specified by:
      `isReady` in interface `com.google.android.exoplayer2.Renderer`
    Overrides:
      `isReady` in class `com.google.android.exoplayer2.audio.DecoderAudioRenderer<AdNativeAudioDecoder>`

  - ### getName

    @NonNull public String getName()

  - ### render

    public void render(long positionUs, long elapsedRealtimeUs) throws com.google.android.exoplayer2.ExoPlaybackException
    Specified by:
      `render` in interface `com.google.android.exoplayer2.Renderer`
    Overrides:
      `render` in class `com.google.android.exoplayer2.audio.DecoderAudioRenderer<AdNativeAudioDecoder>`
    Throws:
      `com.google.android.exoplayer2.ExoPlaybackException`

  - ### getPositionUs

    public long getPositionUs()
    Specified by:
      `getPositionUs` in interface `com.google.android.exoplayer2.util.MediaClock`
    Overrides:
      `getPositionUs` in class `com.google.android.exoplayer2.audio.DecoderAudioRenderer<AdNativeAudioDecoder>`