com.google.android.exoplayer2.metadata.MetadataOutput Java Examples

The following examples show how to use com.google.android.exoplayer2.metadata.MetadataOutput. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  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()]);
}
 
Example #2
Source File: SimpleRenderersFactory.java    From no-player with Apache License 2.0 6 votes vote down vote up
@Override
public Renderer[] createRenderers(Handler eventHandler,
                                  VideoRendererEventListener videoRendererEventListener,
                                  AudioRendererEventListener audioRendererEventListener,
                                  TextOutput textRendererOutput,
                                  MetadataOutput metadataRendererOutput,
                                  @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
    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, subtitleDecoderFactory);
    buildMetadataRenderers(metadataRendererOutput, eventHandler.getLooper(),
            renderersList);
    buildMiscellaneousRenderers();
    return renderersList.toArray(new Renderer[renderersList.size()]);
}
 
Example #3
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  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()]);
}
 
Example #4
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive metadata events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addMetadataOutput(MetadataOutput)}.
 */
@Deprecated
public void setMetadataOutput(MetadataOutput output) {
  metadataOutputs.retainAll(Collections.singleton(analyticsCollector));
  if (output != null) {
    addMetadataOutput(output);
  }
}
 
Example #5
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive metadata events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addMetadataOutput(MetadataOutput)}.
 */
@Deprecated
public void setMetadataOutput(MetadataOutput output) {
  metadataOutputs.retainAll(Collections.singleton(analyticsCollector));
  if (output != null) {
    addMetadataOutput(output);
  }
}
 
Example #6
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive metadata events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addMetadataOutput(MetadataOutput)}.
 */
@Deprecated
public void setMetadataOutput(MetadataOutput output) {
  metadataOutputs.retainAll(Collections.singleton(analyticsCollector));
  if (output != null) {
    addMetadataOutput(output);
  }
}
 
Example #7
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an output to receive metadata events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addMetadataOutput(MetadataOutput)}.
 */
@Deprecated
public void setMetadataOutput(MetadataOutput output) {
  metadataOutputs.retainAll(Collections.singleton(analyticsCollector));
  if (output != null) {
    addMetadataOutput(output);
  }
}
 
Example #8
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive metadata events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addMetadataOutput(MetadataOutput)}.
 */
@Deprecated
public void setMetadataOutput(MetadataOutput output) {
  metadataOutputs.retainAll(Collections.singleton(analyticsCollector));
  if (output != null) {
    addMetadataOutput(output);
  }
}
 
Example #9
Source File: RendererProvider.java    From ExoMedia with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #10
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void removeMetadataOutput(MetadataOutput listener) {
  metadataOutputs.remove(listener);
}
 
Example #11
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onMetadata(Metadata metadata) {
  for (MetadataOutput metadataOutput : metadataOutputs) {
    metadataOutput.onMetadata(metadata);
  }
}
 
Example #12
Source File: DefaultRenderersFactory.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      eventHandler,
      videoRendererEventListener,
      allowedVideoJoiningTimeMs,
      renderersList);
  buildAudioRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      buildAudioProcessors(),
      eventHandler,
      audioRendererEventListener,
      renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildCameraMotionRenderers(context, extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[0]);
}
 
Example #13
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void addMetadataOutput(MetadataOutput listener) {
  metadataOutputs.add(listener);
}
 
Example #14
Source File: DefaultRenderersFactory.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      eventHandler,
      videoRendererEventListener,
      allowedVideoJoiningTimeMs,
      renderersList);
  buildAudioRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      buildAudioProcessors(),
      eventHandler,
      audioRendererEventListener,
      renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildCameraMotionRenderers(context, extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[0]);
}
 
Example #15
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onMetadata(Metadata metadata) {
  for (MetadataOutput metadataOutput : metadataOutputs) {
    metadataOutput.onMetadata(metadata);
  }
}
 
Example #16
Source File: DefaultRenderersFactory.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      eventHandler,
      videoRendererEventListener,
      allowedVideoJoiningTimeMs,
      renderersList);
  buildAudioRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      buildAudioProcessors(),
      eventHandler,
      audioRendererEventListener,
      renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildCameraMotionRenderers(context, extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[0]);
}
 
Example #17
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void addMetadataOutput(MetadataOutput listener) {
  metadataOutputs.add(listener);
}
 
Example #18
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void removeMetadataOutput(MetadataOutput listener) {
  metadataOutputs.remove(listener);
}
 
Example #19
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onMetadata(Metadata metadata) {
  for (MetadataOutput metadataOutput : metadataOutputs) {
    metadataOutput.onMetadata(metadata);
  }
}
 
Example #20
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onMetadata(Metadata metadata) {
  for (MetadataOutput metadataOutput : metadataOutputs) {
    metadataOutput.onMetadata(metadata);
  }
}
 
Example #21
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public void addMetadataOutput(MetadataOutput listener) {
  metadataOutputs.add(listener);
}
 
Example #22
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public void removeMetadataOutput(MetadataOutput listener) {
  metadataOutputs.remove(listener);
}
 
Example #23
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public void onMetadata(Metadata metadata) {
  for (MetadataOutput metadataOutput : metadataOutputs) {
    metadataOutput.onMetadata(metadata);
  }
}
 
Example #24
Source File: RenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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.
 * @param drmSessionManager A drm session manager used by renderers.
 * @return The {@link Renderer instances}.
 */
Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager);
 
Example #25
Source File: RenderersFactory.java    From MediaSDK with Apache License 2.0 3 votes vote down vote up
/**
 * 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.
 * @param drmSessionManager A drm session manager used by renderers.
 * @return The {@link Renderer instances}.
 */
Renderer[] createRenderers(
        Handler eventHandler,
        VideoRendererEventListener videoRendererEventListener,
        AudioRendererEventListener audioRendererEventListener,
        TextOutput textRendererOutput,
        MetadataOutput metadataRendererOutput,
        @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager);
 
Example #26
Source File: DefaultRenderersFactory.java    From MediaSDK with Apache License 2.0 3 votes vote down vote up
/**
 * 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));
}
 
Example #27
Source File: DefaultRenderersFactory.java    From Telegram with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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));
}
 
Example #28
Source File: RenderersFactory.java    From Telegram with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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.
 * @param drmSessionManager A drm session manager used by renderers.
 * @return The {@link Renderer instances}.
 */
Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager);
 
Example #29
Source File: RenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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.
 * @param drmSessionManager A drm session manager used by renderers.
 * @return The {@link Renderer instances}.
 */
Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager);
 
Example #30
Source File: DefaultRenderersFactory.java    From Telegram-FOSS with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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));
}