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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 case PORT_OUTPUT: { | 288 case PORT_OUTPUT: { |
289 // is_valid() is true for the first time the buffer is passed to the VDA. | 289 // is_valid() is true for the first time the buffer is passed to the VDA. |
290 // In that case, VDA needs to import the buffer first. | 290 // In that case, VDA needs to import the buffer first. |
291 OutputBufferInfo& info = buffers_pending_import_[index]; | 291 OutputBufferInfo& info = buffers_pending_import_[index]; |
292 if (info.handle.is_valid()) { | 292 if (info.handle.is_valid()) { |
293 gfx::GpuMemoryBufferHandle handle; | 293 gfx::GpuMemoryBufferHandle handle; |
294 #if defined(USE_OZONE) | 294 #if defined(USE_OZONE) |
295 handle.native_pixmap_handle.fds.emplace_back( | 295 handle.native_pixmap_handle.fds.emplace_back( |
296 base::FileDescriptor(info.handle.release(), true)); | 296 base::FileDescriptor(info.handle.release(), true)); |
297 handle.native_pixmap_handle.planes.emplace_back(info.stride, 0, 0); | 297 handle.native_pixmap_handle.strides_and_offsets.emplace_back( |
| 298 info.stride, 0); |
298 #endif | 299 #endif |
299 vda_->ImportBufferForPicture(index, handle); | 300 vda_->ImportBufferForPicture(index, handle); |
300 } else { | 301 } else { |
301 vda_->ReusePictureBuffer(index); | 302 vda_->ReusePictureBuffer(index); |
302 } | 303 } |
303 break; | 304 break; |
304 } | 305 } |
305 default: | 306 default: |
306 NOTREACHED(); | 307 NOTREACHED(); |
307 } | 308 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 490 } |
490 return true; | 491 return true; |
491 default: | 492 default: |
492 DLOG(ERROR) << "Invalid port: " << port; | 493 DLOG(ERROR) << "Invalid port: " << port; |
493 return false; | 494 return false; |
494 } | 495 } |
495 } | 496 } |
496 | 497 |
497 } // namespace arc | 498 } // namespace arc |
498 } // namespace chromeos | 499 } // namespace chromeos |
OLD | NEW |