Java 类com.google.android.exoplayer2.audio.AudioRendererEventListener 实例源码

项目: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> buildAudioRenderers() {
    List<Renderer> renderers = new ArrayList<>();

    renderers.add(new MediaCodecAudioRenderer(MediaCodecSelector.DEFAULT, drmSessionManager, true, handler, audioRendererEventListener, AudioCapabilities.getCapabilities(context)));

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

    return renderers;
}
项目: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()]);
}
项目:K-Sonic    文件:SonicMediaCodecAudioRenderer.java   
public SonicMediaCodecAudioRenderer(MediaCodecSelector mediaCodecSelector,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    boolean playClearSamplesWithoutKeys, Handler eventHandler,
    AudioRendererEventListener eventListener, AudioCapabilities audioCapabilities,
    AudioProcessor... audioProcessors) {
  super(mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, eventHandler, eventListener, audioCapabilities, audioProcessors);
  //Init
  bufferIndex = -1;
  speed = 1.0f;
  pitch = 1.0f;
  rate = 1.0f;
}
项目: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    文件:ExoHostedTest.java   
/**
 * Sets an {@link AudioRendererEventListener} to listen for audio debug events during the test.
 */
public final void setAudioDebugListener(AudioRendererEventListener audioDebugListener) {
  this.audioDebugListener = audioDebugListener;
  if (player != null) {
    player.addAudioDebugListener(audioDebugListener);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the audio renderer.
 *
 * @param listener The listener.
 * @deprecated Use {@link #addAudioDebugListener(AudioRendererEventListener)}.
 */
@Deprecated
public void setAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListeners.clear();
  if (listener != null) {
    addAudioDebugListener(listener);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onAudioEnabled(DecoderCounters counters) {
  audioDecoderCounters = counters;
  for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
    audioDebugListener.onAudioEnabled(counters);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onAudioSessionId(int sessionId) {
  audioSessionId = sessionId;
  for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
    audioDebugListener.onAudioSessionId(sessionId);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs,
    long initializationDurationMs) {
  for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
    audioDebugListener.onAudioDecoderInitialized(decoderName, initializedTimestampMs,
        initializationDurationMs);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onAudioInputFormatChanged(Format format) {
  audioFormat = format;
  for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
    audioDebugListener.onAudioInputFormatChanged(format);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs,
    long elapsedSinceLastFeedMs) {
  for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
    audioDebugListener.onAudioSinkUnderrun(bufferSize, bufferSizeMs, elapsedSinceLastFeedMs);
  }
}
项目:transistor    文件:SimpleExoPlayer.java   
@Override
public void onAudioDisabled(DecoderCounters counters) {
  for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
    audioDebugListener.onAudioDisabled(counters);
  }
  audioFormat = null;
  audioDecoderCounters = null;
  audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
项目:Komica    文件:LibopusAudioRenderer.java   
/**
 * @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 audioCapabilities The audio capabilities for playback on this device. May be null if the
 *     default capabilities (no encoded audio passthrough support) should be assumed.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioCapabilities audioCapabilities, DrmSessionManager<ExoMediaCrypto> drmSessionManager,
    boolean playClearSamplesWithoutKeys) {
  super(eventHandler, eventListener, audioCapabilities, drmSessionManager,
      playClearSamplesWithoutKeys);
}
项目:transistor    文件:LibopusAudioRenderer.java   
/**
 * @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 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.
 * @param audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    DrmSessionManager<ExoMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, null, drmSessionManager, playClearSamplesWithoutKeys,
      audioProcessors);
}
项目: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 audio renderer.
 *
 * @param listener The listener.
 */
public void setAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListener = listener;
}
项目:GSYVideoPlayer    文件:SimpleExoPlayer2.java   
/**
 * Sets a listener to receive debug events from the audio renderer.
 *
 * @param listener The listener.
 */
public void setAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListener = listener;
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the audio renderer.
 *
 * @param listener The listener.
 */
public void setAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListener = listener;
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive debug events from the audio renderer.
 *
 * @param listener The listener.
 */
public void setAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListener = listener;
}
项目:Komica    文件:LibopusAudioRenderer.java   
/**
 * @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.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener) {
  super(eventHandler, eventListener);
}
项目:Komica    文件:LibopusAudioRenderer.java   
/**
 * @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 audioCapabilities The audio capabilities for playback on this device. May be null if the
 *     default capabilities (no encoded audio passthrough support) should be assumed.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioCapabilities audioCapabilities) {
  super(eventHandler, eventListener, audioCapabilities);
}
项目:Komica    文件:LibflacAudioRenderer.java   
/**
 * @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.
 */
public LibflacAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener) {
  super(eventHandler, eventListener);
}
项目:Komica    文件:LibflacAudioRenderer.java   
/**
 * @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 audioCapabilities The audio capabilities for playback on this device. May be null if the
 *     default capabilities (no encoded audio passthrough support) should be assumed.
 */
public LibflacAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioCapabilities audioCapabilities) {
  super(eventHandler, eventListener, audioCapabilities);
}
项目:Komica    文件:FfmpegAudioRenderer.java   
/**
 * @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.
 */
public FfmpegAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener) {
  super(eventHandler, eventListener);
}
项目:Komica    文件:FfmpegAudioRenderer.java   
/**
 * @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 audioCapabilities The audio capabilities for playback on this device. May be null if the
 *     default capabilities (no encoded audio passthrough support) should be assumed.
 */
public FfmpegAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioCapabilities audioCapabilities) {
  super(eventHandler, eventListener, audioCapabilities);
}
项目:Jockey    文件:LibflacAudioRenderer.java   
/**
 * @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 audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibflacAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
项目:transistor    文件:LibopusAudioRenderer.java   
/**
 * @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 audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
项目:transistor    文件:LibflacAudioRenderer.java   
/**
 * @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 audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public LibflacAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  super(eventHandler, eventListener, audioProcessors);
}
项目:transistor    文件:FfmpegAudioRenderer.java   
/**
 * @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 audioProcessors Optional {@link AudioProcessor}s that will process audio before output.
 */
public FfmpegAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioProcessor... audioProcessors) {
  this(eventHandler, eventListener, new DefaultAudioSink(null, audioProcessors), false);
}
项目:transistor    文件:FfmpegAudioRenderer.java   
/**
 * @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 audioSink The sink to which audio will be output.
 * @param enableFloatOutput Whether to enable 32-bit float audio format, if supported on the
 *     device/build and if the input format may have bit depth higher than 16-bit. When using
 *     32-bit float output, any audio processing will be disabled, including playback speed/pitch
 *     adjustment.
 */
public FfmpegAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
    AudioSink audioSink, boolean enableFloatOutput) {
  super(eventHandler, eventListener, null, false, audioSink);
  this.enableFloatOutput = enableFloatOutput;
}
项目: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 audio renderer.
 *
 * @param listener The listener.
 */
public void addAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListeners.add(listener);
}
项目:transistor    文件:SimpleExoPlayer.java   
/**
 * Removes a listener to receive debug events from the audio renderer.
 *
 * @param listener The listener.
 */
public void removeAudioDebugListener(AudioRendererEventListener listener) {
  audioDebugListeners.remove(listener);
}