Commit 4bb9b344 authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

nativewindowpriv: add getMaxBufferCount

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 80bd0c5d
...@@ -184,6 +184,16 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int * ...@@ -184,6 +184,16 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int *
return 0; 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 ) int ANativeWindowPriv_setBufferCount(native_window_priv *priv, unsigned int count )
{ {
status_t err; status_t err;
......
...@@ -59,6 +59,7 @@ int LoadNativeWindowPrivAPI(native_window_priv_api_t *native) ...@@ -59,6 +59,7 @@ int LoadNativeWindowPrivAPI(native_window_priv_api_t *native)
native->disconnect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_disconnect"); native->disconnect = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_disconnect");
native->setup = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setup"); native->setup = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setup");
native->getMinUndequeued = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMinUndequeued"); native->getMinUndequeued = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMinUndequeued");
native->getMaxBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_getMaxBufferCount");
native->setBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setBufferCount"); native->setBufferCount = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setBufferCount");
native->setCrop = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setCrop"); native->setCrop = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setCrop");
native->dequeue = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_dequeue"); native->dequeue = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_dequeue");
...@@ -70,7 +71,8 @@ int LoadNativeWindowPrivAPI(native_window_priv_api_t *native) ...@@ -70,7 +71,8 @@ int LoadNativeWindowPrivAPI(native_window_priv_api_t *native)
native->setOrientation = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setOrientation"); native->setOrientation = dlsym(RTLD_DEFAULT, "ANativeWindowPriv_setOrientation");
return native->connect && native->disconnect && native->setup && 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->dequeue && native->lock && native->lockData && native->unlockData &&
native->queue && native->cancel && native->setOrientation ? 0 : -1; native->queue && native->cancel && native->setOrientation ? 0 : -1;
} }
......
...@@ -75,6 +75,7 @@ typedef native_window_priv *(*ptr_ANativeWindowPriv_connect) (void *); ...@@ -75,6 +75,7 @@ typedef native_window_priv *(*ptr_ANativeWindowPriv_connect) (void *);
typedef int (*ptr_ANativeWindowPriv_disconnect) (native_window_priv *); 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_setup) (native_window_priv *, int, int, int, bool, int );
typedef int (*ptr_ANativeWindowPriv_getMinUndequeued) (native_window_priv *, unsigned 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_setBufferCount) (native_window_priv *, unsigned int );
typedef int (*ptr_ANativeWindowPriv_setCrop) (native_window_priv *, int, int, int, int); typedef int (*ptr_ANativeWindowPriv_setCrop) (native_window_priv *, int, int, int, int);
typedef int (*ptr_ANativeWindowPriv_dequeue) (native_window_priv *, void **); typedef int (*ptr_ANativeWindowPriv_dequeue) (native_window_priv *, void **);
...@@ -91,6 +92,7 @@ typedef struct ...@@ -91,6 +92,7 @@ typedef struct
ptr_ANativeWindowPriv_disconnect disconnect; ptr_ANativeWindowPriv_disconnect disconnect;
ptr_ANativeWindowPriv_setup setup; ptr_ANativeWindowPriv_setup setup;
ptr_ANativeWindowPriv_getMinUndequeued getMinUndequeued; ptr_ANativeWindowPriv_getMinUndequeued getMinUndequeued;
ptr_ANativeWindowPriv_getMaxBufferCount getMaxBufferCount;
ptr_ANativeWindowPriv_setBufferCount setBufferCount; ptr_ANativeWindowPriv_setBufferCount setBufferCount;
ptr_ANativeWindowPriv_setCrop setCrop; ptr_ANativeWindowPriv_setCrop setCrop;
ptr_ANativeWindowPriv_dequeue dequeue; ptr_ANativeWindowPriv_dequeue dequeue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment