summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client/Surface.cpp
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-02-18 11:02:42 -0800
committerEino-Ville Talvala <etalvala@google.com>2011-03-17 13:10:03 -0700
commitc5f94d8a4779050125145396ca83fbc862c7ed6b (patch)
tree83d016c9670032683faa39fda755b236a9010954 /libs/surfaceflinger_client/Surface.cpp
parent262564df9613e8950fb3828ecc6dfffe79cc1b31 (diff)
downloadframeworks_base-c5f94d8a4779050125145396ca83fbc862c7ed6b.zip
frameworks_base-c5f94d8a4779050125145396ca83fbc862c7ed6b.tar.gz
frameworks_base-c5f94d8a4779050125145396ca83fbc862c7ed6b.tar.bz2
Add support for timestamps into SurfaceTexture.
API addition: The timestamps are represented as nanoseconds from some arbitrary time point. Like the SurfaceTexture transform matrix, the timestamp retrieved by getTimestamp is for the last frame sent to the GL texture using updateTexImage(). Camera HAL change: Expect vendors to set these timestamps using native_window_set_buffers_timestamp(). For now, they are autogenerated by SurfaceTextureClient if set_buffers_timestamp() is never called, but such timing is likely not accurate enough to pass a CTS test. bug:3300707 Change-Id: Ife131a0c2a826ac27342e11b8a6c42ff49e1bea7
Diffstat (limited to 'libs/surfaceflinger_client/Surface.cpp')
-rw-r--r--libs/surfaceflinger_client/Surface.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp
index 21d509a..0dfbf01 100644
--- a/libs/surfaceflinger_client/Surface.cpp
+++ b/libs/surfaceflinger_client/Surface.cpp
@@ -753,6 +753,9 @@ int Surface::perform(int operation, va_list args)
case NATIVE_WINDOW_SET_BUFFERS_TRANSFORM:
res = dispatch_set_buffers_transform( args );
break;
+ case NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP:
+ res = dispatch_set_buffers_timestamp( args );
+ break;
default:
res = NAME_NOT_FOUND;
break;
@@ -792,6 +795,11 @@ int Surface::dispatch_set_buffers_transform(va_list args) {
return setBuffersTransform(transform);
}
+int Surface::dispatch_set_buffers_timestamp(va_list args) {
+ int64_t timestamp = va_arg(args, int64_t);
+ return setBuffersTimestamp(timestamp);
+}
+
void Surface::setUsage(uint32_t reqUsage)
{
Mutex::Autolock _l(mSurfaceLock);
@@ -910,6 +918,13 @@ int Surface::setBuffersTransform(int transform)
return NO_ERROR;
}
+int Surface::setBuffersTimestamp(int64_t timestamp)
+{
+ // Surface doesn't really have anything meaningful to do with timestamps
+ // so they'll just be dropped here.
+ return NO_ERROR;
+}
+
// ----------------------------------------------------------------------------
int Surface::getConnectedApi() const