当前位置: 首页>>代码示例>>Java>>正文


Java DecoderCounters类代码示例

本文整理汇总了Java中com.google.android.exoplayer2.decoder.DecoderCounters的典型用法代码示例。如果您正苦于以下问题:Java DecoderCounters类的具体用法?Java DecoderCounters怎么用?Java DecoderCounters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DecoderCounters类属于com.google.android.exoplayer2.decoder包,在下文中一共展示了DecoderCounters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDecoderCountersBufferCountString

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
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;
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:13,代码来源:DebugTextViewHelper.java

示例2: assertSkippedOutputBufferCount

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
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);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:8,代码来源:DecoderCountersUtil.java

示例3: assertTotalOutputBufferCount

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
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);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:8,代码来源:DecoderCountersUtil.java

示例4: assertDroppedOutputBufferLimit

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
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);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:8,代码来源:DecoderCountersUtil.java

示例5: assertConsecutiveDroppedOutputBufferLimit

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
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);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:8,代码来源:DecoderCountersUtil.java

示例6: logMetrics

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@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();
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:15,代码来源:DashTest.java

示例7: assertPassed

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@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;
    }
  }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:34,代码来源:DashTest.java

示例8: onVideoEnabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@Override
public void onVideoEnabled(DecoderCounters counters) {
  videoDecoderCounters = counters;
  if (videoDebugListener != null) {
    videoDebugListener.onVideoEnabled(counters);
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:8,代码来源:SimpleExoPlayer.java

示例9: onVideoDisabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@Override
public void onVideoDisabled(DecoderCounters counters) {
  if (videoDebugListener != null) {
    videoDebugListener.onVideoDisabled(counters);
  }
  videoFormat = null;
  videoDecoderCounters = null;
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:9,代码来源:SimpleExoPlayer.java

示例10: onAudioEnabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@Override
public void onAudioEnabled(DecoderCounters counters) {
  audioDecoderCounters = counters;
  if (audioDebugListener != null) {
    audioDebugListener.onAudioEnabled(counters);
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:8,代码来源:SimpleExoPlayer.java

示例11: onAudioDisabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@Override
public void onAudioDisabled(DecoderCounters counters) {
  if (audioDebugListener != null) {
    audioDebugListener.onAudioDisabled(counters);
  }
  audioFormat = null;
  audioDecoderCounters = null;
  audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:10,代码来源:SimpleExoPlayer.java

示例12: onEnabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@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();
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:12,代码来源:SimpleDecoderAudioRenderer.java

示例13: enabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
/**
 * 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);
      }
    });
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:14,代码来源:AudioRendererEventListener.java

示例14: disabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
/**
 * 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);
      }
    });
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:15,代码来源:AudioRendererEventListener.java

示例15: enabled

import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
/**
 * 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);
      }
    });
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:14,代码来源:VideoRendererEventListener.java


注:本文中的com.google.android.exoplayer2.decoder.DecoderCounters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。