[vlc-commits] nativewindowpriv: GRALLOC_USAGE_EXTERNAL_DISP only for hw

Thomas Guillem git at videolan.org
Fri Nov 21 11:13:07 CET 2014


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 21 10:48:52 2014 +0100| [00c28704d4179742604f1dd31f970fe823d47820] | committer: Jean-Baptiste Kempf

nativewindowpriv: GRALLOC_USAGE_EXTERNAL_DISP only for hw

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=00c28704d4179742604f1dd31f970fe823d47820
---

 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();



More information about the vlc-commits mailing list