Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e309a0fd authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

NEW_API: Add getTimestamp() to SurfaceTexture.

Like getTransformMatrix, getTimestamp provides a timestamp for the
OpenGL texture produced by the latest call to updateTexImage().

Timestamps are measured in nanoseconds, and are monotonically
increasing.  Other properties of the timestamps (zero point,
comparability) depend on the source providing frames to the
SurfaceTexture, and need to be documented by the source.

bug:3300707

Change-Id: I380d94926d0e9f1c77bb5c1576b72d5ef4e2eba1
parent affb58e7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -86678,6 +86678,17 @@
<parameter name="texName" type="int">
</parameter>
</constructor>
<method name="getTimestamp"
 return="long"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getTransformMatrix"
 return="void"
 abstract="false"
+6 −0
Original line number Diff line number Diff line
@@ -374,6 +374,12 @@ public class Camera {
     * The preview surface texture may not otherwise change while preview is
     * running.
     *
     * The timestamps provided by {@link SurfaceTexture#getTimestamp()} for a
     * SurfaceTexture set as the preview texture have an unspecified zero point,
     * and cannot be directly compared between different cameras or different
     * instances of the same camera, or across multiple runs of the same
     * program.
     *
     * @param surfaceTexture the {@link SurfaceTexture} to which the preview
     *     images are to be sent or null to remove the current preview surface
     *     texture
+0 −1
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@ public class SurfaceTexture {
     * 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();