Java 类com.google.android.exoplayer2.metadata.MetadataRenderer 实例源码

项目: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()]);
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
private void buildRenderers(Context context,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, ArrayList<Renderer> renderersList,
    long allowedVideoJoiningTimeMs) {
  MediaCodecVideoRenderer videoRenderer = new MediaCodecVideoRenderer(context,
      MediaCodecSelector.DEFAULT, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,
      allowedVideoJoiningTimeMs, drmSessionManager, false, mainHandler, componentListener,
      MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY);
  renderersList.add(videoRenderer);

  Renderer audioRenderer = new MediaCodecAudioRenderer(MediaCodecSelector.DEFAULT,
      drmSessionManager, true, mainHandler, componentListener,
      AudioCapabilities.getCapabilities(context), AudioManager.STREAM_MUSIC);
  renderersList.add(audioRenderer);

  Renderer textRenderer = new TextRenderer(componentListener, mainHandler.getLooper());
  renderersList.add(textRenderer);

  MetadataRenderer<List<Id3Frame>> id3Renderer = new MetadataRenderer<>(componentListener,
      mainHandler.getLooper(), new Id3Decoder());
  renderersList.add(id3Renderer);
}
项目:ExoMedia    文件:RendererProvider.java   
@NonNull
protected List<Renderer> buildMetadataRenderers() {
    List<Renderer> renderers = new ArrayList<>();

    renderers.add(new MetadataRenderer(metadataListener, handler.getLooper(), MetadataDecoderFactory.DEFAULT));

    return renderers;
}
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
/**
 * Clears the output receiving metadata events if it matches the one passed. Else does nothing.
 *
 * @param output The output to clear.
 */
public void clearMetadataOutput(MetadataRenderer.Output output) {
  if (metadataOutput == output) {
    metadataOutput = null;
  }
}
项目: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    文件:DefaultRenderersFactory.java   
/**
 * Builds metadata renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be
 *     called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildMetadataRenderers(Context context, MetadataRenderer.Output output,
    Looper outputLooper, @ExtensionRendererMode int extensionRendererMode,
    ArrayList<Renderer> out) {
  out.add(new MetadataRenderer(output, outputLooper));
}
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive metadata events.
 *
 * @param output The output.
 */
public void setMetadataOutput(MetadataRenderer.Output output) {
  metadataOutput = output;
}
项目:no-player    文件:SimpleRenderersFactory.java   
/**
 * Builds metadata renderers for use by the player.
 *
 * @param output       An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be
 *                     called.
 * @param outRenderers An array to which the built renderers should be appended.
 */
private void buildMetadataRenderers(MetadataOutput output, Looper outputLooper, List<Renderer> outRenderers) {
    outRenderers.add(new MetadataRenderer(output, outputLooper));
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive metadata events.
 *
 * @param output The output.
 */
public void setMetadataOutput(MetadataRenderer.Output output) {
  metadataOutput = output;
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
/**
 * Builds metadata renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param mainHandler A handler associated with the main thread's looper.
 * @param extensionRendererMode The extension renderer mode.
 * @param output An output for the renderers.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildMetadataRenderers(Context context, Handler mainHandler,
    @ExtensionRendererMode int extensionRendererMode, MetadataRenderer.Output output,
    ArrayList<Renderer> out) {
  out.add(new MetadataRenderer(output, mainHandler.getLooper()));
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
/**
 * Sets a listener to receive ID3 metadata events.
 *
 * @param output The output.
 */
public void setId3Output(MetadataRenderer.Output<List<Id3Frame>> output) {
  id3Output = output;
}
项目:transistor    文件:DefaultRenderersFactory.java   
/**
 * Builds metadata renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be
 *     called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildMetadataRenderers(Context context, MetadataOutput output, Looper outputLooper,
    @ExtensionRendererMode int extensionRendererMode, ArrayList<Renderer> out) {
  out.add(new MetadataRenderer(output, outputLooper));
}