Index: components/exo/wayland/server.cc |
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc |
index 37f9e20f328167268f5d245303a8c963164326ac..e7fa4f4b7042e891de400baaed38bd9cc13f281d 100644 |
--- a/components/exo/wayland/server.cc |
+++ b/components/exo/wayland/server.cc |
@@ -595,6 +595,7 @@ const struct dmabuf_supported_format { |
{DRM_FORMAT_ABGR8888, gfx::BufferFormat::RGBA_8888}, |
{DRM_FORMAT_XRGB8888, gfx::BufferFormat::BGRX_8888}, |
{DRM_FORMAT_ARGB8888, gfx::BufferFormat::BGRA_8888}, |
+ {DRM_FORMAT_NV12, gfx::BufferFormat::YUV_420_BIPLANAR}, |
{DRM_FORMAT_YVU420, gfx::BufferFormat::YVU_420}}; |
struct LinuxBufferParams { |
@@ -695,8 +696,16 @@ void linux_buffer_params_create(wl_client* client, |
} |
LinuxBufferParams::Plane& plane = plane_it->second; |
planes.emplace_back(plane.stride, plane.offset, 0, 0); |
- if (plane.fd.is_valid()) |
+ // TODO(dcastagna): Support multiple fds. |
+ if (!i) { |
reveman
2016/11/30 22:59:49
can we post an error or have buffer creation fail
Daniele Castagna
2016/11/30 23:31:02
Done.
|
+ if (!plane.fd.is_valid()) { |
+ wl_resource_post_error(resource, |
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE, |
+ "file descriptor not valid"); |
+ return; |
+ } |
fds.push_back(std::move(plane.fd)); |
+ } |
} |
std::unique_ptr<Buffer> buffer = |