[vlc-devel] [PATCH 4/5] android_window: use anwp.getMaxBufferCount
Thomas Guillem
thomas at gllm.fr
Wed Nov 19 12:04:15 CET 2014
---
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)
--
2.1.1
More information about the vlc-devel
mailing list