mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Rename droppedOutputBufferCount
Now this counter includes input buffers too, which are dropped as part of skipping to keyframes for catch up. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171119930
This commit is contained in:
parent
331c179a88
commit
09165ab870
@ -342,11 +342,11 @@ public final class LibvpxVideoRenderer extends BaseRenderer {
|
||||
}
|
||||
|
||||
private void dropBuffer() {
|
||||
decoderCounters.droppedOutputBufferCount++;
|
||||
decoderCounters.droppedBufferCount++;
|
||||
droppedFrames++;
|
||||
consecutiveDroppedFrameCount++;
|
||||
decoderCounters.maxConsecutiveDroppedOutputBufferCount = Math.max(
|
||||
consecutiveDroppedFrameCount, decoderCounters.maxConsecutiveDroppedOutputBufferCount);
|
||||
decoderCounters.maxConsecutiveDroppedBufferCount = Math.max(
|
||||
consecutiveDroppedFrameCount, decoderCounters.maxConsecutiveDroppedBufferCount);
|
||||
if (droppedFrames == maxDroppedFramesToNotify) {
|
||||
maybeNotifyDroppedFrames();
|
||||
}
|
||||
|
@ -53,24 +53,24 @@ public final class DecoderCounters {
|
||||
*/
|
||||
public int skippedOutputBufferCount;
|
||||
/**
|
||||
* The number of dropped output buffers.
|
||||
* The number of dropped buffers.
|
||||
* <p>
|
||||
* A dropped output buffer is an output buffer that was supposed to be rendered, but was instead
|
||||
* A dropped buffer is an buffer that was supposed to be decoded/rendered, but was instead
|
||||
* dropped because it could not be rendered in time.
|
||||
*/
|
||||
public int droppedOutputBufferCount;
|
||||
public int droppedBufferCount;
|
||||
/**
|
||||
* The maximum number of dropped output buffers without an interleaving rendered output buffer.
|
||||
* The maximum number of dropped buffers without an interleaving rendered output buffer.
|
||||
* <p>
|
||||
* Skipped output buffers are ignored for the purposes of calculating this value.
|
||||
*/
|
||||
public int maxConsecutiveDroppedOutputBufferCount;
|
||||
public int maxConsecutiveDroppedBufferCount;
|
||||
/**
|
||||
* The number of times all buffers to a keyframe were dropped.
|
||||
* <p>
|
||||
* Each time buffers to a keyframe are dropped, this counter is increased by one, and the dropped
|
||||
* output buffer counters are increased by one (for the current output buffer) plus the number of
|
||||
* buffers dropped from the source to advance to the keyframe.
|
||||
* buffer counters are increased by one (for the current output buffer) plus the number of buffers
|
||||
* dropped from the source to advance to the keyframe.
|
||||
*/
|
||||
public int droppedToKeyframeCount;
|
||||
|
||||
@ -96,9 +96,9 @@ public final class DecoderCounters {
|
||||
skippedInputBufferCount += other.skippedInputBufferCount;
|
||||
renderedOutputBufferCount += other.renderedOutputBufferCount;
|
||||
skippedOutputBufferCount += other.skippedOutputBufferCount;
|
||||
droppedOutputBufferCount += other.droppedOutputBufferCount;
|
||||
maxConsecutiveDroppedOutputBufferCount = Math.max(maxConsecutiveDroppedOutputBufferCount,
|
||||
other.maxConsecutiveDroppedOutputBufferCount);
|
||||
droppedBufferCount += other.droppedBufferCount;
|
||||
maxConsecutiveDroppedBufferCount = Math.max(maxConsecutiveDroppedBufferCount,
|
||||
other.maxConsecutiveDroppedBufferCount);
|
||||
droppedToKeyframeCount += other.droppedToKeyframeCount;
|
||||
}
|
||||
|
||||
|
@ -700,11 +700,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||
* @param droppedBufferCount The number of additional dropped buffers.
|
||||
*/
|
||||
protected void updateDroppedBufferCounters(int droppedBufferCount) {
|
||||
decoderCounters.droppedOutputBufferCount += droppedBufferCount;
|
||||
decoderCounters.droppedBufferCount += droppedBufferCount;
|
||||
droppedFrames += droppedBufferCount;
|
||||
consecutiveDroppedFrameCount += droppedBufferCount;
|
||||
decoderCounters.maxConsecutiveDroppedOutputBufferCount = Math.max(consecutiveDroppedFrameCount,
|
||||
decoderCounters.maxConsecutiveDroppedOutputBufferCount);
|
||||
decoderCounters.maxConsecutiveDroppedBufferCount = Math.max(consecutiveDroppedFrameCount,
|
||||
decoderCounters.maxConsecutiveDroppedBufferCount);
|
||||
if (droppedFrames >= maxDroppedFramesToNotify) {
|
||||
maybeNotifyDroppedFrames();
|
||||
}
|
||||
|
@ -154,8 +154,8 @@ public final class DebugTextViewHelper extends Player.DefaultEventListener imple
|
||||
return " sib:" + counters.skippedInputBufferCount
|
||||
+ " sb:" + counters.skippedOutputBufferCount
|
||||
+ " rb:" + counters.renderedOutputBufferCount
|
||||
+ " db:" + counters.droppedOutputBufferCount
|
||||
+ " mcdb:" + counters.maxConsecutiveDroppedOutputBufferCount
|
||||
+ " db:" + counters.droppedBufferCount
|
||||
+ " mcdb:" + counters.maxConsecutiveDroppedBufferCount
|
||||
+ " dk:" + counters.droppedToKeyframeCount;
|
||||
}
|
||||
|
||||
|
@ -323,9 +323,9 @@ public final class DashTestRunner {
|
||||
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);
|
||||
videoCounters.droppedBufferCount);
|
||||
metricsLogger.logMetric(MetricsLogger.KEY_MAX_CONSECUTIVE_FRAMES_DROPPED_COUNT,
|
||||
videoCounters.maxConsecutiveDroppedOutputBufferCount);
|
||||
videoCounters.maxConsecutiveDroppedBufferCount);
|
||||
metricsLogger.logMetric(MetricsLogger.KEY_FRAMES_SKIPPED_COUNT,
|
||||
videoCounters.skippedOutputBufferCount);
|
||||
metricsLogger.logMetric(MetricsLogger.KEY_FRAMES_RENDERED_COUNT,
|
||||
@ -343,20 +343,20 @@ public final class DashTestRunner {
|
||||
.assertSkippedOutputBufferCount(tag + VIDEO_TAG_SUFFIX, 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(tag + AUDIO_TAG_SUFFIX, audioCounters,
|
||||
DecoderCountersUtil.assertTotalBufferCount(tag + AUDIO_TAG_SUFFIX, audioCounters,
|
||||
audioCounters.inputBufferCount - 1, audioCounters.inputBufferCount);
|
||||
DecoderCountersUtil.assertTotalOutputBufferCount(tag + VIDEO_TAG_SUFFIX, videoCounters,
|
||||
DecoderCountersUtil.assertTotalBufferCount(tag + VIDEO_TAG_SUFFIX, videoCounters,
|
||||
videoCounters.inputBufferCount - 1, videoCounters.inputBufferCount);
|
||||
}
|
||||
try {
|
||||
int droppedFrameLimit = (int) Math.ceil(MAX_DROPPED_VIDEO_FRAME_FRACTION
|
||||
* DecoderCountersUtil.getTotalOutputBuffers(videoCounters));
|
||||
* DecoderCountersUtil.getTotalBufferCount(videoCounters));
|
||||
// Assert that performance is acceptable.
|
||||
// Assert that total dropped frames were within limit.
|
||||
DecoderCountersUtil.assertDroppedOutputBufferLimit(tag + VIDEO_TAG_SUFFIX, videoCounters,
|
||||
DecoderCountersUtil.assertDroppedBufferLimit(tag + VIDEO_TAG_SUFFIX, videoCounters,
|
||||
droppedFrameLimit);
|
||||
// Assert that consecutive dropped frames were within limit.
|
||||
DecoderCountersUtil.assertConsecutiveDroppedOutputBufferLimit(tag + VIDEO_TAG_SUFFIX,
|
||||
DecoderCountersUtil.assertConsecutiveDroppedBufferLimit(tag + VIDEO_TAG_SUFFIX,
|
||||
videoCounters, MAX_CONSECUTIVE_DROPPED_VIDEO_FRAMES);
|
||||
} catch (AssertionFailedError e) {
|
||||
if (trackSelector.includedAdditionalVideoFormats) {
|
||||
|
@ -31,8 +31,9 @@ public final class DecoderCountersUtil {
|
||||
* @param counters The counters for which the total should be calculated.
|
||||
* @return The sum of the skipped, dropped and rendered buffers.
|
||||
*/
|
||||
public static int getTotalOutputBuffers(DecoderCounters counters) {
|
||||
return counters.skippedOutputBufferCount + counters.droppedOutputBufferCount
|
||||
public static int getTotalBufferCount(DecoderCounters counters) {
|
||||
counters.ensureUpdated();
|
||||
return counters.skippedOutputBufferCount + counters.droppedBufferCount
|
||||
+ counters.renderedOutputBufferCount;
|
||||
}
|
||||
|
||||
@ -44,26 +45,24 @@ public final class DecoderCountersUtil {
|
||||
+ expected + ".", expected, actual);
|
||||
}
|
||||
|
||||
public static void assertTotalOutputBufferCount(String name, DecoderCounters counters,
|
||||
int minCount, int maxCount) {
|
||||
counters.ensureUpdated();
|
||||
int actual = getTotalOutputBuffers(counters);
|
||||
public static void assertTotalBufferCount(String name, DecoderCounters counters, int minCount,
|
||||
int maxCount) {
|
||||
int actual = getTotalBufferCount(counters);
|
||||
TestCase.assertTrue("Codec(" + name + ") output " + actual + " buffers. Expected in range ["
|
||||
+ minCount + ", " + maxCount + "].", minCount <= actual && actual <= maxCount);
|
||||
}
|
||||
|
||||
public static void assertDroppedOutputBufferLimit(String name, DecoderCounters counters,
|
||||
int limit) {
|
||||
public static void assertDroppedBufferLimit(String name, DecoderCounters counters, int limit) {
|
||||
counters.ensureUpdated();
|
||||
int actual = counters.droppedOutputBufferCount;
|
||||
int actual = counters.droppedBufferCount;
|
||||
TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual + " buffers. "
|
||||
+ "Limit: " + limit + ".", actual <= limit);
|
||||
}
|
||||
|
||||
public static void assertConsecutiveDroppedOutputBufferLimit(String name,
|
||||
DecoderCounters counters, int limit) {
|
||||
public static void assertConsecutiveDroppedBufferLimit(String name, DecoderCounters counters,
|
||||
int limit) {
|
||||
counters.ensureUpdated();
|
||||
int actual = counters.maxConsecutiveDroppedOutputBufferCount;
|
||||
int actual = counters.maxConsecutiveDroppedBufferCount;
|
||||
TestCase.assertTrue("Codec(" + name + ") was late decoding: " + actual
|
||||
+ " buffers consecutively. " + "Limit: " + limit + ".", actual <= limit);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user