return 0;
}
+int ANativeWindowPriv_getMaxBufferCount( native_window_priv *priv, unsigned int *max_buffer_count )
+{
+#if ANDROID_API >= 14
+ *max_buffer_count = 32;
+#else
+ *max_buffer_count = 15;
+#endif
+ return 0;
+}
+
int ANativeWindowPriv_setBufferCount(native_window_priv *priv, unsigned int count )
{
status_t err;
native->disconnect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_disconnect");
native->setup = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setup");
native->getMinUndequeued = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMinUndequeued");
+ native->getMaxBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMaxBufferCount");
native->setBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setBufferCount");
native->setCrop = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setCrop");
native->dequeue = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_dequeue");
native->setOrientation = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setOrientation");
return native->connect && native->disconnect && native->setup &&
- native->getMinUndequeued && native->setBufferCount && native->setCrop &&
+ native->getMinUndequeued && native->getMaxBufferCount &&
+ native->setBufferCount && native->setCrop &&
native->dequeue && native->lock && native->lockData && native->unlockData &&
native->queue && native->cancel && native->setOrientation ? 0 : -1;
}
typedef int (*ptr_ANativeWindowPriv_disconnect) (native_window_priv *);
typedef int (*ptr_ANativeWindowPriv_setup) (native_window_priv *, int, int, int, bool, int );
typedef int (*ptr_ANativeWindowPriv_getMinUndequeued) (native_window_priv *, unsigned int *);
+typedef int (*ptr_ANativeWindowPriv_getMaxBufferCount) (native_window_priv *, unsigned int *);
typedef int (*ptr_ANativeWindowPriv_setBufferCount) (native_window_priv *, unsigned int );
typedef int (*ptr_ANativeWindowPriv_setCrop) (native_window_priv *, int, int, int, int);
typedef int (*ptr_ANativeWindowPriv_dequeue) (native_window_priv *, void **);
ptr_ANativeWindowPriv_disconnect disconnect;
ptr_ANativeWindowPriv_setup setup;
ptr_ANativeWindowPriv_getMinUndequeued getMinUndequeued;
+ ptr_ANativeWindowPriv_getMaxBufferCount getMaxBufferCount;
ptr_ANativeWindowPriv_setBufferCount setBufferCount;
ptr_ANativeWindowPriv_setCrop setCrop;
ptr_ANativeWindowPriv_dequeue dequeue;