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

Unified Diff: chrome/gpu/gpu_arc_video_service.cc

Issue 2513973002: Use mojo typemap to simplify the code using DmabufPlane (Closed)
Patch Set: Addressed comments 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 | « chrome/gpu/gpu_arc_video_service.h ('k') | components/arc/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14c3775fca8bc5f48b49431f2b31a1d111a616a7 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 {
+ {0, stride}
+ };
BindDmabuf(port, index, std::move(dmabuf_handle), std::move(planes));
}
@@ -256,29 +256,15 @@ 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.
- for (const auto& input : dmabuf_planes) {
- 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,
« no previous file with comments | « chrome/gpu/gpu_arc_video_service.h ('k') | components/arc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698