]> git.sesse.net Git - vlc/commitdiff
nativewindowpriv: add getMaxBufferCount
authorThomas Guillem <thomas@gllm.fr>
Wed, 19 Nov 2014 11:04:12 +0000 (12:04 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 19 Nov 2014 13:00:27 +0000 (14:00 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/android/nativewindowpriv.c
modules/video_output/android/utils.c
modules/video_output/android/utils.h

index 989236a594e277d4c542539c5f9e185a59d242fe..a55c03ede0a2c8d6c341cac8063e96f54be0b951 100644 (file)
@@ -184,6 +184,16 @@ int ANativeWindowPriv_getMinUndequeued( native_window_priv *priv, unsigned int *
     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;
index fdf3952d4b420b83e6902999276da03874c02200..37f9e4f091b6d74096d433968064f412440ef0e5 100644 (file)
@@ -59,6 +59,7 @@ int LoadNativeWindowPrivAPI(native_window_priv_api_t *native)
     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");
@@ -70,7 +71,8 @@ int LoadNativeWindowPrivAPI(native_window_priv_api_t *native)
     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;
 }
index 5db540e0221e21ac4ef1ca0cb766342feddaa7af..97b74bf54532f3d52f2433cd335be75079d8011b 100644 (file)
@@ -75,6 +75,7 @@ typedef native_window_priv *(*ptr_ANativeWindowPriv_connect) (void *);
 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 **);
@@ -91,6 +92,7 @@ typedef struct
     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;