From b5afc250bcd22b6966ec66c28e1aa0a5f4e4e32f Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 23 Mar 2018 09:43:42 -0700 Subject: Docs: add more detail to SurfaceTexture#getTimestamp Copies language from that connects EGL/Vulkan presentation timestamps to SurfaceTexture#getTimestamp. In the process, reorganized the existing language to talk about general properties of the timestamp, and then talk about behavior of specific producers instead of mixing them together. Bug: 72755997 Test: make docs Change-Id: I88253f9e23df7d7c4fe3c1c51ff2ac494da1913c (cherry picked from commit 63d2a0e00005e9b5bb6e62d752a23ef2e43b03d4) --- graphics/java/android/graphics/SurfaceTexture.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index 97edf220e242..1eebd2647753 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -318,13 +318,17 @@ public class SurfaceTexture { * Retrieve the timestamp associated with the texture image set by the most recent call to * updateTexImage. * - * This timestamp is in nanoseconds, and is normally monotonically increasing. The timestamp - * should be unaffected by time-of-day adjustments, and for a camera should be strictly - * monotonic but for a MediaPlayer may be reset when the position is set. The - * specific meaning and zero point of the timestamp depends on the source providing images to - * the SurfaceTexture. Unless otherwise specified by the image source, timestamps cannot - * generally be compared across SurfaceTexture instances, or across multiple program - * invocations. It is mostly useful for determining time offsets between subsequent frames. + *

This timestamp is in nanoseconds, and is normally monotonically increasing. The timestamp + * should be unaffected by time-of-day adjustments. The specific meaning and zero point of the + * timestamp depends on the source providing images to the SurfaceTexture. Unless otherwise + * specified by the image source, timestamps cannot generally be compared across SurfaceTexture + * instances, or across multiple program invocations. It is mostly useful for determining time + * offsets between subsequent frames.

+ * + *

For camera sources, timestamps should be strictly monotonic. Timestamps from MediaPlayer + * sources may be reset when the playback position is set. For EGL and Vulkan producers, the + * timestamp is the desired present time set with the EGL_ANDROID_presentation_time or + * VK_GOOGLE_display_timing extensions.

*/ public long getTimestamp() { -- cgit v1.2.3-59-g8ed1b