summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-07-26 14:08:21 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-01-20 13:40:21 -0800
commit7c50e9bad4173cddff6dfc49ee0d4e10053867b4 (patch)
tree5c9ce6a33292ab66d09d9e40ad0b94c021f340b6
parent080a80212b6ec954fe8a424d9fb286c5cf1d5021 (diff)
downloadhardware_libhardware-7c50e9bad4173cddff6dfc49ee0d4e10053867b4.zip
hardware_libhardware-7c50e9bad4173cddff6dfc49ee0d4e10053867b4.tar.gz
hardware_libhardware-7c50e9bad4173cddff6dfc49ee0d4e10053867b4.tar.bz2
Add timestamp control to camera preview stream operations.
At higher levels, SurfaceTextures include timestamp information in their buffers. For accurate timestamps, they need to be set by the driver code. This change adds the needed method into preview_stream_ops. Timestamp behavior is documented in SurfaceTexture.java, and system/core/include/window.h, as well as here. Bug-Id: 5081132 Change-Id: Id285f8e26edecf605444bc4b9e6eea9b224f9d31
-rw-r--r--include/hardware/camera.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hardware/camera.h b/include/hardware/camera.h
index 4d25023..4058c30 100644
--- a/include/hardware/camera.h
+++ b/include/hardware/camera.h
@@ -109,6 +109,11 @@ typedef struct preview_stream_ops {
int *count);
int (*lock_buffer)(struct preview_stream_ops* w,
buffer_handle_t* buffer);
+ // Timestamps are measured in nanoseconds, and must be comparable
+ // and monotonically increasing between two frames in the same
+ // preview stream. They do not need to be comparable between
+ // consecutive or parallel preview streams, cameras, or app runs.
+ int (*set_timestamp)(struct preview_stream_ops *w, int64_t timestamp);
} preview_stream_ops_t;
struct camera_device;