| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/gpu/arc_gpu_video_decode_accelerator.h" | 5 #include "chrome/gpu/arc_gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/numerics/safe_math.h" | 9 #include "base/numerics/safe_math.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 case PORT_OUTPUT: { | 292 case PORT_OUTPUT: { |
| 293 // is_valid() is true for the first time the buffer is passed to the VDA. | 293 // is_valid() is true for the first time the buffer is passed to the VDA. |
| 294 // In that case, VDA needs to import the buffer first. | 294 // In that case, VDA needs to import the buffer first. |
| 295 OutputBufferInfo& info = buffers_pending_import_[index]; | 295 OutputBufferInfo& info = buffers_pending_import_[index]; |
| 296 if (info.handle.is_valid()) { | 296 if (info.handle.is_valid()) { |
| 297 gfx::GpuMemoryBufferHandle handle; | 297 gfx::GpuMemoryBufferHandle handle; |
| 298 #if defined(USE_OZONE) | 298 #if defined(USE_OZONE) |
| 299 handle.native_pixmap_handle.fds.emplace_back( | 299 handle.native_pixmap_handle.fds.emplace_back( |
| 300 base::FileDescriptor(info.handle.release(), true)); | 300 base::FileDescriptor(info.handle.release(), true)); |
| 301 for (const auto& plane : info.planes) { | 301 for (const auto& plane : info.planes) { |
| 302 handle.native_pixmap_handle.planes.emplace_back(plane.stride, | 302 handle.native_pixmap_handle.planes.emplace_back( |
| 303 plane.offset, 0, 0); | 303 plane.stride, plane.offset, 0); |
| 304 } | 304 } |
| 305 #endif | 305 #endif |
| 306 vda_->ImportBufferForPicture(index, handle); | 306 vda_->ImportBufferForPicture(index, handle); |
| 307 } else { | 307 } else { |
| 308 vda_->ReusePictureBuffer(index); | 308 vda_->ReusePictureBuffer(index); |
| 309 } | 309 } |
| 310 break; | 310 break; |
| 311 } | 311 } |
| 312 default: | 312 default: |
| 313 NOTREACHED(); | 313 NOTREACHED(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 496 } |
| 497 return true; | 497 return true; |
| 498 default: | 498 default: |
| 499 DLOG(ERROR) << "Invalid port: " << port; | 499 DLOG(ERROR) << "Invalid port: " << port; |
| 500 return false; | 500 return false; |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 | 503 |
| 504 } // namespace arc | 504 } // namespace arc |
| 505 } // namespace chromeos | 505 } // namespace chromeos |
| OLD | NEW |