Commit 373ac4c7 by Googler Committed by microkatz

Change onOutputFrameAvailable timestamp from nanos to micros.

Upstream timestamps from the decoder are also in microseconds,
so using microseconds here is consistent with that.

PiperOrigin-RevId: 468659099
(cherry picked from commit 0b1c540f)
parent d7523d03
......@@ -81,11 +81,11 @@ public interface FrameProcessor {
void onOutputSizeChanged(int width, int height);
/**
* Called when an output frame with the given {@code presentationTimeNs} becomes available.
* Called when an output frame with the given {@code presentationTimeUs} becomes available.
*
* @param presentationTimeNs The presentation time of the frame, in nanoseconds.
* @param presentationTimeUs The presentation time of the frame, in microseconds.
*/
void onOutputFrameAvailable(long presentationTimeNs);
void onOutputFrameAvailable(long presentationTimeUs);
/**
* Called when an exception occurs during asynchronous frame processing.
......
......@@ -477,7 +477,7 @@ public final class GlEffectsFrameProcessorPixelTest {
}
@Override
public void onOutputFrameAvailable(long presentationTimeNs) {
public void onOutputFrameAvailable(long presentationTimeUs) {
// Do nothing as frames are released automatically.
}
......
......@@ -144,13 +144,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
public void queueInputFrame(TextureInfo inputTexture, long presentationTimeUs) {
long streamOffsetUs =
checkStateNotNull(streamOffsetUsQueue.peek(), "No input stream specified.");
long presentationTimeNs = (presentationTimeUs + streamOffsetUs) * 1000;
frameProcessorListener.onOutputFrameAvailable(presentationTimeNs);
long offsetPresentationTimeUs = presentationTimeUs + streamOffsetUs;
frameProcessorListener.onOutputFrameAvailable(offsetPresentationTimeUs);
if (releaseFramesAutomatically) {
renderFrameToSurfaces(
inputTexture,
presentationTimeUs,
/* releaseTimeNs= */ presentationTimeNs,
/* releaseTimeNs= */ offsetPresentationTimeUs * 1000,
/* dropLateFrame= */ false);
} else {
availableFrames.add(Pair.create(inputTexture, presentationTimeUs));
......
......@@ -126,7 +126,7 @@ import org.checkerframework.dataflow.qual.Pure;
}
@Override
public void onOutputFrameAvailable(long presentationTimeNs) {
public void onOutputFrameAvailable(long presentationTimeUs) {
// Do nothing as frames are released automatically.
}
......
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