Commit 2fba9215 by christosts Committed by Andrew Lewis

DebugMediaCodecVideoRenderer clean-up

After refactoring MediaCodecRenderer's configureCodec() to
getMediaCodecConfiguration(), there was some state initialization left
in DebugMediaCodecVideoRenderer's configureCodec(). This is now moved
inside DebugMediaCodecVideoRenderer.onCodecInitialized().

PiperOrigin-RevId: 370430193
parent d8ff0210
......@@ -133,12 +133,6 @@ import java.util.ArrayList;
@Override
protected MediaCodecAdapter.Configuration getMediaCodecConfiguration(
MediaCodecInfo codecInfo, Format format, MediaCrypto crypto, float operatingRate) {
// If the codec is being initialized whilst the renderer is started, default behavior is to
// render the first frame (i.e. the keyframe before the current position), then drop frames up
// to the current playback position. For test runs that place a maximum limit on the number of
// dropped frames allowed, this is not desired behavior. Hence we skip (rather than drop)
// frames up to the current playback position [Internal: b/66494991].
skipToPositionBeforeRenderingFirstFrame = getState() == Renderer.STATE_STARTED;
return super.getMediaCodecConfiguration(codecInfo, format, crypto, operatingRate);
}
......@@ -156,6 +150,18 @@ import java.util.ArrayList;
}
@Override
protected void onCodecInitialized(
String name, long initializedTimestampMs, long initializationDurationMs) {
// If the codec was initialized whilst the renderer is started, default behavior is to
// render the first frame (i.e. the keyframe before the current position), then drop frames up
// to the current playback position. For test runs that place a maximum limit on the number of
// dropped frames allowed, this is not desired behavior. Hence we skip (rather than drop)
// frames up to the current playback position [Internal: b/66494991].
skipToPositionBeforeRenderingFirstFrame = getState() == Renderer.STATE_STARTED;
super.onCodecInitialized(name, initializedTimestampMs, initializationDurationMs);
}
@Override
protected void resetCodecStateForRelease() {
super.resetCodecStateForRelease();
skipToPositionBeforeRenderingFirstFrame = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment