| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/gpu/v4l2_video_decode_accelerator.h" | 5 #include "media/gpu/v4l2_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <linux/videodev2.h> | 10 #include <linux/videodev2.h> |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 for (size_t i = 0; i < output_buffer_map_.size(); ++i) { | 371 for (size_t i = 0; i < output_buffer_map_.size(); ++i) { |
| 372 DCHECK(buffers[i].size() == egl_image_size_); | 372 DCHECK(buffers[i].size() == egl_image_size_); |
| 373 | 373 |
| 374 OutputRecord& output_record = output_buffer_map_[i]; | 374 OutputRecord& output_record = output_buffer_map_[i]; |
| 375 DCHECK_EQ(output_record.state, kFree); | 375 DCHECK_EQ(output_record.state, kFree); |
| 376 DCHECK_EQ(output_record.egl_image, EGL_NO_IMAGE_KHR); | 376 DCHECK_EQ(output_record.egl_image, EGL_NO_IMAGE_KHR); |
| 377 DCHECK_EQ(output_record.egl_sync, EGL_NO_SYNC_KHR); | 377 DCHECK_EQ(output_record.egl_sync, EGL_NO_SYNC_KHR); |
| 378 DCHECK_EQ(output_record.picture_id, -1); | 378 DCHECK_EQ(output_record.picture_id, -1); |
| 379 DCHECK_EQ(output_record.cleared, false); | 379 DCHECK_EQ(output_record.cleared, false); |
| 380 DCHECK_EQ(1u, buffers[i].texture_ids().size()); | 380 DCHECK_EQ(1u, buffers[i].service_texture_ids().size()); |
| 381 DCHECK(output_record.processor_input_fds.empty()); | 381 DCHECK(output_record.processor_input_fds.empty()); |
| 382 | 382 |
| 383 output_record.picture_id = buffers[i].id(); | 383 output_record.picture_id = buffers[i].id(); |
| 384 output_record.texture_id = buffers[i].texture_ids()[0]; | 384 output_record.texture_id = buffers[i].service_texture_ids()[0]; |
| 385 // This will remain kAtClient until ImportBufferForPicture is called, either | 385 // This will remain kAtClient until ImportBufferForPicture is called, either |
| 386 // by the client, or by ourselves, if we are allocating. | 386 // by the client, or by ourselves, if we are allocating. |
| 387 output_record.state = kAtClient; | 387 output_record.state = kAtClient; |
| 388 | 388 |
| 389 if (image_processor_device_) { | 389 if (image_processor_device_) { |
| 390 std::vector<base::ScopedFD> dmabuf_fds = device_->GetDmabufsForV4L2Buffer( | 390 std::vector<base::ScopedFD> dmabuf_fds = device_->GetDmabufsForV4L2Buffer( |
| 391 i, output_planes_count_, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); | 391 i, output_planes_count_, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); |
| 392 if (dmabuf_fds.empty()) { | 392 if (dmabuf_fds.empty()) { |
| 393 LOGF(ERROR) << "Failed to get DMABUFs of decoder."; | 393 LOGF(ERROR) << "Failed to get DMABUFs of decoder."; |
| 394 NOTIFY_ERROR(PLATFORM_FAILURE); | 394 NOTIFY_ERROR(PLATFORM_FAILURE); |
| (...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2504 StartResolutionChange(); | 2504 StartResolutionChange(); |
| 2505 } | 2505 } |
| 2506 } | 2506 } |
| 2507 | 2507 |
| 2508 void V4L2VideoDecodeAccelerator::ImageProcessorError() { | 2508 void V4L2VideoDecodeAccelerator::ImageProcessorError() { |
| 2509 LOGF(ERROR) << "Image processor error"; | 2509 LOGF(ERROR) << "Image processor error"; |
| 2510 NOTIFY_ERROR(PLATFORM_FAILURE); | 2510 NOTIFY_ERROR(PLATFORM_FAILURE); |
| 2511 } | 2511 } |
| 2512 | 2512 |
| 2513 } // namespace media | 2513 } // namespace media |
| OLD | NEW |