Java 类com.google.android.exoplayer2.video.VideoRendererEventListener 实例源码

项目:Exoplayer2Radio    文件:DefaultRenderersFactory.java   
@Override
public Renderer[] createRenderers(Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextRenderer.Output textRendererOutput, MetadataRenderer.Output metadataRendererOutput) {
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
      eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
  buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
      eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[renderersList.size()]);
}
项目:no-player    文件:SimpleRenderersFactory.java   
@Override
public Renderer[] createRenderers(Handler eventHandler,
                                  VideoRendererEventListener videoRendererEventListener,
                                  AudioRendererEventListener audioRendererEventListener,
                                  TextOutput textRendererOutput,
                                  MetadataOutput metadataRendererOutput) {
    ArrayList<Renderer> renderersList = new ArrayList<>();
    buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
            eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
    buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
            eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
    buildTextRenderers(textRendererOutput, eventHandler.getLooper(),
            renderersList);
    buildMetadataRenderers(metadataRendererOutput, eventHandler.getLooper(),
            renderersList);
    buildMiscellaneousRenderers();
    return renderersList.toArray(new Renderer[renderersList.size()]);
}
项目:ExoMedia    文件:RendererProvider.java   
@NonNull
protected List<Renderer> buildVideoRenderers() {
    List<Renderer> renderers = new ArrayList<>();

    renderers.add(new MediaCodecVideoRenderer(context, MediaCodecSelector.DEFAULT, videoJoiningTimeMs, drmSessionManager, false, handler, videoRendererEventListener, droppedFrameNotificationAmount));

    // Adds any registered classes
    List<String> classNames = ExoMedia.Data.registeredRendererClasses.get(ExoMedia.RendererType.VIDEO);
    if (classNames != null) {
        for (String className: classNames) {
            try {
                Class<?> clazz = Class.forName(className);
                Constructor<?> constructor = clazz.getConstructor(boolean.class, long.class, Handler.class, VideoRendererEventListener.class, int.class);
                Renderer renderer = (Renderer) constructor.newInstance(true, videoJoiningTimeMs, handler, videoRendererEventListener, droppedFrameNotificationAmount);
                renderers.add(renderer);
            } catch (Exception e) {
                // Purposefully left blank
            }
        }
    }

    return renderers;
}
项目:transistor    文件:LibvpxVideoRenderer.java   
/**
 * @param scaleToFit Whether video frames should be scaled to fit when rendering.
 * @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
 *     can attempt to seamlessly join an ongoing playback.
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
 *     invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
 * @param drmSessionManager For use with encrypted media. May be null if support for encrypted
 *     media is not required.
 * @param playClearSamplesWithoutKeys Encrypted media may contain clear (un-encrypted) regions.
 *     For example a media file may start with a short clear region so as to allow playback to
 *     begin in parallel with key acquisition. This parameter specifies whether the renderer is
 *     permitted to play clear regions of encrypted media files before {@code drmSessionManager}
 *     has obtained the keys necessary to decrypt encrypted regions of the media.
 */
