Commit 4e7f9c57 by Googler Committed by Marc Baechinger

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
parent 53218b50
...@@ -477,7 +477,7 @@ public final class GlEffectsFrameProcessorPixelTest { ...@@ -477,7 +477,7 @@ public final class GlEffectsFrameProcessorPixelTest {
} }
@Override @Override
public void onOutputFrameAvailable(long presentationTimeNs) { public void onOutputFrameAvailable(long presentationTimeUs) {
// Do nothing as frames are released automatically. // Do nothing as frames are released automatically.
} }
......
...@@ -144,13 +144,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -144,13 +144,13 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
public void queueInputFrame(TextureInfo inputTexture, long presentationTimeUs) { public void queueInputFrame(TextureInfo inputTexture, long presentationTimeUs) {
long streamOffsetUs = long streamOffsetUs =
checkStateNotNull(streamOffsetUsQueue.peek(), "No input stream specified."); checkStateNotNull(streamOffsetUsQueue.peek(), "No input stream specified.");
long presentationTimeNs = (presentationTimeUs + streamOffsetUs) * 1000; long offsetPresentationTimeUs = presentationTimeUs + streamOffsetUs;
frameProcessorListener.onOutputFrameAvailable(presentationTimeNs); frameProcessorListener.onOutputFrameAvailable(offsetPresentationTimeUs);
if (releaseFramesAutomatically) { if (releaseFramesAutomatically) {
renderFrameToSurfaces( renderFrameToSurfaces(
inputTexture, inputTexture,
presentationTimeUs, presentationTimeUs,
/* releaseTimeNs= */ presentationTimeNs, /* releaseTimeNs= */ offsetPresentationTimeUs * 1000,
/* dropLateFrame= */ false); /* dropLateFrame= */ false);
} else { } else {
availableFrames.add(Pair.create(inputTexture, presentationTimeUs)); availableFrames.add(Pair.create(inputTexture, presentationTimeUs));
......
...@@ -79,11 +79,11 @@ public interface FrameProcessor { ...@@ -79,11 +79,11 @@ public interface FrameProcessor {
void onOutputSizeChanged(int width, int height); 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. * Called when an exception occurs during asynchronous frame processing.
......
...@@ -126,7 +126,7 @@ import org.checkerframework.dataflow.qual.Pure; ...@@ -126,7 +126,7 @@ import org.checkerframework.dataflow.qual.Pure;
} }
@Override @Override
public void onOutputFrameAvailable(long presentationTimeNs) { public void onOutputFrameAvailable(long presentationTimeUs) {
// Do nothing as frames are released automatically. // 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