[vlc-devel] [PATCH 07/19] android/utils: add ChromaToAndroidHal

Thomas Guillem thomas at gllm.fr
Fri Nov 14 17:09:58 CET 2014


---
 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 *);
-- 
2.1.1




More information about the vlc-devel mailing list