diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2011-03-17 15:52:34 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-17 15:52:34 -0700 |
commit | ce06ebfda4bd7c511cef3d98aacf7291a743ea46 (patch) | |
tree | 6d302b8230f6d9b97166fd1b6edc92878f6eb949 /include/ui | |
parent | 6764ba4482129e70d33fe0a7ff2579654b5da87a (diff) | |
parent | c5f94d8a4779050125145396ca83fbc862c7ed6b (diff) | |
download | frameworks_base-ce06ebfda4bd7c511cef3d98aacf7291a743ea46.zip frameworks_base-ce06ebfda4bd7c511cef3d98aacf7291a743ea46.tar.gz frameworks_base-ce06ebfda4bd7c511cef3d98aacf7291a743ea46.tar.bz2 |
Merge "Add support for timestamps into SurfaceTexture."
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/egl/android_natives.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/include/ui/egl/android_natives.h b/include/ui/egl/android_natives.h index 0fc1ddf..0a6e4fb 100644 --- a/include/ui/egl/android_natives.h +++ b/include/ui/egl/android_natives.h @@ -57,7 +57,7 @@ typedef struct android_native_base_t { /* a magic value defined by the actual EGL native type */ int magic; - + /* the sizeof() of the actual EGL native type */ int version; @@ -129,6 +129,7 @@ enum { NATIVE_WINDOW_SET_BUFFER_COUNT, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, + NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, }; /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ @@ -157,7 +158,15 @@ enum { NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT, // SurfaceTextureClient }; -struct ANativeWindow +/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP + * + * Special timestamp value to indicate that timestamps should be auto-generated + * by the native window when queueBuffer is called. This is equal to INT64_MIN, + * defined directly to avoid problems with C99/C++ inclusion of stdint.h. + */ +const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1); + +struct ANativeWindow { #ifdef __cplusplus ANativeWindow() @@ -262,7 +271,8 @@ struct ANativeWindow * NATIVE_WINDOW_SET_BUFFER_COUNT * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM - * + * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP + * */ int (*perform)(struct ANativeWindow* window, @@ -389,6 +399,22 @@ static inline int native_window_set_buffers_transform( transform); } +/* + * native_window_set_buffers_timestamp(..., int64_t timestamp) + * All buffers queued after this call will be associated with the timestamp + * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO + * (the default), timestamps will be generated automatically when queueBuffer is + * called. The timestamp is measured in nanoseconds, and must be monotonically + * increasing. + */ +static inline int native_window_set_buffers_timestamp( + ANativeWindow* window, + int64_t timestamp) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, + timestamp); +} + // --------------------------------------------------------------------------- /* FIXME: this is legacy for pixmaps */ |