Java 类com.google.android.exoplayer2.decoder.DecoderCounters 实例源码

项目:yjPlay    文件:DebugTextViewHelper.java   
private static String getDecoderCountersBufferCountString(DecoderCounters counters) {
  if (counters == null) {
    return "";
  }
  counters.ensureUpdated();
  return " sib:" + counters.skippedInputBufferCount
      + " sb:" + counters.skippedOutputBufferCount
      + " rb:" + counters.renderedOutputBufferCount
      + " db:" + counters.droppedBufferCount
      + " mcdb:" + counters.maxConsecutiveDroppedBufferCount
      + " dk:" + counters.droppedToKeyframeCount;
}
项目:ExoPlayer-Offline    文件:DecoderCountersUtil.java   
public static void assertSkippedOutputBufferCount(String name, DecoderCounters counters,
    int expected) {
  counters.ensureUpdated();
  int actual = counters.skippedOutputBufferCount;
  TestCase.assertEquals("Codec(" + name + ") skipped " + actual + " buffers. Expected "
      + expected + ".", expected, actual);
}
项目:ExoPlayer-Offline    文件:DecoderCountersUtil.java   
public static void assertTotalOutputBufferCount(String name, DecoderCounters counters,
    int minCount, int maxCount) {
  counters.ensureUpdated();
  int actual = getTotalOutputBuffers(counters);
  TestCase.assertTrue("Codec(" + name + ") output " + actual + " buffers. Expected in range ["
      + minCount + ", " + maxCount + "].", minCount <= actual && actual <= maxCount);
}
项目:ExoPlayer-Offline    文件:DecoderCountersUtil.java   
public static void assertDroppedOutputBufferLimit(String name, DecoderCounters counters,
    int limit) {
  counters.ensureUpdated();
  int actual = counters.droppedOutputBufferCount;
  TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual + " buffers. "
      + "Limit: " + limit + ".", actual <= limit);
}
项目:ExoPlayer-Offline    文件:DecoderCountersUtil.java   
public static void assertConsecutiveDroppedOutputBufferLimit(String name,
    DecoderCounters counters, int limit) {
  counters.ensureUpdated();
  int actual = counters.maxConsecutiveDroppedOutputBufferCount;
  TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual
      + " buffers consecutively. " + "Limit: " + limit + ".", actual <= limit);
}
项目:ExoPlayer-Offline    文件:DashTest.java   
@Override
protected void logMetrics(DecoderCounters audioCounters, DecoderCounters videoCounters) {
  metricsLogger.logMetric(MetricsLogger.KEY_TEST_NAME, streamName);
  metricsLogger.logMetric(MetricsLogger.KEY_IS_CDD_LIMITED_RETRY, isCddLimitedRetry);
  metricsLogger.logMetric(MetricsLogger.KEY_FRAMES_DROPPED_COUNT,
      videoCounters.droppedOutputBufferCount);
  metricsLogger.logMetric(MetricsLogger.KEY_MAX_CONSECUTIVE_FRAMES_DROPPED_COUNT,
      videoCounters.maxConsecutiveDroppedOutputBufferCount);
  metricsLogger.logMetric(MetricsLogger.KEY_FRAMES_SKIPPED_COUNT,
      videoCounters.skippedOutputBufferCount);
  metricsLogger.logMetric(MetricsLogger.KEY_FRAMES_RENDERED_COUNT,
      videoCounters.renderedOutputBufferCount);
  metricsLogger.close();
}
项目:ExoPlayer-Offline    文件:DashTest.java   
@Override
protected void assertPassed(DecoderCounters audioCounters, DecoderCounters videoCounters) {
  if (fullPlaybackNoSeeking) {
    // We shouldn't have skipped any output buffers.
    DecoderCountersUtil.assertSkippedOutputBufferCount(AUDIO_TAG, audioCounters, 0);
    DecoderCountersUtil.assertSkippedOutputBufferCount(VIDEO_TAG, videoCounters, 0);
    // We allow one fewer output buffer due to the way that MediaCodecRenderer and the
    // underlying decoders handle the end of stream. This should be tightened up in the future.
    DecoderCountersUtil.assertTotalOutputBufferCount(AUDIO_TAG, audioCounters,
        audioCounters.inputBufferCount - 1, audioCounters.inputBufferCount);
    DecoderCountersUtil.assertTotalOutputBufferCount(VIDEO_TAG, videoCounters,
        videoCounters.inputBufferCount - 1, videoCounters.inputBufferCount);
  }
  try {
    int droppedFrameLimit = (int) Math.ceil(MAX_DROPPED_VIDEO_FRAME_FRACTION
        * DecoderCountersUtil.getTotalOutputBuffers(videoCounters));
    // Assert that performance is acceptable.
    // Assert that total dropped frames were within limit.
    DecoderCountersUtil.assertDroppedOutputBufferLimit(VIDEO_TAG, videoCounters,
        droppedFrameLimit);
    // Assert that consecutive dropped frames were within limit.
    DecoderCountersUtil.assertConsecutiveDroppedOutputBufferLimit(VIDEO_TAG, videoCounters,
        MAX_CONSECUTIVE_DROPPED_VIDEO_FRAMES);
  } catch (AssertionFailedError e) {
    if (trackSelector.includedAdditionalVideoFormats) {
      // Retry limiting to CDD mandated formats (b/28220076).
      Log.e(TAG, "Too many dropped or consecutive dropped frames.", e);
      needsCddLimitedRetry = true;
    } else {
      throw e;
    }
  }
}
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
  videoDecoderCounters = counters;
  if (videoDebugListener != null) {
    videoDebugListener.onVideoEnabled(counters);
  }
}
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
  if (videoDebugListener != null) {
    videoDebugListener.onVideoDisabled(counters);
  }
  videoFormat = null;
  videoDecoderCounters = null;
}
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
@Override
public void onAudioEnabled(DecoderCounters counters) {
  audioDecoderCounters = counters;
  if (audioDebugListener != null) {
    audioDebugListener.onAudioEnabled(counters);
  }
}
项目:Exoplayer2Radio    文件:SimpleExoPlayer.java   
@Override
public void onAudioDisabled(DecoderCounters counters) {
  if (audioDebugListener != null) {
    audioDebugListener.onAudioDisabled(counters);
  }
  audioFormat = null;
  audioDecoderCounters = null;
  audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
项目:Exoplayer2Radio    文件:SimpleDecoderAudioRenderer.java   
@Override
protected void onEnabled(boolean joining) throws ExoPlaybackException {
  decoderCounters = new DecoderCounters();
  eventDispatcher.enabled(decoderCounters);
  int tunnelingAudioSessionId = getConfiguration().tunnelingAudioSessionId;
  if (tunnelingAudioSessionId != C.AUDIO_SESSION_ID_UNSET) {
    audioTrack.enableTunnelingV21(tunnelingAudioSessionId);
  } else {
    audioTrack.disableTunneling();
  }
}
项目:Exoplayer2Radio    文件:AudioRendererEventListener.java   
/**
 * Invokes {@link AudioRendererEventListener#onAudioEnabled(DecoderCounters)}.
 */
public void enabled(final DecoderCounters decoderCounters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        listener.onAudioEnabled(decoderCounters);
      }
    });
  }
}
项目:Exoplayer2Radio    文件:AudioRendererEventListener.java   
/**
 * Invokes {@link AudioRendererEventListener#onAudioDisabled(DecoderCounters)}.
 */
