diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-07-29 14:23:26 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-07-29 16:23:35 +0200 |
commit | 951480c85d8879943b9c97173bba61db09a237d8 (patch) | |
tree | 14360503e17142c342e6fd7ca6c4568a0e98534f | |
parent | 1bb74e71b87269734d6ac634e4cb4193a0e146c7 (diff) |
Add yv12/iv12/nv12 yuv visuals (wip)yuv
-rw-r--r-- | protocol/wayland.xml | 3 | ||||
-rw-r--r-- | wayland/wayland-server.c | 36 | ||||
-rw-r--r-- | wayland/wayland-server.h | 3 |
3 files changed, 42 insertions, 0 deletions
diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 92377c4..1df3535 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -119,6 +119,9 @@ <entry name="argb32" value="0"/> <entry name="premultiplied_argb32" value="1"/> <entry name="xrgb32" value="2"/> + <entry name="yv12" value="3"/> + <entry name="iv12" value="4"/> + <entry name="nv12" value="5"/> </enum> <event name="token_visual"> diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c index 2019cb4..d9079e8 100644 --- a/wayland/wayland-server.c +++ b/wayland/wayland-server.c @@ -891,6 +891,21 @@ compositor_bind(struct wl_client *client, WL_COMPOSITOR_TOKEN_VISUAL, &compositor->rgb_visual.object, WL_COMPOSITOR_VISUAL_XRGB32); + + wl_client_post_event(client, global, + WL_COMPOSITOR_TOKEN_VISUAL, + &compositor->yv12_visual.object, + WL_COMPOSITOR_VISUAL_YV12); + + wl_client_post_event(client, global, + WL_COMPOSITOR_TOKEN_VISUAL, + &compositor->iv12_visual.object, + WL_COMPOSITOR_VISUAL_IV12); + + wl_client_post_event(client, global, + WL_COMPOSITOR_TOKEN_VISUAL, + &compositor->nv12_visual.object, + WL_COMPOSITOR_VISUAL_NV12); } WL_EXPORT int @@ -929,5 +944,26 @@ wl_compositor_init(struct wl_compositor *compositor, &compositor->rgb_visual.object, NULL)) return -1; + compositor->yv12_visual.object.interface = &wl_visual_interface; + compositor->yv12_visual.object.implementation = NULL; + wl_display_add_object(display, &compositor->yv12_visual.object); + if (wl_display_add_global(display, + &compositor->yv12_visual.object, NULL)) + return -1; + + compositor->iv12_visual.object.interface = &wl_visual_interface; + compositor->iv12_visual.object.implementation = NULL; + wl_display_add_object(display, &compositor->iv12_visual.object); + if (wl_display_add_global(display, + &compositor->iv12_visual.object, NULL)) + return -1; + + compositor->nv12_visual.object.interface = &wl_visual_interface; + compositor->nv12_visual.object.implementation = NULL; + wl_display_add_object(display, &compositor->nv12_visual.object); + if (wl_display_add_global(display, + &compositor->nv12_visual.object, NULL)) + return -1; + return 0; } diff --git a/wayland/wayland-server.h b/wayland/wayland-server.h index 2aa6e78..1ed0c5c 100644 --- a/wayland/wayland-server.h +++ b/wayland/wayland-server.h @@ -123,6 +123,9 @@ struct wl_compositor { struct wl_visual argb_visual; struct wl_visual premultiplied_argb_visual; struct wl_visual rgb_visual; + struct wl_visual yv12_visual; + struct wl_visual iv12_visual; + struct wl_visual nv12_visual; }; struct wl_resource { |