Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: components/exo/wayland/server.cc

Issue 2543633005: exo: NV12 support for linux-buffer-params interface. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698