Commit 886063d6 by kimvde Committed by christosts

Rename SampleConsumer dequeueInputBuffer to getInputBuffer

This makes more sense as SampleConsumer.dequeueInputBuffer returns the
same buffer as long as it is not queued.

PiperOrigin-RevId: 500631982
parent c642f811
......@@ -139,7 +139,7 @@ import org.checkerframework.dataflow.qual.Pure;
@Override
@Nullable
public DecoderInputBuffer dequeueInputBuffer() {
public DecoderInputBuffer getInputBuffer() {
return hasPendingInputBuffer ? null : inputBuffer;
}
......
......@@ -47,7 +47,7 @@ import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
@Override
@Nullable
public DecoderInputBuffer dequeueInputBuffer() {
public DecoderInputBuffer getInputBuffer() {
return hasPendingBuffer ? null : buffer;
}
......
......@@ -60,7 +60,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Override
@RequiresNonNull("sampleConsumer")
protected boolean feedConsumerFromDecoder() throws TransformationException {
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.dequeueInputBuffer();
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.getInputBuffer();
if (sampleConsumerInputBuffer == null) {
return false;
}
......
......@@ -221,7 +221,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
*/
@RequiresNonNull("sampleConsumer")
private boolean feedConsumerFromInput() {
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.dequeueInputBuffer();
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.getInputBuffer();
if (sampleConsumerInputBuffer == null) {
return false;
}
......
......@@ -37,19 +37,20 @@ public interface SampleConsumer {
* Returns a buffer if the consumer is ready to accept input, and {@code null} otherwise.
*
* <p>If the consumer is ready to accept input and this method is called multiple times before
* {@linkplain #queueInputBuffer() queuing} input, the same buffer instance is returned.
* {@linkplain #queueInputBuffer() queuing} input, the same {@link DecoderInputBuffer} instance is
* returned.
*
* <p>Should only be used for compressed data and raw audio data.
*/
@Nullable
default DecoderInputBuffer dequeueInputBuffer() {
default DecoderInputBuffer getInputBuffer() {
throw new UnsupportedOperationException();
}
/**
* Informs the consumer that its input buffer contains new input.
*
* <p>Should be called after filling the input buffer from {@link #dequeueInputBuffer()} with new
* <p>Should be called after filling the input buffer from {@link #getInputBuffer()} with new
* input.
*
* <p>Should only be used for compressed data and raw audio data.
......
......@@ -278,7 +278,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// The sample pipeline is drained before dequeuing input to maximise the chances of having an
// input buffer to dequeue.
while (samplePipeline.processData()) {}
pendingInputBuffer = samplePipeline.dequeueInputBuffer();
pendingInputBuffer = samplePipeline.getInputBuffer();
dequeueBufferConditionVariable.open();
if (forceSilentAudio) {
......@@ -640,7 +640,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Nullable
@Override
public DecoderInputBuffer dequeueInputBuffer() {
public DecoderInputBuffer getInputBuffer() {
if (released) {
// Make sure there is no dequeue action waiting on the asset loader thread when it is
// being released to avoid a deadlock.
......
......@@ -139,7 +139,7 @@ public class ExoPlayerAssetLoaderTest {
@Nullable
@Override
public DecoderInputBuffer dequeueInputBuffer() {
public DecoderInputBuffer getInputBuffer() {
return null;
}
......
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