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_MPLANE; | 437 // TODO(henryhsu): We have to also support MPLANE |
wuchengli
2016/10/13 09:21:28
I don't think we need the TODO. It's nice to switc
| |
438 buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT; | |
438 break; | 439 break; |
439 } | 440 } |
440 | 441 |
441 std::vector<std::string> candidate_paths; | 442 std::vector<std::string> candidate_paths; |
442 | 443 |
443 // TODO(posciak): Remove this legacy unnumbered device once | 444 // TODO(posciak): Remove this legacy unnumbered device once |
444 // all platforms are updated to use numbered devices. | 445 // all platforms are updated to use numbered devices. |
445 candidate_paths.push_back(device_pattern); | 446 candidate_paths.push_back(device_pattern); |
446 | 447 |
447 // We are sandboxed, so we can't query directory contents to check which | 448 // 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) { | 487 for (const auto& device : devices) { |
487 if (std::find(device.second.begin(), device.second.end(), pixfmt) != | 488 if (std::find(device.second.begin(), device.second.end(), pixfmt) != |
488 device.second.end()) | 489 device.second.end()) |
489 return device.first; | 490 return device.first; |
490 } | 491 } |
491 | 492 |
492 return std::string(); | 493 return std::string(); |
493 } | 494 } |
494 | 495 |
495 } // namespace media | 496 } // namespace media |
OLD | NEW |