| 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 | 5 |
| 6 #include "media/gpu/generic_v4l2_device.h" | 6 #include "media/gpu/generic_v4l2_device.h" |
| 7 | 7 |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <libdrm/drm_fourcc.h> | 10 #include <libdrm/drm_fourcc.h> |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 case Type::kEncoder: | 427 case Type::kEncoder: |
| 428 device_pattern = kEncoderDevicePattern; | 428 device_pattern = kEncoderDevicePattern; |
| 429 buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 429 buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
| 430 break; | 430 break; |
| 431 case Type::kImageProcessor: | 431 case Type::kImageProcessor: |
| 432 device_pattern = kImageProcessorDevicePattern; | 432 device_pattern = kImageProcessorDevicePattern; |
| 433 buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; | 433 buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; |
| 434 break; | 434 break; |
| 435 case Type::kJpegDecoder: | 435 case Type::kJpegDecoder: |
| 436 device_pattern = kJpegDecoderDevicePattern; | 436 device_pattern = kJpegDecoderDevicePattern; |
| 437 buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT; | 437 buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; |
| 438 break; | 438 break; |
| 439 } | 439 } |
| 440 | 440 |
| 441 std::vector<std::string> candidate_paths; | 441 std::vector<std::string> candidate_paths; |
| 442 | 442 |
| 443 // TODO(posciak): Remove this legacy unnumbered device once | 443 // TODO(posciak): Remove this legacy unnumbered device once |
| 444 // all platforms are updated to use numbered devices. | 444 // all platforms are updated to use numbered devices. |
| 445 candidate_paths.push_back(device_pattern); | 445 candidate_paths.push_back(device_pattern); |
| 446 | 446 |
| 447 // We are sandboxed, so we can't query directory contents to check which | 447 // We are sandboxed, so we can't query directory contents to check which |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 for (const auto& device : devices) { | 486 for (const auto& device : devices) { |
| 487 if (std::find(device.second.begin(), device.second.end(), pixfmt) != | 487 if (std::find(device.second.begin(), device.second.end(), pixfmt) != |
| 488 device.second.end()) | 488 device.second.end()) |
| 489 return device.first; | 489 return device.first; |
| 490 } | 490 } |
| 491 | 491 |
| 492 return std::string(); | 492 return std::string(); |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace media | 495 } // namespace media |
| OLD | NEW |