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

android_window: use anwp.getMaxBufferCount

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 7423c2bd
...@@ -43,9 +43,6 @@ ...@@ -43,9 +43,6 @@
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define PRIV_WINDOW_MAX_BUFFER_COUNT 32
#define PRIV_WINDOW_MIN_BUFFER_COUNT 2
#define USE_ANWP #define USE_ANWP
#define CHROMA_TEXT N_("Chroma used") #define CHROMA_TEXT N_("Chroma used")
#define CHROMA_LONGTEXT N_(\ #define CHROMA_LONGTEXT N_(\
...@@ -340,6 +337,8 @@ static int AndroidWindow_SetSurface(vout_display_sys_t *sys, ...@@ -340,6 +337,8 @@ static int AndroidWindow_SetSurface(vout_display_sys_t *sys,
static int AndroidWindow_SetupANWP(vout_display_sys_t *sys, static int AndroidWindow_SetupANWP(vout_display_sys_t *sys,
android_window *p_window) android_window *p_window)
{ {
unsigned int i_max_buffer_count = 0;
if (!p_window->p_handle_priv) if (!p_window->p_handle_priv)
p_window->p_handle_priv = sys->anwp.connect(p_window->p_handle); 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, ...@@ -355,10 +354,11 @@ static int AndroidWindow_SetupANWP(vout_display_sys_t *sys,
sys->anwp.getMinUndequeued(p_window->p_handle_priv, sys->anwp.getMinUndequeued(p_window->p_handle_priv,
&p_window->i_min_undequeued); &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) > if ((p_window->i_min_undequeued + p_window->i_pic_count) >
PRIV_WINDOW_MAX_BUFFER_COUNT) i_max_buffer_count)
p_window->i_pic_count = PRIV_WINDOW_MAX_BUFFER_COUNT p_window->i_pic_count = i_max_buffer_count - p_window->i_min_undequeued;
- p_window->i_min_undequeued;
if (sys->anwp.setBufferCount(p_window->p_handle_priv, if (sys->anwp.setBufferCount(p_window->p_handle_priv,
AndroidWindow_GetPicCount(sys, p_window)) != 0) AndroidWindow_GetPicCount(sys, p_window)) != 0)
......
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