Package com.castlabs.android.hybridads

# Class AdNativeVideoRenderer

java.lang.Object
com.google.android.exoplayer2.BaseRenderer
com.google.android.exoplayer2.video.SimpleDecoderVideoRenderer
com.castlabs.android.hybridads.AdNativeVideoRenderer

All Implemented Interfaces:
  `com.google.android.exoplayer2.drm.DrmSession.EventListener`, `com.google.android.exoplayer2.PlayerMessage.Target`, `com.google.android.exoplayer2.Renderer`, `com.google.android.exoplayer2.RendererCapabilities`

public class AdNativeVideoRenderer extends com.google.android.exoplayer2.video.SimpleDecoderVideoRenderer
Renders video frames using a native 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.State`

  ## 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.CodecImplementation, com.google.android.exoplayer2.RendererCapabilities.FormatSupport, com.google.android.exoplayer2.RendererCapabilities.Listener, com.google.android.exoplayer2.RendererCapabilities.TunnelingSupport`

- ## Field Summary

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

  `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, CODEC_IMPLEMENTATION_HARDWARE, CODEC_IMPLEMENTATION_MASK, CODEC_IMPLEMENTATION_SOFTWARE, FORMAT_EXCEEDS_CAPABILITIES, FORMAT_HANDLED, FORMAT_SUPPORT_MASK, FORMAT_UNSUPPORTED_DRM, FORMAT_UNSUPPORTED_SUBTYPE, FORMAT_UNSUPPORTED_TYPE, TUNNELING_NOT_SUPPORTED, TUNNELING_SUPPORT_MASK, TUNNELING_SUPPORTED`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AdNativeVideoRenderer(AdNativeDecoder decoder, com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, boolean rendererUsesSharedMemory, int sharedMemorySize, long allowedJoiningTimeMs, Handler eventHandler, PlayerConfig playerConfig, com.google.android.exoplayer2.video.VideoRendererEventListener eventListener, int maxDroppedFramesToNotify, int playerServiceInstance, long splicePts, long adDuration, HybridAdView hybridAdView)`
  Creates a new AdNativeVideoRenderer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `handleMessage(int messageType, Object message)`
  `boolean`
  `isReady()`
  `void`
  `render(long positionUs, long elapsedRealtimeUs)`

  ### Methods inherited from class com.google.android.exoplayer2.video.SimpleDecoderVideoRenderer

  `isEnded, supportsFormat`

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

  `clearListener, disable, enable, getCapabilities, getMediaClock, getReadingPositionUs, getState, getStream, getStreamOffsetUs, getTrackType, hasReadStreamToEnd, isCurrentStreamFinal, maybeThrowStreamError, onRenewed, release, replaceStream, reset, resetPosition, setCurrentStreamFinal, setIndex, 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

  `setOperatingRate`

- ## Constructor Details

  - ### AdNativeVideoRenderer

    public AdNativeVideoRenderer(AdNativeDecoder decoder, com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, boolean rendererUsesSharedMemory, int sharedMemorySize, long allowedJoiningTimeMs, @Nullable Handler eventHandler, PlayerConfig playerConfig, @Nullable com.google.android.exoplayer2.video.VideoRendererEventListener eventListener, int maxDroppedFramesToNotify, int playerServiceInstance, long splicePts, long adDuration, HybridAdView hybridAdView) throws CastlabsPlayerException
    Creates a new AdNativeVideoRenderer.
    Parameters:
      `decoder` - The decoder to use.
      `tunerhalPlayerService` - The tuner HAL player service.
      `rendererUsesSharedMemory` - Whether the renderer uses shared memory.
      `sharedMemorySize` - The size of the shared memory buffer.
      `allowedJoiningTimeMs` - The maximum duration for which this renderer can attempt to join an existing playback session, in milliseconds.
      `eventHandler` - A handler to use when delivering events to `eventListener`. May be null if delivery of events is not required.
      `playerConfig` - The player configuration.
      `eventListener` - A listener of events. May be null if delivery of events is not required.
      `maxDroppedFramesToNotify` - The maximum number of frames that can be dropped before the renderer is notified.
      `playerServiceInstance` - The player service instance.
      `splicePts` - The splice point in presentation timestamps (PTS).
      `adDuration` - The duration of the ad in presentation timestamps (PTS).
      `hybridAdView` - The hybrid ad view.
    Throws:
      `CastlabsPlayerException` - If an error occurs while initializing the renderer.

- ## Method Details

  - ### isReady

    public boolean isReady()
    Specified by:
      `isReady` in interface `com.google.android.exoplayer2.Renderer`
    Overrides:
      `isReady` in class `com.google.android.exoplayer2.video.SimpleDecoderVideoRenderer`

  - ### 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.video.SimpleDecoderVideoRenderer`
    Throws:
      `com.google.android.exoplayer2.ExoPlaybackException`

  - ### handleMessage

    public void handleMessage(int messageType, @Nullable Object message)
    Specified by:
      `handleMessage` in interface `com.google.android.exoplayer2.PlayerMessage.Target`
    Overrides:
      `handleMessage` in class `com.google.android.exoplayer2.BaseRenderer`