public LibvpxVideoRenderer(boolean scaleToFit, long allowedJoiningTimeMs,
    Handler eventHandler, VideoRendererEventListener eventListener,
    int maxDroppedFramesToNotify, DrmSessionManager<ExoMediaCrypto> drmSessionManager,
    boolean playClearSamplesWithoutKeys) {
  super(C.TRACK_TYPE_VIDEO);
  this.scaleToFit = scaleToFit;
  this.allowedJoiningTimeMs = allowedJoiningTimeMs;
  this.maxDroppedFramesToNotify = maxDroppedFramesToNotify;
  this.drmSessionManager = drmSessionManager;
  this.playClearSamplesWithoutKeys = playClearSamplesWithoutKeys;
  joiningDeadlineMs = C.TIME_UNSET;
  clearReportedVideoSize();
  formatHolder = new FormatHolder();
  flagsOnlyBuffer = DecoderInputBuffer.newFlagsOnlyInstance();
  eventDispatcher = new EventDispatcher(eventHandler, eventListener);
  outputMode = VpxDecoder.OUTPUT_MODE_NONE;
  decoderReinitializationState = REINITIALIZATION_STATE_NONE;
}
项目:transistor    文件:DefaultRenderersFactory.java   
@Override
public Renderer[] createRenderers(Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput, MetadataOutput metadataRendererOutput) {
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
      eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
  buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
      eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[renderersList.size()]);
}
项目:ExoPlayer-Offline    文件:DebugSimpleExoPlayer.java   
@Override
protected void buildVideoRenderers(Context context, Handler mainHandler,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    @ExtensionRendererMode int extensionRendererMode, VideoRendererEventListener eventListener,
    long allowedVideoJoiningTimeMs, ArrayList<Renderer> out) {
  out.add(new DebugMediaCodecVideoRenderer(context, MediaCodecSelector.DEFAULT,
      allowedVideoJoiningTimeMs, mainHandler, drmSessionManager, eventListener,
      MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY));
}
项目:ExoPlayer-Offline    文件:DebugSimpleExoPlayer.java   
public DebugMediaCodecVideoRenderer(Context context, MediaCodecSelector mediaCodecSelector,
    long allowedJoiningTimeMs, Handler eventHandler,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    VideoRendererEventListener eventListener, int maxDroppedFrameCountToNotify) {
  super(context, mediaCodecSelector, allowedJoiningTimeMs, drmSessionManager, false,
      eventHandler, eventListener, maxDroppedFrameCountToNotify);
}
项目:ExoMedia    文件:RendererProvider.java   
public RendererProvider(@NonNull Context context, @NonNull Handler handler, @NonNull TextOutput captionListener, @NonNull MetadataOutput metadataListener,
                        @NonNull AudioRendererEventListener audioRendererEventListener, @NonNull VideoRendererEventListener videoRendererEventListener) {
    this.context = context;
    this.handler = handler;
    this.captionListener = captionListener;
    this.metadataListener = metadataListener;
    this.audioRendererEventListener = audioRendererEventListener;
    this.videoRendererEventListener = videoRendererEventListener;
}
项目:transistor    文件:DebugRenderersFactory.java   
@Override
protected void buildVideoRenderers(Context context,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, long allowedVideoJoiningTimeMs,
    Handler eventHandler, VideoRendererEventListener eventListener,
    @ExtensionRendererMode int extensionRendererMode, ArrayList<Renderer> out) {
  out.add(new DebugMediaCodecVideoRenderer(context, MediaCodecSelector.DEFAULT,
      allowedVideoJoiningTimeMs, drmSessionManager, eventHandler, eventListener,
      MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY));
}
项目:transistor    文件:DebugRenderersFactory.java   
public DebugMediaCodecVideoRenderer(Context context, MediaCodecSelector mediaCodecSelector,
    long allowedJoiningTimeMs, DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Handler eventHandler, VideoRendererEventListener eventListener,
    int maxDroppedFrameCountToNotify) {
  super(context, mediaCodecSelector, allowedJoiningTimeMs, drmSessionManager, false,
      eventHandler, eventListener, maxDroppedFrameCountToNotify);
}
项目:transistor    文件:ExoHostedTest.java   
/**
 * Sets an {@link VideoRendererEventListener} to listen for video debug events during the test.
 */
public final void setVideoDebugListener(VideoRendererEventListener videoDebugListener) {
  this.videoDebugListener = videoDebugListener;
  if (player != null) {
    player.addVideoDebugListener(videoDebugListener);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 * @deprecated Use {@link #addVideoDebugListener(VideoRendererEventListener)}.
 */
@Deprecated
public void setVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListeners.clear();
  if (listener != null) {
    addVideoDebugListener(listener);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
  videoDecoderCounters = counters;
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onVideoEnabled(counters);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs,
    long initializationDurationMs) {
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onVideoDecoderInitialized(decoderName, initializedTimestampMs,
        initializationDurationMs);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onVideoInputFormatChanged(Format format) {
  videoFormat = format;
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onVideoInputFormatChanged(format);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees,
    float pixelWidthHeightRatio) {
  for (VideoListener videoListener : videoListeners) {
    videoListener.onVideoSizeChanged(width, height, unappliedRotationDegrees,
        pixelWidthHeightRatio);
  }
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onVideoSizeChanged(width, height, unappliedRotationDegrees,
        pixelWidthHeightRatio);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onRenderedFirstFrame(Surface surface) {
  if (SimpleExoPlayer.this.surface == surface) {
    for (VideoListener videoListener : videoListeners) {
      videoListener.onRenderedFirstFrame();
    }
  }
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onRenderedFirstFrame(surface);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onVideoDisabled(counters);
  }
  videoFormat = null;
  videoDecoderCounters = null;
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
public void add(VideoRendererEventListener listener) {
    listeners.add(listener);
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onVideoEnabled(counters);
    }
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onVideoDecoderInitialized(decoderName, initializedTimestampMs, initializationDurationMs);
    }
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onVideoInputFormatChanged(Format format) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onVideoInputFormatChanged(format);
    }
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onDroppedFrames(int count, long elapsedMs) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onDroppedFrames(count, elapsedMs);
    }
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onVideoSizeChanged(width, height, unappliedRotationDegrees, pixelWidthHeightRatio);
    }
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onRenderedFirstFrame(Surface surface) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onRenderedFirstFrame(surface);
    }
}
项目:no-player    文件:ExoPlayerVideoRendererEventListener.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
    for (VideoRendererEventListener listener : listeners) {
        listener.onVideoDisabled(counters);
    }
}
项目:no-player    文件:ExoPlayerForwarder.java   
public VideoRendererEventListener videoRendererEventListener() {
    return videoRendererEventListener;
}
项目:Komica    文件:LibvpxVideoRenderer.java   
/**
 * @param scaleToFit Whether video frames should be scaled to fit when rendering.
 * @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
 *     can attempt to seamlessly join an ongoing playback.
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
 *     invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
 * @param drmSessionManager For use with encrypted media. May be null if support for encrypted
 *     media is not required.
 * @param playClearSamplesWithoutKeys Encrypted media may contain clear (un-encrypted) regions.
 *     For example a media file may start with a short clear region so as to allow playback to
 *     begin in parallel with key acquisition. This parameter specifies whether the renderer is
 *     permitted to play clear regions of encrypted media files before {@code drmSessionManager}
 *     has obtained the keys necessary to decrypt encrypted regions of the media.
 */
