mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
This commit is contained in:
parent
98bc817fe7
commit
b4f820d2af
7 changed files with 11 additions and 10 deletions
|
|
@ -139,7 +139,7 @@ import org.checkerframework.dataflow.qual.Pure;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public DecoderInputBuffer dequeueInputBuffer() {
|
public DecoderInputBuffer getInputBuffer() {
|
||||||
return hasPendingInputBuffer ? null : inputBuffer;
|
return hasPendingInputBuffer ? null : inputBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ import androidx.media3.decoder.DecoderInputBuffer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public DecoderInputBuffer dequeueInputBuffer() {
|
public DecoderInputBuffer getInputBuffer() {
|
||||||
return hasPendingBuffer ? null : buffer;
|
return hasPendingBuffer ? null : buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
@Override
|
@Override
|
||||||
@RequiresNonNull("sampleConsumer")
|
@RequiresNonNull("sampleConsumer")
|
||||||
protected boolean feedConsumerFromDecoder() throws TransformationException {
|
protected boolean feedConsumerFromDecoder() throws TransformationException {
|
||||||
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.dequeueInputBuffer();
|
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.getInputBuffer();
|
||||||
if (sampleConsumerInputBuffer == null) {
|
if (sampleConsumerInputBuffer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
*/
|
*/
|
||||||
@RequiresNonNull("sampleConsumer")
|
@RequiresNonNull("sampleConsumer")
|
||||||
private boolean feedConsumerFromInput() {
|
private boolean feedConsumerFromInput() {
|
||||||
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.dequeueInputBuffer();
|
@Nullable DecoderInputBuffer sampleConsumerInputBuffer = sampleConsumer.getInputBuffer();
|
||||||
if (sampleConsumerInputBuffer == null) {
|
if (sampleConsumerInputBuffer == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,19 +39,20 @@ public interface SampleConsumer {
|
||||||
* Returns a buffer if the consumer is ready to accept input, and {@code null} otherwise.
|
* 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
|
* <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.
|
* <p>Should only be used for compressed data and raw audio data.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
default DecoderInputBuffer dequeueInputBuffer() {
|
default DecoderInputBuffer getInputBuffer() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Informs the consumer that its input buffer contains new input.
|
* 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.
|
* input.
|
||||||
*
|
*
|
||||||
* <p>Should only be used for compressed data and raw audio data.
|
* <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
|
// The sample pipeline is drained before dequeuing input to maximise the chances of having an
|
||||||
// input buffer to dequeue.
|
// input buffer to dequeue.
|
||||||
while (samplePipeline.processData()) {}
|
while (samplePipeline.processData()) {}
|
||||||
pendingInputBuffer = samplePipeline.dequeueInputBuffer();
|
pendingInputBuffer = samplePipeline.getInputBuffer();
|
||||||
dequeueBufferConditionVariable.open();
|
dequeueBufferConditionVariable.open();
|
||||||
|
|
||||||
if (forceSilentAudio) {
|
if (forceSilentAudio) {
|
||||||
|
|
@ -640,7 +640,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public DecoderInputBuffer dequeueInputBuffer() {
|
public DecoderInputBuffer getInputBuffer() {
|
||||||
if (released) {
|
if (released) {
|
||||||
// Make sure there is no dequeue action waiting on the asset loader thread when it is
|
// Make sure there is no dequeue action waiting on the asset loader thread when it is
|
||||||
// being released to avoid a deadlock.
|
// being released to avoid a deadlock.
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ public class ExoPlayerAssetLoaderTest {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public DecoderInputBuffer dequeueInputBuffer() {
|
public DecoderInputBuffer getInputBuffer() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue