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