Java 类com.google.android.exoplayer2.util.MediaClock 实例源码

项目:videoPickPlayer    文件:ExoPlayerImplInternal.java   
private void enableRenderers(boolean[] rendererWasEnabledFlags, int enabledRendererCount)
    throws ExoPlaybackException {
  enabledRenderers = new Renderer[enabledRendererCount];
  enabledRendererCount = 0;
  for (int i = 0; i < renderers.length; i++) {
    Renderer renderer = renderers[i];
    TrackSelection newSelection = playingPeriodHolder.trackSelections.get(i);
    if (newSelection != null) {
      enabledRenderers[enabledRendererCount++] = renderer;
      if (renderer.getState() == Renderer.STATE_DISABLED) {
        // The renderer needs enabling with its new track selection.
        boolean playing = playWhenReady && state == ExoPlayer.STATE_READY;
        // Consider as joining only if the renderer was previously disabled.
        boolean joining = !rendererWasEnabledFlags[i] && playing;
        // Build an array of formats contained by the selection.
        Format[] formats = new Format[newSelection.length()];
        for (int j = 0; j < formats.length; j++) {
          formats[j] = newSelection.getFormat(j);
        }
        // Enable the renderer.
        renderer.enable(formats, playingPeriodHolder.sampleStreams[i], rendererPositionUs,
            joining, playingPeriodHolder.rendererPositionOffsetUs);
        MediaClock mediaClock = renderer.getMediaClock();
        if (mediaClock != null) {
          if (rendererMediaClock != null) {
            throw ExoPlaybackException.createForUnexpected(
                new IllegalStateException("Multiple renderer media clocks enabled."));
          }
          rendererMediaClock = mediaClock;
          rendererMediaClockSource = renderer;
        }
        // Start the renderer if playing.
        if (playing) {
          renderer.start();
        }
      }
    }
  }
}
项目:transistor    文件:ExoPlayerImplInternal.java   
private void enableRenderer(int rendererIndex, boolean wasRendererEnabled,
    int enabledRendererIndex) throws ExoPlaybackException {
  Renderer renderer = renderers[rendererIndex];
  enabledRenderers[enabledRendererIndex] = renderer;
  if (renderer.getState() == Renderer.STATE_DISABLED) {
    RendererConfiguration rendererConfiguration =
        playingPeriodHolder.trackSelectorResult.rendererConfigurations[rendererIndex];
    TrackSelection newSelection = playingPeriodHolder.trackSelectorResult.selections.get(
        rendererIndex);
    Format[] formats = getFormats(newSelection);
    // The renderer needs enabling with its new track selection.
    boolean playing = playWhenReady && state == Player.STATE_READY;
    // Consider as joining only if the renderer was previously disabled.
    boolean joining = !wasRendererEnabled && playing;
    // Enable the renderer.
    renderer.enable(rendererConfiguration, formats,
        playingPeriodHolder.sampleStreams[rendererIndex], rendererPositionUs,
        joining, playingPeriodHolder.getRendererOffset());
    MediaClock mediaClock = renderer.getMediaClock();
    if (mediaClock != null) {
      if (rendererMediaClock != null) {
        throw ExoPlaybackException.createForUnexpected(
            new IllegalStateException("Multiple renderer media clocks enabled."));
      }
      rendererMediaClock = mediaClock;
      rendererMediaClockSource = renderer;
      rendererMediaClock.setPlaybackParameters(playbackParameters);
    }
    // Start the renderer if playing.
    if (playing) {
      renderer.start();
    }
  }
}
项目:Exoplayer2Radio    文件:BaseRenderer.java   
@Override
public MediaClock getMediaClock() {
  return null;
}
项目:Exoplayer2Radio    文件:ExoPlayerImplInternal.java   
private void enableRenderers(boolean[] rendererWasEnabledFlags, int enabledRendererCount)
    throws ExoPlaybackException {
  enabledRenderers = new Renderer[enabledRendererCount];
  enabledRendererCount = 0;
  for (int i = 0; i < renderers.length; i++) {
    Renderer renderer = renderers[i];
    TrackSelection newSelection = playingPeriodHolder.trackSelectorResult.selections.get(i);
    if (newSelection != null) {
      enabledRenderers[enabledRendererCount++] = renderer;
      if (renderer.getState() == Renderer.STATE_DISABLED) {
        RendererConfiguration rendererConfiguration =
            playingPeriodHolder.trackSelectorResult.rendererConfigurations[i];
        // The renderer needs enabling with its new track selection.
        boolean playing = playWhenReady && state == ExoPlayer.STATE_READY;
        // Consider as joining only if the renderer was previously disabled.
        boolean joining = !rendererWasEnabledFlags[i] && playing;
        // Build an array of formats contained by the selection.
        Format[] formats = new Format[newSelection.length()];
        for (int j = 0; j < formats.length; j++) {
          formats[j] = newSelection.getFormat(j);
        }
        // Enable the renderer.
        renderer.enable(rendererConfiguration, formats, playingPeriodHolder.sampleStreams[i],
            rendererPositionUs, joining, playingPeriodHolder.getRendererOffset());
        MediaClock mediaClock = renderer.getMediaClock();
        if (mediaClock != null) {
          if (rendererMediaClock != null) {
            throw ExoPlaybackException.createForUnexpected(
                new IllegalStateException("Multiple renderer media clocks enabled."));
          }
          rendererMediaClock = mediaClock;
          rendererMediaClockSource = renderer;
          rendererMediaClock.setPlaybackParameters(playbackParameters);
        }
        // Start the renderer if playing.
        if (playing) {
          renderer.start();
        }
      }
    }
  }
}
项目:Exoplayer2Radio    文件:SimpleDecoderAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:Exoplayer2Radio    文件:MediaCodecAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:K-Sonic    文件:BaseRenderer.java   
@Override
public MediaClock getMediaClock() {
  return null;
}
项目:K-Sonic    文件:ExoPlayerImplInternal.java   
private void enableRenderers(boolean[] rendererWasEnabledFlags, int enabledRendererCount)
    throws ExoPlaybackException {
  enabledRenderers = new Renderer[enabledRendererCount];
  enabledRendererCount = 0;
  for (int i = 0; i < renderers.length; i++) {
    Renderer renderer = renderers[i];
    TrackSelection newSelection = playingPeriodHolder.trackSelectorResult.selections.get(i);
    if (newSelection != null) {
      enabledRenderers[enabledRendererCount++] = renderer;
      if (renderer.getState() == Renderer.STATE_DISABLED) {
        RendererConfiguration rendererConfiguration =
            playingPeriodHolder.trackSelectorResult.rendererConfigurations[i];
        // The renderer needs enabling with its new track selection.
        boolean playing = playWhenReady && state == ExoPlayer.STATE_READY;
        // Consider as joining only if the renderer was previously disabled.
        boolean joining = !rendererWasEnabledFlags[i] && playing;
        // Build an array of formats contained by the selection.
        Format[] formats = new Format[newSelection.length()];
        for (int j = 0; j < formats.length; j++) {
          formats[j] = newSelection.getFormat(j);
        }
        // Enable the renderer.
        renderer.enable(rendererConfiguration, formats, playingPeriodHolder.sampleStreams[i],
            rendererPositionUs, joining, playingPeriodHolder.getRendererOffset());
        MediaClock mediaClock = renderer.getMediaClock();
        if (mediaClock != null) {
          if (rendererMediaClock != null) {
            throw ExoPlaybackException.createForUnexpected(
                new IllegalStateException("Multiple renderer media clocks enabled."));
          }
          rendererMediaClock = mediaClock;
          rendererMediaClockSource = renderer;
        }
        // Start the renderer if playing.
        if (playing) {
          renderer.start();
        }
      }
    }
  }
}
项目:K-Sonic    文件:SimpleDecoderAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:K-Sonic    文件:MediaCodecAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:videoPickPlayer    文件:BaseRenderer.java   
@Override
public MediaClock getMediaClock() {
  return null;
}
项目:videoPickPlayer    文件:SimpleDecoderAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:videoPickPlayer    文件:MediaCodecAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:transistor    文件:FakeMediaClockRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:transistor    文件:BaseRenderer.java   
@Override
public MediaClock getMediaClock() {
  return null;
}
项目:transistor    文件:NoSampleRenderer.java   
@Override
public MediaClock getMediaClock() {
  return null;
}
项目:transistor    文件:SimpleDecoderAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:transistor    文件:MediaCodecAudioRenderer.java   
@Override
public MediaClock getMediaClock() {
  return this;
}
项目:Exoplayer2Radio    文件:Renderer.java   
/**
 * If the renderer advances its own playback position then this method returns a corresponding
 * {@link MediaClock}. If provided, the player will use the returned {@link MediaClock} as its
 * source of time during playback. A player may have at most one renderer that returns a
 * {@link MediaClock} from this method.
 *
 * @return The {@link MediaClock} tracking the playback position of the renderer, or null.
 */
