Implement onInit() and onRelease() in FakeRenderer

PiperOrigin-RevId: 606301390
This commit is contained in:
tianyifeng 2024-02-12 10:54:29 -08:00 committed by Copybara-Service
parent 216f3fedb8
commit 2b473831c6
2 changed files with 13 additions and 0 deletions

View File

@ -39,6 +39,7 @@
* Leanback extension: * Leanback extension:
* Cast Extension: * Cast Extension:
* Test Utilities: * Test Utilities:
* Implement `onInit()` and `onRelease()` in `FakeRenderer`.
* Remove deprecated symbols: * Remove deprecated symbols:
* Demo app: * Demo app:

View File

@ -61,7 +61,9 @@ public class FakeRenderer extends BaseRenderer {
private boolean hasPendingBuffer; private boolean hasPendingBuffer;
private List<Format> formatsRead; private List<Format> formatsRead;
public boolean isInitialized;
public boolean isEnded; public boolean isEnded;
public boolean isReleased;
public int positionResetCount; public int positionResetCount;
public int sampleBufferReadCount; public int sampleBufferReadCount;
public int enabledCount; public int enabledCount;
@ -196,4 +198,14 @@ public class FakeRenderer extends BaseRenderer {
protected boolean shouldProcessBuffer(long bufferTimeUs, long playbackPositionUs) { protected boolean shouldProcessBuffer(long bufferTimeUs, long playbackPositionUs) {
return bufferTimeUs < playbackPositionUs + SOURCE_READAHEAD_US; return bufferTimeUs < playbackPositionUs + SOURCE_READAHEAD_US;
} }
@Override
protected void onInit() {
isInitialized = true;
}
@Override
protected void onRelease() {
isReleased = true;
}
} }