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.strides_and_offsets.emplace_back( | 297 handle.native_pixmap_handle.planes.emplace_back(info.stride, 0, 0); |
298 info.stride, 0); | |
299 #endif | 298 #endif |
300 vda_->ImportBufferForPicture(index, handle); | 299 vda_->ImportBufferForPicture(index, handle); |
301 } else { | 300 } else { |
302 vda_->ReusePictureBuffer(index); | 301 vda_->ReusePictureBuffer(index); |
303 } | 302 } |
304 break; | 303 break; |
305 } | 304 } |
306 default: | 305 default: |
307 NOTREACHED(); | 306 NOTREACHED(); |
308 } | 307 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 489 } |
491 return true; | 490 return true; |
492 default: | 491 default: |
493 DLOG(ERROR) << "Invalid port: " << port; | 492 DLOG(ERROR) << "Invalid port: " << port; |
494 return false; | 493 return false; |
495 } | 494 } |
496 } | 495 } |
497 | 496 |
498 } // namespace arc | 497 } // namespace arc |
499 } // namespace chromeos | 498 } // namespace chromeos |
OLD | NEW |