MediaClock getMediaClock();
项目:K-Sonic    文件:Renderer.java   
/**
 * If the renderer advances its own playback position then this method returns a corresponding
 * {@link MediaClock}. If provided, the player will use the returned {@link MediaClock} as its
 * source of time during playback. A player may have at most one renderer that returns a
 * {@link MediaClock} from this method.
 *
 * @return The {@link MediaClock} tracking the playback position of the renderer, or null.
 */
MediaClock getMediaClock();
项目:videoPickPlayer    文件:Renderer.java   
/**
 * If the renderer advances its own playback position then this method returns a corresponding
 * {@link MediaClock}. If provided, the player will use the returned {@link MediaClock} as its
 * source of time during playback. A player may have at most one renderer that returns a
 * {@link MediaClock} from this method.
 *
 * @return The {@link MediaClock} tracking the playback position of the renderer, or null.
 */
MediaClock getMediaClock();
项目:transistor    文件:Renderer.java   
/**
 * If the renderer advances its own playback position then this method returns a corresponding
 * {@link MediaClock}. If provided, the player will use the returned {@link MediaClock} as its
 * source of time during playback. A player may have at most one renderer that returns a
 * {@link MediaClock} from this method.
 *
 * @return The {@link MediaClock} tracking the playback position of the renderer, or null.
 */
MediaClock getMediaClock();