public LibvpxVideoRenderer(boolean scaleToFit, long allowedJoiningTimeMs,
    Handler eventHandler, VideoRendererEventListener eventListener,
    int maxDroppedFramesToNotify, DrmSessionManager<ExoMediaCrypto> drmSessionManager,
    boolean playClearSamplesWithoutKeys) {
  super(C.TRACK_TYPE_VIDEO);
  this.scaleToFit = scaleToFit;
  this.allowedJoiningTimeMs = allowedJoiningTimeMs;
  this.maxDroppedFramesToNotify = maxDroppedFramesToNotify;
  this.drmSessionManager = drmSessionManager;
  this.playClearSamplesWithoutKeys = playClearSamplesWithoutKeys;
  joiningDeadlineMs = -1;
  clearLastReportedVideoSize();
  formatHolder = new FormatHolder();
  eventDispatcher = new EventDispatcher(eventHandler, eventListener);
  outputMode = VpxDecoder.OUTPUT_MODE_NONE;
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onDroppedFrames(int count, long elapsed) {
  for (VideoRendererEventListener videoDebugListener : videoDebugListeners) {
    videoDebugListener.onDroppedFrames(count, elapsed);
  }
}
项目:Komica    文件:LibvpxVideoRenderer.java   
/**
 * @param scaleToFit Whether video frames should be scaled to fit when rendering.
 * @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
 *     can attempt to seamlessly join an ongoing playback.
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
 *     invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
 */
public LibvpxVideoRenderer(boolean scaleToFit, long allowedJoiningTimeMs,
    Handler eventHandler, VideoRendererEventListener eventListener,
    int maxDroppedFramesToNotify) {
  this(scaleToFit, allowedJoiningTimeMs, eventHandler, eventListener, maxDroppedFramesToNotify,
      null, false);
}
项目:transistor    文件:LibvpxVideoRenderer.java   
/**
 * @param scaleToFit Whether video frames should be scaled to fit when rendering.
 * @param allowedJoiningTimeMs The maximum duration in milliseconds for which this video renderer
 *     can attempt to seamlessly join an ongoing playback.
 * @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
 *     null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @param maxDroppedFramesToNotify The maximum number of frames that can be dropped between
 *     invocations of {@link VideoRendererEventListener#onDroppedFrames(int, long)}.
 */
public LibvpxVideoRenderer(boolean scaleToFit, long allowedJoiningTimeMs,
    Handler eventHandler, VideoRendererEventListener eventListener,
    int maxDroppedFramesToNotify) {
  this(scaleToFit, allowedJoiningTimeMs, eventHandler, eventListener, maxDroppedFramesToNotify,
      null, false);
}
项目:Exoplayer2Radio    文件:RenderersFactory.java   
/**
 * Builds the {@link Renderer} instances for a {@link SimpleExoPlayer}.
 *
 * @param eventHandler A handler to use when invoking event listeners and outputs.
 * @param videoRendererEventListener An event listener for video renderers.
 * @param videoRendererEventListener An event listener for audio renderers.
 * @param textRendererOutput An output for text renderers.
 * @param metadataRendererOutput An output for metadata renderers.
 * @return The {@link Renderer instances}.
 */
Renderer[] createRenderers(Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextRenderer.Output textRendererOutput, MetadataRenderer.Output metadataRendererOutput);
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 */
public void setVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListener = listener;
}
项目:GSYVideoPlayer    文件:SimpleExoPlayer2.java   
/**
 * Sets a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 */
public void setVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListener = listener;
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 */
public void setVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListener = listener;
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 */
public void setVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListener = listener;
}
项目:transistor    文件:RenderersFactory.java   
/**
 * Builds the {@link Renderer} instances for a {@link SimpleExoPlayer}.
 *
 * @param eventHandler A handler to use when invoking event listeners and outputs.
 * @param videoRendererEventListener An event listener for video renderers.
 * @param audioRendererEventListener An event listener for audio renderers.
 * @param textRendererOutput An output for text renderers.
 * @param metadataRendererOutput An output for metadata renderers.
 * @return The {@link Renderer instances}.
 */
Renderer[] createRenderers(Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener, TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput);
项目:transistor    文件:SimpleExoPlayer.java   
/**
 * Adds a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 */
public void addVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListeners.add(listener);
}
项目:transistor    文件:SimpleExoPlayer.java   
/**
 * Removes a listener to receive debug events from the video renderer.
 *
 * @param listener The listener.
 */
public void removeVideoDebugListener(VideoRendererEventListener listener) {
  videoDebugListeners.remove(listener);
}