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

Unified Diff: chrome/gpu/gpu_arc_video_service.cc

Issue 2513973002: Use mojo typemap to simplify the code using DmabufPlane (Closed)
Patch Set: Created 4 years, 1 month 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
Index: chrome/gpu/gpu_arc_video_service.cc
diff --git a/chrome/gpu/gpu_arc_video_service.cc b/chrome/gpu/gpu_arc_video_service.cc
index 6c83eec12c6c870b698ea8024d17a42abb22761b..cd6ddc9ebb04919ea02d421d95fe9cbe2217ec78 100644
--- a/chrome/gpu/gpu_arc_video_service.cc
+++ b/chrome/gpu/gpu_arc_video_service.cc
@@ -245,9 +245,9 @@ void GpuArcVideoService::DeprecatedBindDmabuf(::arc::mojom::PortType port,
uint32_t index,
mojo::ScopedHandle dmabuf_handle,
int32_t stride) {
- std::vector<::arc::mojom::ArcVideoAcceleratorDmabufPlanePtr> planes(1);
- planes[0]->offset = 0;
- planes[0]->stride = stride;
+ std::vector<::arc::ArcVideoAcceleratorDmabufPlane> planes(1);
Luis Héctor Chávez 2016/11/29 18:25:35 You can maybe directly initialize the plane with a
yoshiki 2016/11/30 17:25:44 Done.
+ planes[0].offset = 0;
+ planes[0].stride = stride;
BindDmabuf(port, index, std::move(dmabuf_handle), std::move(planes));
}
@@ -256,29 +256,26 @@ void GpuArcVideoService::BindDmabuf(
::arc::mojom::PortType port,
uint32_t index,
mojo::ScopedHandle dmabuf_handle,
- std::vector<::arc::mojom::ArcVideoAcceleratorDmabufPlanePtr>
- dmabuf_planes) {
+ std::vector<::arc::ArcVideoAcceleratorDmabufPlane> dmabuf_planes) {
DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index;
base::ScopedFD fd = UnwrapFdFromMojoHandle(std::move(dmabuf_handle));
if (!fd.is_valid())
return;
- std::vector<ArcVideoAccelerator::DmabufPlane> converted_planes;
// TODO(yusukes): Use mojo typemaps to simplify the code.
Luis Héctor Chávez 2016/11/29 18:25:35 you can now safely remove this, and the whole L267
yoshiki 2016/11/30 17:25:44 Done.
for (const auto& input : dmabuf_planes) {
- if (input->offset < 0 || input->stride < 0) {
- DVLOG(1) << "Invalid offset/stride: " << input->offset << "/"
- << input->stride;
+ if (input.offset < 0 || input.stride < 0) {
+ DVLOG(1) << "Invalid offset/stride: " << input.offset << "/"
+ << input.stride;
client_->OnError(
::arc::mojom::VideoAcceleratorService::Result::INVALID_ARGUMENT);
return;
}
- converted_planes.emplace_back(input->offset, input->stride);
}
accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd),
- std::move(converted_planes));
+ std::move(dmabuf_planes));
}
void GpuArcVideoService::UseBuffer(::arc::mojom::PortType port,

Powered by Google App Engine
This is Rietveld 408576698