Commit 31a839c8 by olly Committed by Christos Tsilopoulos

Move non-player specific classes to common

These will all be needed in common to break dependencies
between decoder extension modules and the core module.

PiperOrigin-RevId: 389871983
parent b4e99304
...@@ -40,9 +40,9 @@ public abstract class SimpleDecoder< ...@@ -40,9 +40,9 @@ public abstract class SimpleDecoder<
private int availableInputBufferCount; private int availableInputBufferCount;
private int availableOutputBufferCount; private int availableOutputBufferCount;
private I dequeuedInputBuffer; @Nullable private I dequeuedInputBuffer;
private E exception; @Nullable private E exception;
private boolean flushed; private boolean flushed;
private boolean released; private boolean released;
private int skippedOutputBufferCount; private int skippedOutputBufferCount;
...@@ -51,6 +51,7 @@ public abstract class SimpleDecoder< ...@@ -51,6 +51,7 @@ public abstract class SimpleDecoder<
* @param inputBuffers An array of nulls that will be used to store references to input buffers. * @param inputBuffers An array of nulls that will be used to store references to input buffers.
* @param outputBuffers An array of nulls that will be used to store references to output buffers. * @param outputBuffers An array of nulls that will be used to store references to output buffers.
*/ */
@SuppressWarnings("nullness:method.invocation")
protected SimpleDecoder(I[] inputBuffers, O[] outputBuffers) { protected SimpleDecoder(I[] inputBuffers, O[] outputBuffers) {
lock = new Object(); lock = new Object();
queuedInputBuffers = new ArrayDeque<>(); queuedInputBuffers = new ArrayDeque<>();
...@@ -178,6 +179,7 @@ public abstract class SimpleDecoder< ...@@ -178,6 +179,7 @@ public abstract class SimpleDecoder<
* @throws E The decode exception. * @throws E The decode exception.
*/ */
private void maybeThrowException() throws E { private void maybeThrowException() throws E {
@Nullable E exception = this.exception;
if (exception != null) { if (exception != null) {
throw exception; throw exception;
} }
......
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