public void disabled(final DecoderCounters counters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        counters.ensureUpdated();
        listener.onAudioDisabled(counters);
      }
    });
  }
}
项目:Exoplayer2Radio    文件:VideoRendererEventListener.java   
/**
 * Invokes {@link VideoRendererEventListener#onVideoEnabled(DecoderCounters)}.
 */
public void enabled(final DecoderCounters decoderCounters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        listener.onVideoEnabled(decoderCounters);
      }
    });
  }
}
项目:Exoplayer2Radio    文件:VideoRendererEventListener.java   
/**
 * Invokes {@link VideoRendererEventListener#onVideoDisabled(DecoderCounters)}.
 */
public void disabled(final DecoderCounters counters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        counters.ensureUpdated();
        listener.onVideoDisabled(counters);
      }
    });
  }
}
项目:GSYVideoPlayer    文件:SimpleExoPlayer2.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
  videoDecoderCounters = counters;
  if (videoDebugListener != null) {
    videoDebugListener.onVideoEnabled(counters);
  }
}
项目:GSYVideoPlayer    文件:SimpleExoPlayer2.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
  if (videoDebugListener != null) {
    videoDebugListener.onVideoDisabled(counters);
  }
  videoFormat = null;
  videoDecoderCounters = null;
}
项目:GSYVideoPlayer    文件:SimpleExoPlayer2.java   
@Override
public void onAudioEnabled(DecoderCounters counters) {
  audioDecoderCounters = counters;
  if (audioDebugListener != null) {
    audioDebugListener.onAudioEnabled(counters);
  }
}
项目:GSYVideoPlayer    文件:SimpleExoPlayer2.java   
@Override
public void onAudioDisabled(DecoderCounters counters) {
  if (audioDebugListener != null) {
    audioDebugListener.onAudioDisabled(counters);
  }
  audioFormat = null;
  audioDecoderCounters = null;
  audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
项目:no-player    文件:VideoRendererInfoForwarder.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
    HashMap<String, String> callingMethodParameters = new HashMap<>();

    callingMethodParameters.put("counters", String.valueOf(counters));

    infoListener.onNewInfo("onVideoEnabled", callingMethodParameters);
}
项目:no-player    文件:VideoRendererInfoForwarder.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
    HashMap<String, String> callingMethodParameters = new HashMap<>();

    callingMethodParameters.put("counters", String.valueOf(counters));

    infoListener.onNewInfo("onVideoDisabled", callingMethodParameters);
}
项目:K-Sonic    文件:DebugTextViewHelper.java   
private static String getDecoderCountersBufferCountString(DecoderCounters counters) {
  if (counters == null) {
    return "";
  }
  counters.ensureUpdated();
  return " rb:" + counters.renderedOutputBufferCount
      + " sb:" + counters.skippedOutputBufferCount
      + " db:" + counters.droppedOutputBufferCount
      + " mcdb:" + counters.maxConsecutiveDroppedOutputBufferCount;
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
  videoDecoderCounters = counters;
  if (videoDebugListener != null) {
    videoDebugListener.onVideoEnabled(counters);
  }
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
  if (videoDebugListener != null) {
    videoDebugListener.onVideoDisabled(counters);
  }
  videoFormat = null;
  videoDecoderCounters = null;
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
@Override
public void onAudioEnabled(DecoderCounters counters) {
  audioDecoderCounters = counters;
  if (audioDebugListener != null) {
    audioDebugListener.onAudioEnabled(counters);
  }
}
项目:K-Sonic    文件:SimpleExoPlayer.java   
@Override
public void onAudioDisabled(DecoderCounters counters) {
  if (audioDebugListener != null) {
    audioDebugListener.onAudioDisabled(counters);
  }
  audioFormat = null;
  audioDecoderCounters = null;
  audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
项目:K-Sonic    文件:SimpleDecoderAudioRenderer.java   
@Override
protected void onEnabled(boolean joining) throws ExoPlaybackException {
  decoderCounters = new DecoderCounters();
  eventDispatcher.enabled(decoderCounters);
  int tunnelingAudioSessionId = getConfiguration().tunnelingAudioSessionId;
  if (tunnelingAudioSessionId != C.AUDIO_SESSION_ID_UNSET) {
    audioTrack.enableTunnelingV21(tunnelingAudioSessionId);
  } else {
    audioTrack.disableTunneling();
  }
}
项目:K-Sonic    文件:AudioRendererEventListener.java   
/**
 * Invokes {@link AudioRendererEventListener#onAudioEnabled(DecoderCounters)}.
 */
public void enabled(final DecoderCounters decoderCounters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        listener.onAudioEnabled(decoderCounters);
      }
    });
  }
}
项目:K-Sonic    文件:AudioRendererEventListener.java   
/**
 * Invokes {@link AudioRendererEventListener#onAudioDisabled(DecoderCounters)}.
 */
