Rename TimestampIterator argument name in queueInputBitmap()

#minor-release

PiperOrigin-RevId: 599460771
This commit is contained in:
christosts 2024-01-18 03:58:33 -08:00 committed by Copybara-Service
parent 5eb1f4043b
commit 0e66197419
6 changed files with 17 additions and 17 deletions

View File

@ -175,14 +175,14 @@ public interface VideoFrameProcessor {
* the input stream} to put multiple frames in the same input stream.
*
* @param inputBitmap The {@link Bitmap} queued to the {@code VideoFrameProcessor}.
* @param inStreamOffsetsUs The times within the current stream that the bitmap should be shown
* at. The timestamps should be monotonically increasing.
* @param timestampIterator A {@link TimestampIterator} generating the exact timestamps that the
* bitmap should be shown at.
* @return Whether the {@link Bitmap} was successfully queued. A return value of {@code false}
* indicates the {@code VideoFrameProcessor} is not ready to accept input.
* @throws UnsupportedOperationException If the {@code VideoFrameProcessor} does not accept
* {@linkplain #INPUT_TYPE_BITMAP bitmap input}.
*/
boolean queueInputBitmap(Bitmap inputBitmap, TimestampIterator inStreamOffsetsUs);
boolean queueInputBitmap(Bitmap inputBitmap, TimestampIterator timestampIterator);
/**
* Provides an input texture ID to the {@code VideoFrameProcessor}.

View File

@ -387,7 +387,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
}
@Override
public boolean queueInputBitmap(Bitmap inputBitmap, TimestampIterator inStreamOffsetsUs) {
public boolean queueInputBitmap(Bitmap inputBitmap, TimestampIterator timestampIterator) {
if (!inputStreamRegisteredCondition.isOpen()) {
return false;
}
@ -397,7 +397,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
.queueInputBitmap(
inputBitmap,
new FrameInfo.Builder(frameInfo).setOffsetToAddUs(frameInfo.offsetToAddUs).build(),
inStreamOffsetsUs,
timestampIterator,
/* useHdr= */ false);
return true;
}

View File

@ -158,12 +158,12 @@ public interface VideoSink {
* Provides an input {@link Bitmap} to the video sink.
*
* @param inputBitmap The {@link Bitmap} queued to the video sink.
* @param inStreamOffsetsUs The times within the current stream that the bitmap should be shown
* @param timestampIterator The times within the current stream that the bitmap should be shown
* at. The timestamps should be monotonically increasing.
* @return Whether the bitmap was queued successfully. A {@code false} value indicates the caller
* must try again later.
*/
boolean queueBitmap(Bitmap inputBitmap, TimestampIterator inStreamOffsetsUs);
boolean queueBitmap(Bitmap inputBitmap, TimestampIterator timestampIterator);
/**
* Incrementally renders processed video frames.

View File

@ -112,12 +112,12 @@ public interface SampleConsumer {
* <p>Should only be used for image data.
*
* @param inputBitmap The {@link Bitmap} to queue to the consumer.
* @param inStreamOffsetsUs The times within the current stream that the bitmap should be
* displayed at. The timestamps should be monotonically increasing.
* @param timestampIterator A {@link TimestampIterator} generating the exact timestamps that the
* bitmap should be shown at.
* @return The {@link InputResult} describing the result of the operation.
*/
default @InputResult int queueInputBitmap(
Bitmap inputBitmap, TimestampIterator inStreamOffsetsUs) {
Bitmap inputBitmap, TimestampIterator timestampIterator) {
throw new UnsupportedOperationException();
}

View File

@ -402,11 +402,11 @@ import java.util.concurrent.atomic.AtomicInteger;
@Override
public @InputResult int queueInputBitmap(
Bitmap inputBitmap, TimestampIterator inStreamOffsetsUs) {
Bitmap inputBitmap, TimestampIterator timestampIterator) {
if (isLooping) {
long lastOffsetUs = C.TIME_UNSET;
while (inStreamOffsetsUs.hasNext()) {
long offsetUs = inStreamOffsetsUs.next();
while (timestampIterator.hasNext()) {
long offsetUs = timestampIterator.next();
if (totalDurationUs + offsetUs > maxSequenceDurationUs) {
if (!isMaxSequenceDurationUsFinal) {
return INPUT_RESULT_TRY_AGAIN_LATER;
@ -419,14 +419,14 @@ import java.util.concurrent.atomic.AtomicInteger;
}
return INPUT_RESULT_TRY_AGAIN_LATER;
}
inStreamOffsetsUs = new ClippingIterator(inStreamOffsetsUs.copyOf(), lastOffsetUs);
timestampIterator = new ClippingIterator(timestampIterator.copyOf(), lastOffsetUs);
videoLoopingEnded = true;
break;
}
lastOffsetUs = offsetUs;
}
}
return sampleConsumer.queueInputBitmap(inputBitmap, inStreamOffsetsUs.copyOf());
return sampleConsumer.queueInputBitmap(inputBitmap, timestampIterator.copyOf());
}
@Override

View File

@ -81,8 +81,8 @@ import java.util.concurrent.atomic.AtomicLong;
@Override
public @InputResult int queueInputBitmap(
Bitmap inputBitmap, TimestampIterator inStreamOffsetsUs) {
return videoFrameProcessor.queueInputBitmap(inputBitmap, inStreamOffsetsUs)
Bitmap inputBitmap, TimestampIterator timestampIterator) {
return videoFrameProcessor.queueInputBitmap(inputBitmap, timestampIterator)
? INPUT_RESULT_SUCCESS
: INPUT_RESULT_TRY_AGAIN_LATER;
}