| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/videodev2.h> | 9 #include <linux/videodev2.h> |
| 10 #include <poll.h> | 10 #include <poll.h> |
| (...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 ScheduleDecodeBufferTaskIfNeeded(); | 1660 ScheduleDecodeBufferTaskIfNeeded(); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 void V4L2SliceVideoDecodeAccelerator::ImportBufferForPicture( | 1663 void V4L2SliceVideoDecodeAccelerator::ImportBufferForPicture( |
| 1664 int32_t picture_buffer_id, | 1664 int32_t picture_buffer_id, |
| 1665 const std::vector<gfx::GpuMemoryBufferHandle>& gpu_memory_buffer_handles) { | 1665 const std::vector<gfx::GpuMemoryBufferHandle>& gpu_memory_buffer_handles) { |
| 1666 DVLOGF(3) << "picture_buffer_id=" << picture_buffer_id; | 1666 DVLOGF(3) << "picture_buffer_id=" << picture_buffer_id; |
| 1667 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 1667 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
| 1668 | 1668 |
| 1669 auto passed_dmabuf_fds(base::WrapUnique(new std::vector<base::ScopedFD>())); | 1669 auto passed_dmabuf_fds(base::WrapUnique(new std::vector<base::ScopedFD>())); |
| 1670 #if defined(USE_OZONE) |
| 1670 for (const auto& handle : gpu_memory_buffer_handles) { | 1671 for (const auto& handle : gpu_memory_buffer_handles) { |
| 1671 int fd = -1; | 1672 int fd = -1; |
| 1672 #if defined(USE_OZONE) | |
| 1673 fd = handle.native_pixmap_handle.fd.fd; | 1673 fd = handle.native_pixmap_handle.fd.fd; |
| 1674 #endif | |
| 1675 DCHECK_NE(fd, -1); | 1674 DCHECK_NE(fd, -1); |
| 1676 passed_dmabuf_fds->push_back(base::ScopedFD(fd)); | 1675 passed_dmabuf_fds->push_back(base::ScopedFD(fd)); |
| 1677 } | 1676 } |
| 1677 #endif |
| 1678 | 1678 |
| 1679 if (output_mode_ != Config::OutputMode::IMPORT) { | 1679 if (output_mode_ != Config::OutputMode::IMPORT) { |
| 1680 LOGF(ERROR) << "Cannot import in non-import mode"; | 1680 LOGF(ERROR) << "Cannot import in non-import mode"; |
| 1681 NOTIFY_ERROR(INVALID_ARGUMENT); | 1681 NOTIFY_ERROR(INVALID_ARGUMENT); |
| 1682 return; | 1682 return; |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 decoder_thread_task_runner_->PostTask( | 1685 decoder_thread_task_runner_->PostTask( |
| 1686 FROM_HERE, | 1686 FROM_HERE, |
| 1687 base::Bind(&V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask, | 1687 base::Bind(&V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask, |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2798 V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() { | 2798 V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() { |
| 2799 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 2799 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
| 2800 if (!device) | 2800 if (!device) |
| 2801 return SupportedProfiles(); | 2801 return SupportedProfiles(); |
| 2802 | 2802 |
| 2803 return device->GetSupportedDecodeProfiles(arraysize(supported_input_fourccs_), | 2803 return device->GetSupportedDecodeProfiles(arraysize(supported_input_fourccs_), |
| 2804 supported_input_fourccs_); | 2804 supported_input_fourccs_); |
| 2805 } | 2805 } |
| 2806 | 2806 |
| 2807 } // namespace content | 2807 } // namespace content |
| OLD | NEW |