public void disabled(final DecoderCounters counters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        counters.ensureUpdated();
        listener.onAudioDisabled(counters);
      }
    });
  }
}
项目:K-Sonic    文件:VideoRendererEventListener.java   
/**
 * Invokes {@link VideoRendererEventListener#onVideoEnabled(DecoderCounters)}.
 */
public void enabled(final DecoderCounters decoderCounters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        listener.onVideoEnabled(decoderCounters);
      }
    });
  }
}
项目:K-Sonic    文件:VideoRendererEventListener.java   
/**
 * Invokes {@link VideoRendererEventListener#onVideoDisabled(DecoderCounters)}.
 */
public void disabled(final DecoderCounters counters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        counters.ensureUpdated();
        listener.onVideoDisabled(counters);
      }
    });
  }
}
项目:videoPickPlayer    文件:DebugTextViewHelper.java   
private static String getDecoderCountersBufferCountString(DecoderCounters counters) {
  if (counters == null) {
    return "";
  }
  counters.ensureUpdated();
  return " rb:" + counters.renderedOutputBufferCount
      + " sb:" + counters.skippedOutputBufferCount
      + " db:" + counters.droppedOutputBufferCount
      + " mcdb:" + counters.maxConsecutiveDroppedOutputBufferCount;
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
@Override
public void onVideoEnabled(DecoderCounters counters) {
  videoDecoderCounters = counters;
  if (videoDebugListener != null) {
    videoDebugListener.onVideoEnabled(counters);
  }
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
@Override
public void onVideoDisabled(DecoderCounters counters) {
  if (videoDebugListener != null) {
    videoDebugListener.onVideoDisabled(counters);
  }
  videoFormat = null;
  videoDecoderCounters = null;
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
@Override
public void onAudioEnabled(DecoderCounters counters) {
  audioDecoderCounters = counters;
  if (audioDebugListener != null) {
    audioDebugListener.onAudioEnabled(counters);
  }
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
@Override
public void onAudioDisabled(DecoderCounters counters) {
  if (audioDebugListener != null) {
    audioDebugListener.onAudioDisabled(counters);
  }
  audioFormat = null;
  audioDecoderCounters = null;
  audioSessionId = AudioTrack.SESSION_ID_NOT_SET;
}
项目:videoPickPlayer    文件:AudioRendererEventListener.java   
/**
 * Invokes {@link AudioRendererEventListener#onAudioEnabled(DecoderCounters)}.
 */
public void enabled(final DecoderCounters decoderCounters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        listener.onAudioEnabled(decoderCounters);
      }
    });
  }
}
项目:videoPickPlayer    文件:AudioRendererEventListener.java   
/**
 * Invokes {@link AudioRendererEventListener#onAudioDisabled(DecoderCounters)}.
 */
public void disabled(final DecoderCounters counters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        counters.ensureUpdated();
        listener.onAudioDisabled(counters);
      }
    });
  }
}
项目:videoPickPlayer    文件:VideoRendererEventListener.java   
/**
 * Invokes {@link VideoRendererEventListener#onVideoEnabled(DecoderCounters)}.
 */
public void enabled(final DecoderCounters decoderCounters) {
  if (listener != null) {
    handler.post(new Runnable() {
      @Override
      public void run() {
        listener.onVideoEnabled(decoderCounters);
      }
    });
  }
}