Add tracing info for EOS signaling in the texture managers

PiperOrigin-RevId: 544063377
This commit is contained in:
claincly 2023-06-28 15:22:59 +00:00 committed by Tianyi Feng
parent d895a46b28
commit 98eb339333
3 changed files with 37 additions and 1 deletions

View file

@ -111,6 +111,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
() -> {
if (framesToQueueForCurrentBitmap == 0 && pendingBitmaps.isEmpty()) {
shaderProgram.signalEndOfCurrentInputStream();
DebugTraceUtil.recordBitmapTextureManagerSignalEndOfCurrentInputStream();
} else {
currentInputStreamEnded = true;
}
@ -201,6 +202,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// Only signal end of stream after all pending bitmaps are processed.
// TODO(b/269424561): Call signalEndOfCurrentInputStream on every bitmap
shaderProgram.signalEndOfCurrentInputStream();
DebugTraceUtil.recordBitmapTextureManagerSignalEndOfCurrentInputStream();
currentInputStreamEnded = false;
}
}

View file

@ -57,6 +57,22 @@ public final class DebugTraceUtil {
private static final Queue<Long> EXTERNAL_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS =
new ArrayDeque<>();
/**
* The timestamps at which {@code BitmapTextureManager} signalled end of current input stream, in
* milliseconds.
*/
@GuardedBy("DebugTraceUtil.class")
private static final Queue<Long> BITMAP_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS =
new ArrayDeque<>();
/**
* The timestamps at which {@code TexIdTextureManager} signalled end of current input stream, in
* milliseconds.
*/
@GuardedBy("DebugTraceUtil.class")
private static final Queue<Long> TEX_ID_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS =
new ArrayDeque<>();
/**
* The timestamps at which {@code VideoFrameProcessor} signalled end of stream, in milliseconds.
*/
@ -123,6 +139,8 @@ public final class DebugTraceUtil {
DECODER_SIGNAL_EOS_TIMES_MS.clear();
VIDEO_FRAME_PROCESSOR_RECEIVE_DECODER_EOS_TIMES_MS.clear();
EXTERNAL_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS.clear();
BITMAP_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS.clear();
TEX_ID_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS.clear();
VIDEO_FRAME_PROCESSOR_SIGNAL_EOS_TIMES_MS.clear();
ENCODER_RECEIVE_EOS_TIMES_MS.clear();
MUXER_CAN_WRITE_VIDEO_SAMPLE.clear();
@ -175,6 +193,14 @@ public final class DebugTraceUtil {
EXTERNAL_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS.add(SystemClock.DEFAULT.elapsedRealtime());
}
public static synchronized void recordBitmapTextureManagerSignalEndOfCurrentInputStream() {
BITMAP_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS.add(SystemClock.DEFAULT.elapsedRealtime());
}
public static synchronized void recordTexIdTextureManagerSignalEndOfCurrentInputStream() {
TEX_ID_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS.add(SystemClock.DEFAULT.elapsedRealtime());
}
public static synchronized void recordVideoFrameProcessorSignalEos() {
VIDEO_FRAME_PROCESSOR_SIGNAL_EOS_TIMES_MS.add(SystemClock.DEFAULT.elapsedRealtime());
}
@ -222,6 +248,10 @@ public final class DebugTraceUtil {
+ generateString(VIDEO_FRAME_PROCESSOR_RECEIVE_DECODER_EOS_TIMES_MS)
+ ", VFP ExtTexMgr signal EndOfCurrentInputStream: "
+ generateString(EXTERNAL_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS)
+ ", VFP BitmapTexMgr signal EndOfCurrentInputStream: "
+ generateString(BITMAP_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS)
+ ", VFP TexIdTexMhr signal EndOfCurrentInputStream: "
+ generateString(TEX_ID_TEXTURE_MANAGER_SIGNAL_EOCIS_TIMES_MS)
+ ", VFP signal EOS: "
+ generateString(VIDEO_FRAME_PROCESSOR_SIGNAL_EOS_TIMES_MS)
+ ", Encoder receive EOS: "

View file

@ -114,7 +114,11 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Override
public void signalEndOfCurrentInputStream() {
videoFrameProcessingTaskExecutor.submit(frameConsumptionManager::signalEndOfCurrentStream);
videoFrameProcessingTaskExecutor.submit(
() -> {
frameConsumptionManager.signalEndOfCurrentStream();
DebugTraceUtil.recordTexIdTextureManagerSignalEndOfCurrentInputStream();
});
}
@Override