[vlc-commits] nativewindowpriv: cosmetics

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


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

nativewindowpriv: cosmetics

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

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

 modules/video_output/android/nativewindowpriv.c |   52 +++++++++++------------
 modules/video_output/android/utils.h            |    4 +-
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/modules/video_output/android/nativewindowpriv.c b/modules/video_output/android/nativewindowpriv.c
index 48c3e75..e5f8812 100644
--- a/modules/video_output/android/nativewindowpriv.c
+++ b/modules/video_output/android/nativewindowpriv.c
@@ -259,71 +259,71 @@ int ANativeWindowPriv_lock( native_window_priv *priv, void *p_handle )
     return 0;
 }
 
-int ANativeWindowPriv_lockData( native_window_priv *priv, void *p_handle,
-                                ANativeWindow_Buffer *p_out_anb )
+int ANativeWindowPriv_queue( native_window_priv *priv, void *p_handle )
 {
     ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
     status_t err = NO_ERROR;
-    void *p_data;
 
     CHECK_ANB();
 
-    err = priv->gralloc->lock( priv->gralloc, anb->handle, priv->usage,
-                               0, 0, anb->width, anb->height, &p_data );
+#if ANDROID_JBMR2_OR_LATER
+    err = priv->anw->queueBuffer_DEPRECATED( priv->anw, anb );
+#else
+    err = priv->anw->queueBuffer( priv->anw, anb );
+#endif
     CHECK_ERR();
-    if( p_out_anb ) {
-        p_out_anb->bits = p_data;
-        p_out_anb->width = anb->width;
-        p_out_anb->height = anb->height;
-        p_out_anb->stride = anb->stride;
-        p_out_anb->format = anb->format;
-    }
 
     return 0;
 }
 
-int ANativeWindowPriv_unlockData( native_window_priv *priv, void *p_handle )
+int ANativeWindowPriv_cancel( native_window_priv *priv, void *p_handle )
 {
     ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
     status_t err = NO_ERROR;
 
     CHECK_ANB();
 
-    err = priv->gralloc->unlock(priv->gralloc, anb->handle);
+#if ANDROID_JBMR2_OR_LATER
+    err = priv->anw->cancelBuffer_DEPRECATED( priv->anw, anb );
+#else
+    err = priv->anw->cancelBuffer( priv->anw, anb );
+#endif
     CHECK_ERR();
 
     return 0;
 }
 
-int ANativeWindowPriv_queue( native_window_priv *priv, void *p_handle )
+int ANativeWindowPriv_lockData( native_window_priv *priv, void *p_handle,
+                                ANativeWindow_Buffer *p_out_anb )
 {
     ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
     status_t err = NO_ERROR;
+    void *p_data;
 
     CHECK_ANB();
 
-#if ANDROID_JBMR2_OR_LATER
-    err = priv->anw->queueBuffer_DEPRECATED( priv->anw, anb );
-#else
-    err = priv->anw->queueBuffer( priv->anw, anb );
-#endif
+    err = priv->gralloc->lock( priv->gralloc, anb->handle, priv->usage,
+                               0, 0, anb->width, anb->height, &p_data );
     CHECK_ERR();
+    if( p_out_anb ) {
+        p_out_anb->bits = p_data;
+        p_out_anb->width = anb->width;
+        p_out_anb->height = anb->height;
+        p_out_anb->stride = anb->stride;
+        p_out_anb->format = anb->format;
+    }
 
     return 0;
 }
 
-int ANativeWindowPriv_cancel( native_window_priv *priv, void *p_handle )
+int ANativeWindowPriv_unlockData( native_window_priv *priv, void *p_handle )
 {
     ANativeWindowBuffer_t *anb = (ANativeWindowBuffer_t *)p_handle;
     status_t err = NO_ERROR;
 
     CHECK_ANB();
 
-#if ANDROID_JBMR2_OR_LATER
-    err = priv->anw->cancelBuffer_DEPRECATED( priv->anw, anb );
-#else
-    err = priv->anw->cancelBuffer( priv->anw, anb );
-#endif
+    err = priv->gralloc->unlock(priv->gralloc, anb->handle);
     CHECK_ERR();
 
     return 0;
diff --git a/modules/video_output/android/utils.h b/modules/video_output/android/utils.h
index 97b74bf..7ff1542 100644
--- a/modules/video_output/android/utils.h
+++ b/modules/video_output/android/utils.h
@@ -80,10 +80,10 @@ typedef int (*ptr_ANativeWindowPriv_setBufferCount) (native_window_priv *, unsig
 typedef int (*ptr_ANativeWindowPriv_setCrop) (native_window_priv *, int, int, int, int);
 typedef int (*ptr_ANativeWindowPriv_dequeue) (native_window_priv *, void **);
 typedef int (*ptr_ANativeWindowPriv_lock) (native_window_priv *, void *);
-typedef int (*ptr_ANativeWindowPriv_lockData) (native_window_priv *, void *, ANativeWindow_Buffer *);
-typedef int (*ptr_ANativeWindowPriv_unlockData) (native_window_priv *, void *);
 typedef int (*ptr_ANativeWindowPriv_queue) (native_window_priv *, void *);
 typedef int (*ptr_ANativeWindowPriv_cancel) (native_window_priv *, void *);
+typedef int (*ptr_ANativeWindowPriv_lockData) (native_window_priv *, void *, ANativeWindow_Buffer *);
+typedef int (*ptr_ANativeWindowPriv_unlockData) (native_window_priv *, void *);
 typedef int (*ptr_ANativeWindowPriv_setOrientation) (native_window_priv *, int);
 
 typedef struct



More information about the vlc-commits mailing list