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

Unified Diff: chrome/gpu/arc_gpu_video_decode_accelerator.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/arc_gpu_video_decode_accelerator.h ('k') | chrome/gpu/arc_video_accelerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/arc_gpu_video_decode_accelerator.cc
diff --git a/chrome/gpu/arc_gpu_video_decode_accelerator.cc b/chrome/gpu/arc_gpu_video_decode_accelerator.cc
index aa22e34b2109c9fce9607a503665a0c4a128194b..32e7ad7f38be370e4145078460769e8ee1449f6f 100644
--- a/chrome/gpu/arc_gpu_video_decode_accelerator.cc
+++ b/chrome/gpu/arc_gpu_video_decode_accelerator.cc
@@ -198,7 +198,8 @@ void ArcGpuVideoDecodeAccelerator::BindSharedMemory(PortType port,
bool ArcGpuVideoDecodeAccelerator::VerifyDmabuf(
const base::ScopedFD& dmabuf_fd,
- const std::vector<DmabufPlane>& dmabuf_planes) const {
+ const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>& dmabuf_planes)
+ const {
size_t num_planes = media::VideoFrame::NumPlanes(output_pixel_format_);
if (dmabuf_planes.size() != num_planes) {
DLOG(ERROR) << "Invalid number of dmabuf planes passed: "
@@ -221,7 +222,7 @@ bool ArcGpuVideoDecodeAccelerator::VerifyDmabuf(
size_t rows =
media::VideoFrame::Rows(i, output_pixel_format_, coded_size_.height());
base::CheckedNumeric<off_t> current_size(plane.offset);
- current_size += plane.stride * rows;
+ current_size += base::CheckMul(plane.stride, rows);
if (!current_size.IsValid() || current_size.ValueOrDie() > size) {
DLOG(ERROR) << "Invalid strides/offsets";
@@ -238,7 +239,7 @@ void ArcGpuVideoDecodeAccelerator::BindDmabuf(
PortType port,
uint32_t index,
base::ScopedFD dmabuf_fd,
- const std::vector<DmabufPlane>& dmabuf_planes) {
+ const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>& dmabuf_planes) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!vda_) {
« no previous file with comments | « chrome/gpu/arc_gpu_video_decode_accelerator.h ('k') | chrome/gpu/arc_video_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698