本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
}
}
示例8: onVideoEnabled
import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@Override
public void onVideoEnabled(DecoderCounters counters) {
videoDecoderCounters = counters;
if (videoDebugListener != null) {
videoDebugListener.onVideoEnabled(counters);
}
}
示例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;
}
示例10: onAudioEnabled
import com.google.android.exoplayer2.decoder.DecoderCounters; //导入依赖的package包/类
@Override
public void onAudioEnabled(DecoderCounters counters) {
audioDecoderCounters = counters;
if (audioDebugListener != null) {
audioDebugListener.onAudioEnabled(counters);
}
}
示例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;
}
示例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();
}
}
示例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);
}
});
}
}
示例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);
}
});
}
}
示例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);
}
});
}
}