Commit 75a745a1 by claincly Committed by Tofunmi Adigun-Hameed

Add missing empty lines

PiperOrigin-RevId: 539100987
(cherry picked from commit 4755e7313e5a31f5f9b6599ff290580026994b75)
parent 43f2ebfc
......@@ -40,19 +40,23 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* <p>Public methods in this class can be called from any thread.
*/
/* package */ final class BitmapTextureManager implements TextureManager {
private static final String UNSUPPORTED_IMAGE_CONFIGURATION =
"Unsupported Image Configuration: No more than 8 bits of precision should be used for each"
+ " RGB channel.";
private final GlShaderProgram shaderProgram;
private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor;
// The queue holds all bitmaps with one or more frames pending to be sent downstream.
private final Queue<BitmapFrameSequenceInfo> pendingBitmaps;
private @MonotonicNonNull GlTextureInfo currentGlTextureInfo;
private int downstreamShaderProgramCapacity;
private int framesToQueueForCurrentBitmap;
private double currentPresentationTimeUs;
private boolean useHdr;
private boolean currentInputStreamEnded;
/**
* Creates a new instance.
*
......@@ -138,6 +142,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
checkState(
!bitmap.getConfig().equals(Bitmap.Config.RGBA_1010102), UNSUPPORTED_IMAGE_CONFIGURATION);
}
this.useHdr = useHdr;
int framesToAdd = round(frameRate * (durationUs / (float) C.MICROS_PER_SECOND));
double frameDurationUs = C.MICROS_PER_SECOND / frameRate;
......@@ -150,6 +155,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
if (pendingBitmaps.isEmpty() || downstreamShaderProgramCapacity == 0) {
return;
}
BitmapFrameSequenceInfo currentBitmapInfo = checkNotNull(pendingBitmaps.peek());
if (framesToQueueForCurrentBitmap == 0) {
Bitmap bitmap = currentBitmapInfo.bitmap;
......@@ -171,6 +177,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} catch (GlUtil.GlException e) {
throw VideoFrameProcessingException.from(e);
}
currentGlTextureInfo =
new GlTextureInfo(
currentTexId,
......@@ -179,11 +186,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
currentBitmapInfo.frameInfo.width,
currentBitmapInfo.frameInfo.height);
}
framesToQueueForCurrentBitmap--;
downstreamShaderProgramCapacity--;
shaderProgram.queueInputFrame(
checkNotNull(currentGlTextureInfo), round(currentPresentationTimeUs));
currentPresentationTimeUs += currentBitmapInfo.frameDurationUs;
if (framesToQueueForCurrentBitmap == 0) {
pendingBitmaps.remove();
if (pendingBitmaps.isEmpty() && currentInputStreamEnded) {
......@@ -194,6 +203,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
}
}
/** Information to generate all the frames associated with a specific {@link Bitmap}. */
private static final class BitmapFrameSequenceInfo {
public final Bitmap bitmap;
......
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