Add javadoc to clarify using bitmap

PiperOrigin-RevId: 730441676
This commit is contained in:
claincly 2025-02-24 07:23:36 -08:00 committed by Copybara-Service
parent 5610cc8465
commit 2f5a72a165
2 changed files with 9 additions and 0 deletions

View File

@ -207,6 +207,9 @@ public interface VideoFrameProcessor {
* <p>Can be called many times after {@link #registerInputStream registering the input stream} to * <p>Can be called many times after {@link #registerInputStream registering the input stream} to
* put multiple frames in the same input stream. * put multiple frames in the same input stream.
* *
* <p>An implementation could {@link Bitmap#recycle} the passed in {@link Bitmap}, so it may not
* be suitable for reuse.
*
* @param inputBitmap The {@link Bitmap} queued to the {@code VideoFrameProcessor}. * @param inputBitmap The {@link Bitmap} queued to the {@code VideoFrameProcessor}.
* @param timestampIterator A {@link TimestampIterator} generating the exact timestamps that the * @param timestampIterator A {@link TimestampIterator} generating the exact timestamps that the
* bitmap should be shown at. * bitmap should be shown at.

View File

@ -566,6 +566,12 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
inputSwitcher.setInputDefaultBufferSize(width, height); inputSwitcher.setInputDefaultBufferSize(width, height);
} }
/**
* {@inheritDoc}
*
* <p>The passed in {@link Bitmap} argument cannot be reused after this method returns {@code
* true}, as it will be {@linkplain Bitmap#recycle recycled} by the processing pipeline.
*/
@Override @Override
public boolean queueInputBitmap(Bitmap inputBitmap, TimestampIterator timestampIterator) { public boolean queueInputBitmap(Bitmap inputBitmap, TimestampIterator timestampIterator) {
checkState(!inputStreamEnded); checkState(!inputStreamEnded);