[vlc-commits] android/utils: add ChromaToAndroidHal

Thomas Guillem git at videolan.org
Sat Nov 15 12:27:22 CET 2014


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 14 17:09:58 2014 +0100| [646639aa2a0decfc4cd455a42a55ef0cf6a06ea8] | committer: Jean-Baptiste Kempf

android/utils: add ChromaToAndroidHal

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

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

 modules/video_output/android/utils.h |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/modules/video_output/android/utils.h b/modules/video_output/android/utils.h
index 6145651..5db540e 100644
--- a/modules/video_output/android/utils.h
+++ b/modules/video_output/android/utils.h
@@ -51,6 +51,25 @@ typedef struct
 void *LoadNativeWindowAPI(native_window_api_t *native);
 void Manage(vout_display_t *);
 
+#define PRIV_WINDOW_FORMAT_YV12 0x32315659
+
+static inline int ChromaToAndroidHal(vlc_fourcc_t i_chroma)
+{
+    switch (i_chroma) {
+        case VLC_CODEC_YV12:
+        case VLC_CODEC_I420:
+            return PRIV_WINDOW_FORMAT_YV12;
+        case VLC_CODEC_RGB16:
+            return WINDOW_FORMAT_RGB_565;
+        case VLC_CODEC_RGB32:
+            return WINDOW_FORMAT_RGBX_8888;
+        case VLC_CODEC_RGBA:
+            return WINDOW_FORMAT_RGBA_8888;
+        default:
+            return -1;
+    }
+}
+
 typedef struct native_window_priv native_window_priv;
 typedef native_window_priv *(*ptr_ANativeWindowPriv_connect) (void *);
 typedef int (*ptr_ANativeWindowPriv_disconnect) (native_window_priv *);



More information about the vlc-commits mailing list