summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-03-17 15:52:34 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-17 15:52:34 -0700
commitce06ebfda4bd7c511cef3d98aacf7291a743ea46 (patch)
tree6d302b8230f6d9b97166fd1b6edc92878f6eb949 /graphics
parent6764ba4482129e70d33fe0a7ff2579654b5da87a (diff)
parentc5f94d8a4779050125145396ca83fbc862c7ed6b (diff)
downloadframeworks_base-ce06ebfda4bd7c511cef3d98aacf7291a743ea46.zip
frameworks_base-ce06ebfda4bd7c511cef3d98aacf7291a743ea46.tar.gz
frameworks_base-ce06ebfda4bd7c511cef3d98aacf7291a743ea46.tar.bz2
Merge "Add support for timestamps into SurfaceTexture."
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/SurfaceTexture.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index 970b207..b8327a8 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -144,6 +144,21 @@ public class SurfaceTexture {
nativeGetTransformMatrix(mtx);
}
+ /**
+ * Retrieve the timestamp associated with the texture image set by the most recent call to
+ * updateTexImage.
+ *
+ * This timestamp is in nanoseconds, and is guaranteed to be monotonically increasing. 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.
+ * @hide
+ */
+ public long getTimestamp() {
+ return nativeGetTimestamp();
+ }
+
protected void finalize() throws Throwable {
try {
nativeFinalize();
@@ -182,6 +197,7 @@ public class SurfaceTexture {
private native void nativeInit(int texName, Object weakSelf);
private native void nativeFinalize();
private native void nativeGetTransformMatrix(float[] mtx);
+ private native long nativeGetTimestamp();
private native void nativeUpdateTexImage();
/*