[vlc-commits] android_window: use anwp.getMaxBufferCount
Thomas Guillem
git at videolan.org
Wed Nov 19 14:01:21 CET 2014
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Nov 19 12:04:15 2014 +0100| [b2bf1acb74d4e11123f4b39eec24c31317ca01d4] | committer: Jean-Baptiste Kempf
android_window: use anwp.getMaxBufferCount
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b2bf1acb74d4e11123f4b39eec24c31317ca01d4
---
modules/video_output/android/android_window.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/video_output/android/android_window.c b/modules/video_output/android/android_window.c
index 4a667d4..d2ac522 100644
--- a/modules/video_output/android/android_window.c
+++ b/modules/video_output/android/android_window.c
@@ -43,9 +43,6 @@
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-#define PRIV_WINDOW_MAX_BUFFER_COUNT 32
-#define PRIV_WINDOW_MIN_BUFFER_COUNT 2
-
#define USE_ANWP
#define CHROMA_TEXT N_("Chroma used")
#define CHROMA_LONGTEXT N_(\
@@ -340,6 +337,8 @@ static int AndroidWindow_SetSurface(vout_display_sys_t *sys,
static int AndroidWindow_SetupANWP(vout_display_sys_t *sys,
android_window *p_window)
{
+ unsigned int i_max_buffer_count = 0;
+
if (!p_window->p_handle_priv)
p_window->p_handle_priv = sys->anwp.connect(p_window->p_handle);
@@ -355,10 +354,11 @@ static int AndroidWindow_SetupANWP(vout_display_sys_t *sys,
sys->anwp.getMinUndequeued(p_window->p_handle_priv,
&p_window->i_min_undequeued);
+ sys->anwp.getMaxBufferCount(p_window->p_handle_priv, &i_max_buffer_count);
+
if ((p_window->i_min_undequeued + p_window->i_pic_count) >
- PRIV_WINDOW_MAX_BUFFER_COUNT)
- p_window->i_pic_count = PRIV_WINDOW_MAX_BUFFER_COUNT
- - p_window->i_min_undequeued;
+ i_max_buffer_count)
+ p_window->i_pic_count = i_max_buffer_count - p_window->i_min_undequeued;
if (sys->anwp.setBufferCount(p_window->p_handle_priv,
AndroidWindow_GetPicCount(sys, p_window)) != 0)
More information about the vlc-commits
mailing list