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. * the input stream} to put multiple frames in the same input stream.
* *
* @param inputBitmap The {@link Bitmap} queued to the {@code VideoFrameProcessor}. * @param inputBitmap The {@link Bitmap} queued to the {@code VideoFrameProcessor}.
* @param inStreamOffsetsUs The times within the current stream that the bitmap should be shown * @param timestampIterator A {@link TimestampIterator} generating the exact timestamps that the
* at. The timestamps should be monotonically increasing. * bitmap should be shown at.
* @return Whether the {@link Bitmap} was successfully queued. A return value of {@code false} * @return Whether the {@link Bitmap} was successfully queued. A return value of {@code false}
* indicates the {@code VideoFrameProcessor} is not ready to accept input. * indicates the {@code VideoFrameProcessor} is not ready to accept input.
* @throws UnsupportedOperationException If the {@code VideoFrameProcessor} does not accept * @throws UnsupportedOperationException If the {@code VideoFrameProcessor} does not accept
* {@linkplain #INPUT_TYPE_BITMAP bitmap input}. * {@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}. * Provides an input texture ID to the {@code VideoFrameProcessor}.

View File

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

View File

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

View File

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

View File

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

View File

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