Java 类com.google.android.exoplayer.MediaCodecTrackRenderer 实例源码

项目:androidtv-sample    文件:DemoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers      Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
   *                       element may be null if there do not exist tracks of the corresponding
   *                       type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be
   *                       null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.audioRenderer = renderers[TYPE_AUDIO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:androidtv-sample    文件:VideoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers      Renderers indexed by {@link VideoPlayer} TYPE_* constants. An
   *                       individual element may be null if there do not exist tracks of the
   *                       corresponding type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be
   *                       null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:AndroidTvDemo    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:chilly    文件:VideoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers      Renderers indexed by {@link VideoPlayer} TYPE_* constants. An
   *                       individual element may be null if there do not exist tracks of the
   *                       corresponding type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be
   *                       null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:ShaddockVideoPlayer    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:android-tv-news    文件:VideoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers      Renderers indexed by {@link VideoPlayer} TYPE_* constants. An
   *                       individual element may be null if there do not exist tracks of the
   *                       corresponding type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be
   *                       null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:mimi-reader    文件:ExoPlayerHelper.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers      Renderers indexed by {@link ExoPlayerHelper} TYPE_* constants. An individual
   *                       element may be null if there do not exist tracks of the corresponding type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:ExoPlayerController    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:FriendsCameraSDK-android    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:talk-android    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:OKPlayer    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:ExoPlayer-Demo    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:Mediathek    文件:Player.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers Renderers indexed by {@link Player} TYPE_* constants. An individual
   *     element may be null if there do not exist tracks of the corresponding type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:droidkaigi2016    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:danish-media-license    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers      Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *                       element may be null if there do not exist tracks of the corresponding
 *                       type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:WliveTV    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:Android-Example-HLS-ExoPlayer    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:ExoPlayerWrapper    文件:ExoPlayerWrapper.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers      Renderers indexed by {@link ExoPlayerWrapper} TYPE_* constants. An individual
 *                       element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
protected void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
    for (int i = 0; i < RENDERER_COUNT; i++) {
        if (renderers[i] == null) {
            // Convert a null renderer to a dummy renderer.
            renderers[i] = new DummyTrackRenderer();
        }
    }
    // Complete preparation.
    this.videoRenderer = renderers[TYPE_VIDEO];
    this.audioRenderer = renderers[TYPE_AUDIO];
    this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
            ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
            : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
            ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
    this.bandwidthMeter = bandwidthMeter;
    pushSurface(false);
    player.prepare(renderers);
    rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:Android-Birdcopy-Application    文件:FlyingPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link FlyingPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
          ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
          : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
          ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:SimpleExoPlayer    文件:DemoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
   *     element may be null if there do not exist tracks of the corresponding type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.audioRenderer = renderers[TYPE_AUDIO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:droidkaigi2016    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }
  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:androidtv-sample-inputs    文件:DemoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param renderers      Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
   *                       element may be null if there do not exist tracks of the corresponding
   *                       type.
   * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be
   *                       null.
   */
/* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
      for (int i = 0; i < RENDERER_COUNT; i++) {
          if (renderers[i] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[i] = new DummyTrackRenderer();
          }
      }
      // Complete preparation.
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.audioRenderer = renderers[TYPE_AUDIO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:google-media-framework-android    文件:ExoplayerWrapper.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link ExoplayerWrapper} TYPE_* constants. An
 *                  individual element may be null if there do not exist tracks of the
 *                  corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
public void onRenderers(TrackRenderer[] renderers,  BandwidthMeter bandwidthMeter) {
  // Normalize the results.
  if (trackNames == null) {
    trackNames = new String[RENDERER_COUNT][];
  }

  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }

  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
          ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
          : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
          ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  this.bandwidthMeter = bandwidthMeter;
  maybeReportPlayerState();
  pushSurfaceAndVideoTrack(false);
  player.prepare(renderers);
}
项目:player-sdk-native-android    文件:ExoplayerWrapper.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param renderers Renderers indexed by {@link ExoplayerWrapper} TYPE_* constants. An
 *                  individual element may be null if there do not exist tracks of the
 *                  corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
public void onRenderers(TrackRenderer[] renderers,  BandwidthMeter bandwidthMeter) {
  // Normalize the results.
  if (trackNames == null) {
    trackNames = new String[RENDERER_COUNT][];
  }

  for (int i = 0; i < RENDERER_COUNT; i++) {
    if (renderers[i] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[i] = new DummyTrackRenderer();
    }
  }

  // Complete preparation.
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
          ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
          : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
          ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  this.bandwidthMeter = bandwidthMeter;
  maybeReportPlayerState();
  pushSurfaceAndVideoTrack(false);
  player.prepare(renderers);
}
项目:sbs-android-tv    文件:VideoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param trackNames        The names of the available tracks, indexed by {@link VideoPlayer} TYPE_*
   *                          constants. May be null if the track names are unknown. An individual element may be null
   *                          if the track names are unknown for the corresponding type.
   * @param multiTrackSources Sources capable of switching between multiple available tracks,
   *                          indexed by {@link VideoPlayer} TYPE_* constants. May be null if there are no types with
   *                          multiple tracks. An individual element may be null if it does not have multiple tracks.
   * @param renderers         Renderers indexed by {@link VideoPlayer} TYPE_* constants. An individual
   *                          element may be null if there do not exist tracks of the corresponding type.
   * @param bandwidthMeter    Provides an estimate of the currently available bandwidth. May be null.
   */
/* package */ void onRenderers(String[][] trackNames,
                               MultiTrackChunkSource[] multiTrackSources, TrackRenderer[] renderers,
                               BandwidthMeter bandwidthMeter) {
      // Normalize the results.
      if (trackNames == null) {
          trackNames = new String[RENDERER_COUNT][];
      }
      if (multiTrackSources == null) {
          multiTrackSources = new MultiTrackChunkSource[RENDERER_COUNT];
      }
      for (int rendererIndex = 0; rendererIndex < RENDERER_COUNT; rendererIndex++) {
          if (renderers[rendererIndex] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[rendererIndex] = new DummyTrackRenderer();
          }
          if (trackNames[rendererIndex] == null) {
              // Convert a null trackNames to an array of suitable length.
              int trackCount = multiTrackSources[rendererIndex] != null
                      ? multiTrackSources[rendererIndex].getTrackCount() : 1;
              trackNames[rendererIndex] = new String[trackCount];
          }
      }
      // Complete preparation.
      this.trackNames = trackNames;
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.multiTrackSources = multiTrackSources;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      pushTrackSelection(TYPE_VIDEO, true);
      pushTrackSelection(TYPE_AUDIO, true);
      pushTrackSelection(TYPE_TEXT, true);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:ChannelSurfer    文件:TvInputPlayer.java   
@Override
public void onDecoderInitializationError(
        MediaCodecTrackRenderer.DecoderInitializationException e) {
    for(Callback callback : mCallbacks) {
        callback.onPlayerError(new ExoPlaybackException(e));
    }
}
项目:exoplayer-textureview    文件:EventProxy.java   
/** RendererBuilderCallback */
@Override
public void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) {
    player.invokeOnRenderersBuilt(renderers, bandwidthMeter);
    this.bandwidthMeter = bandwidthMeter;
    this.codecCounters = renderers[Player.TYPE_VIDEO] instanceof MediaCodecTrackRenderer
            ? ((MediaCodecTrackRenderer) renderers[Player.TYPE_VIDEO]).codecCounters
            : renderers[Player.TYPE_AUDIO] instanceof MediaCodecTrackRenderer
                    ? ((MediaCodecTrackRenderer) renderers[Player.TYPE_AUDIO]).codecCounters
                    : null;
}
项目:exoplayer-textureview    文件:EventProxy.java   
/** MediaCodecVideoTrackRenderer.EventListener */
@Override
public void onDecoderInitializationError(
        MediaCodecTrackRenderer.DecoderInitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onDecoderInitializationError(e);
    }
}
项目:exoPlayerHLS    文件:DemoPlayer.java   
void onRenderers(String[][] trackNames,
    MultiTrackChunkSource[] multiTrackSources, TrackRenderer[] renderers,
    BandwidthMeter bandwidthMeter) {
  builderCallback = null;
  // Normalize the results.
  if (trackNames == null) {
    trackNames = new String[RENDERER_COUNT][];
  }
  if (multiTrackSources == null) {
    multiTrackSources = new MultiTrackChunkSource[RENDERER_COUNT];
  }
  for (int rendererIndex = 0; rendererIndex < RENDERER_COUNT; rendererIndex++) {
    if (renderers[rendererIndex] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[rendererIndex] = new DummyTrackRenderer();
    }
    if (trackNames[rendererIndex] == null) {
      // Convert a null trackNames to an array of suitable length.
      int trackCount = multiTrackSources[rendererIndex] != null
          ? multiTrackSources[rendererIndex].getTrackCount() : 1;
      trackNames[rendererIndex] = new String[trackCount];
    }
  }
  // Complete preparation.
  this.trackNames = trackNames;
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:iview-android-tv    文件:VideoPlayer.java   
/**
   * Invoked with the results from a {@link RendererBuilder}.
   *
   * @param trackNames        The names of the available tracks, indexed by {@link VideoPlayer} TYPE_*
   *                          constants. May be null if the track names are unknown. An individual element may be null
   *                          if the track names are unknown for the corresponding type.
   * @param multiTrackSources Sources capable of switching between multiple available tracks,
   *                          indexed by {@link VideoPlayer} TYPE_* constants. May be null if there are no types with
   *                          multiple tracks. An individual element may be null if it does not have multiple tracks.
   * @param renderers         Renderers indexed by {@link VideoPlayer} TYPE_* constants. An individual
   *                          element may be null if there do not exist tracks of the corresponding type.
   * @param bandwidthMeter    Provides an estimate of the currently available bandwidth. May be null.
   */
/* package */ void onRenderers(String[][] trackNames,
                               MultiTrackChunkSource[] multiTrackSources, TrackRenderer[] renderers,
                               BandwidthMeter bandwidthMeter) {
      // Normalize the results.
      if (trackNames == null) {
          trackNames = new String[RENDERER_COUNT][];
      }
      if (multiTrackSources == null) {
          multiTrackSources = new MultiTrackChunkSource[RENDERER_COUNT];
      }
      for (int rendererIndex = 0; rendererIndex < RENDERER_COUNT; rendererIndex++) {
          if (renderers[rendererIndex] == null) {
              // Convert a null renderer to a dummy renderer.
              renderers[rendererIndex] = new DummyTrackRenderer();
          }
          if (trackNames[rendererIndex] == null) {
              // Convert a null trackNames to an array of suitable length.
              int trackCount = multiTrackSources[rendererIndex] != null
                      ? multiTrackSources[rendererIndex].getTrackCount() : 1;
              trackNames[rendererIndex] = new String[trackCount];
          }
      }
      // Complete preparation.
      this.trackNames = trackNames;
      this.videoRenderer = renderers[TYPE_VIDEO];
      this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
              : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
              ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
      this.multiTrackSources = multiTrackSources;
      this.bandwidthMeter = bandwidthMeter;
      pushSurface(false);
      pushTrackSelection(TYPE_VIDEO, true);
      pushTrackSelection(TYPE_AUDIO, true);
      pushTrackSelection(TYPE_TEXT, true);
      player.prepare(renderers);
      rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
  }
项目:Exoplayer_VLC    文件:VLCTrackRenderer.java   
VLCTrackRenderer(VLCSampleSource source, Handler eventHandler, MediaCodecTrackRenderer.EventListener eventListener,
        LibVLC vlc) {
    if (vlc == null)
        throw new NullPointerException("null vlc parm if prohibited");
    this.vlc = vlc;

    this.source = source;
    this.eventHandler = eventHandler;
    this.eventListener = eventListener;
}
项目:Exoplayer_VLC    文件:VLCTrackRenderer.java   
VLCTrackRenderer(VLCSampleSource source, Handler eventHandler, MediaCodecTrackRenderer.EventListener eventListener,
        LibVLC vlc) {
    if (vlc == null)
        throw new NullPointerException("null vlc parm if prohibited");
    this.vlc = vlc;

    this.source = source;
    this.eventHandler = eventHandler;
    this.eventListener = eventListener;
}
项目:OkPlayer    文件:OkPlayer.java   
/**
 * {@link MediaCodecTrackRenderer.EventListener}
 */
@Override
public void onDecoderInitializationError(MediaCodecTrackRenderer.DecoderInitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onDecoderInitializationError(e);
    }
}
项目:ExoPlayer    文件:DemoPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param trackNames The names of the available tracks, indexed by {@link DemoPlayer} TYPE_*
 *     constants. May be null if the track names are unknown. An individual element may be null
 *     if the track names are unknown for the corresponding type.
 * @param multiTrackSources Sources capable of switching between multiple available tracks,
 *     indexed by {@link DemoPlayer} TYPE_* constants. May be null if there are no types with
 *     multiple tracks. An individual element may be null if it does not have multiple tracks.
 * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual
 *     element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(String[][] trackNames,
    MultiTrackChunkSource[] multiTrackSources, TrackRenderer[] renderers,
    BandwidthMeter bandwidthMeter) {
  // Normalize the results.
  if (trackNames == null) {
    trackNames = new String[RENDERER_COUNT][];
  }
  if (multiTrackSources == null) {
    multiTrackSources = new MultiTrackChunkSource[RENDERER_COUNT];
  }
  for (int rendererIndex = 0; rendererIndex < RENDERER_COUNT; rendererIndex++) {
    if (renderers[rendererIndex] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[rendererIndex] = new DummyTrackRenderer();
    }
    if (trackNames[rendererIndex] == null) {
      // Convert a null trackNames to an array of suitable length.
      int trackCount = multiTrackSources[rendererIndex] != null
          ? multiTrackSources[rendererIndex].getTrackCount() : 1;
      trackNames[rendererIndex] = new String[trackCount];
    }
  }
  // Complete preparation.
  this.trackNames = trackNames;
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null;
  this.multiTrackSources = multiTrackSources;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  pushTrackSelection(TYPE_VIDEO, true);
  pushTrackSelection(TYPE_AUDIO, true);
  pushTrackSelection(TYPE_TEXT, true);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:miku    文件:MediaPlayer.java   
/**
 * Invoked with the results from a {@link RendererBuilder}.
 *
 * @param trackNames        The names of the available tracks, indexed by {@link MediaPlayer} TYPE_*
 *                          constants. May be null if the track names are unknown. An individual element may be
 *                          null
 *                          if the track names are unknown for the corresponding type.
 * @param multiTrackSources Sources capable of switching between multiple available tracks,
 *                          indexed by {@link MediaPlayer} TYPE_* constants. May be null if there are no types
 *                          with
 *                          multiple tracks. An individual element may be null if it does not have multiple
 *                          tracks.
 * @param renderers         Renderers indexed by {@link MediaPlayer} TYPE_* constants. An individual
 *                          element may be null if there do not exist tracks of the corresponding type.
 * @param bandwidthMeter    Provides an estimate of the currently available bandwidth. May be null.
 */
/* package */ void onRenderers(String[][] trackNames,
                               MultiTrackChunkSource[] multiTrackSources, TrackRenderer[] renderers,
                               BandwidthMeter bandwidthMeter) {
  // Normalize the results.
  if (trackNames == null) {
    trackNames = new String[RENDERER_COUNT][];
  }
  if (multiTrackSources == null) {
    multiTrackSources = new MultiTrackChunkSource[RENDERER_COUNT];
  }
  for (int rendererIndex = 0; rendererIndex < RENDERER_COUNT; rendererIndex++) {
    if (renderers[rendererIndex] == null) {
      // Convert a null renderer to a dummy renderer.
      renderers[rendererIndex] = new DummyTrackRenderer();
    }
    if (trackNames[rendererIndex] == null) {
      // Convert a null trackNames to an array of suitable length.
      int trackCount = multiTrackSources[rendererIndex] != null
          ? multiTrackSources[rendererIndex].getTrackCount()
          : 1;
      trackNames[rendererIndex] = new String[trackCount];
    }
  }
  // Complete preparation.
  this.trackNames = trackNames;
  this.videoRenderer = renderers[TYPE_VIDEO];
  this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters
      : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer
      ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters
      : null;
  this.multiTrackSources = multiTrackSources;
  this.bandwidthMeter = bandwidthMeter;
  pushSurface(false);
  pushTrackSelection(TYPE_VIDEO, true);
  pushTrackSelection(TYPE_AUDIO, true);
  pushTrackSelection(TYPE_TEXT, true);
  player.prepare(renderers);
  rendererBuildingState = RENDERER_BUILDING_STATE_BUILT;
}
项目:luxunPro    文件:EMExoPlayer.java   
@Override
public void onDecoderInitializationError(MediaCodecTrackRenderer.DecoderInitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onDecoderInitializationError(e);
    }
}
项目:AdvancedVideoView    文件:DebugTrackRenderer.java   
public DebugTrackRenderer(TextView textView, DemoPlayer player,
    MediaCodecTrackRenderer renderer) {
  this.textView = textView;
  this.player = player;
  this.renderer = renderer;
}
项目:ExoPlayerWrapper    文件:ExoPlayerWrapper.java   
@Override
public void onDecoderInitializationError(MediaCodecTrackRenderer.DecoderInitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onDecoderInitializationError(e);
    }
}
项目:ExoPlayerWrapper    文件:EventLogger.java   
@Override
public void onDecoderInitializationError(MediaCodecTrackRenderer.DecoderInitializationException e) {
    printInternalError("decoderInitializationError", e);
}
项目:android-exoplayer    文件:DebugTrackRenderer.java   
public DebugTrackRenderer(TextView textView, MediaCodecTrackRenderer renderer) {
  this(textView, renderer, null);
}