[vlc-devel] [PATCH 8/8] nativewindowpriv: GRALLOC_USAGE_EXTERNAL_DISP only for hw

Thomas Guillem thomas at gllm.fr
Thu Nov 20 13:16:44 CET 2014


---
 modules/video_output/android/nativewindowpriv.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/android/nativewindowpriv.c b/modules/video_output/android/nativewindowpriv.c
index 4b15d86..7564216 100644
--- a/modules/video_output/android/nativewindowpriv.c
+++ b/modules/video_output/android/nativewindowpriv.c
@@ -151,13 +151,15 @@ int ANativeWindowPriv_setup( native_window_priv *priv, int w, int h, int hal_for
     LOGD( "setup: %p, %d, %d, %X, %X\n",
           priv->anw, w, h, hal_format, hw_usage );
 
-    if (is_hw)
+    if( is_hw )
+    {
         priv->usage = hw_usage | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
-    else
-        priv->usage= GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN;
 #if ANDROID_HC_OR_LATER
-    priv->usage |= GRALLOC_USAGE_EXTERNAL_DISP;
+        priv->usage |= GRALLOC_USAGE_EXTERNAL_DISP;
 #endif
+    }
+    else
+        priv->usage = GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN;
 
     err = native_window_set_usage( priv->anw, priv->usage );
     CHECK_ERR();
-- 
2.1.1




More information about the vlc-devel mailing list