summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-04-18 18:38:52 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-05-18 17:20:47 +0200
commit97d4d165175b592c21153fbacd7457a469c991d2 (patch)
tree85fcb67abe6079f0a3dcab2cf95bb56d8a82bde7
parent94bb47020ae71336be5088824fee38bf3c8d51cc (diff)
buffer: add generic buffer formats.
Add packed RGB (ARGB32, XRGB32), and planar YUV formats with interleaved U/V components (NV12), or three Y U V planes with various subsampling (YUV 4:1:0, 4:1:1, 4:2:0, 4:2:2, 4:4:4). Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--protocol/wayland.xml24
-rw-r--r--src/wayland-server.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index f14d1d2..8627d3d 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -218,6 +218,30 @@
updates the contents is defined by the buffer factory interface
</description>
+ <enum name="format">
+ <description summary="buffer formats">
+ Buffer formats.
+ </description>
+ <entry name="none" value="0"
+ summary="Buffer does not represent a pixel buffer. So, format is irrelevant"/>
+ <entry name="argb8888" value="0x34325241"
+ summary="Packed RGB 8:8:8, 32 bpp, A R G B, native endian byte-order"/>
+ <entry name="xrgb8888" value="0x34325258"
+ summary="Packed RGB 8:8:8, 32 bpp, 0 R G B, native endian byte-order"/>
+ <entry name="nv12" value="0x3231564e"
+ summary="Planar YUV 4:2:0, 12 bpp, 1 plane for Y and 1 plane for UV"/>
+ <entry name="yuv410" value="0x39565559"
+ summary="Planar YUV 4:1:0, 10 bpp, quarter horizontal chroma resolution, half vertical chroma resolution"/>
+ <entry name="yuv411" value="0x31315559"
+ summary="Planar YUV 4:1:1, 12 bpp, quarter horizontal chroma resolution, full vertical chroma resolution"/>
+ <entry name="yuv420" value="0x32315559"
+ summary="Planar YUV 4:2:0, 12-bit, half horizontal chroma resolution, half vertical chroma resolution"/>
+ <entry name="yuv422" value="0x36315559"
+ summary="Planar YUV 4:2:2, 16-bit, half horizontal chroma resolution, full vertical chroma resolution"/>
+ <entry name="yuv444" value="0x34325559"
+ summary="Planar YUV 4:4:4, 24-bit, full horizontal chroma resolution, full vertical chroma resolution"/>
+ </enum>
+
<request name="destroy" type="destructor">
<description summary="destroy a buffer">
Destroy a buffer. This will invalidate the object id.
diff --git a/src/wayland-server.h b/src/wayland-server.h
index 31f6fe5..24aedc7 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -177,6 +177,7 @@ struct wl_resource {
struct wl_buffer {
struct wl_resource resource;
+ uint32_t format;
int32_t width, height;
uint32_t busy_count;
};