Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Unified Diff: media/gpu/generic_v4l2_device.cc

Issue 2559423002: media/gpu: switch v4l2_jpeg_decode_accelerator to use multi-planar APIs (Closed)
Patch Set: let's see if I get the number of patches to upload right this time... Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/gpu/generic_v4l2_device.cc
diff --git a/media/gpu/generic_v4l2_device.cc b/media/gpu/generic_v4l2_device.cc
index 830d004e6b8b374496e14bd9d12ffde9164cd6ee..11b470cf8ba91980fe25e931175ddb074e542622 100644
--- a/media/gpu/generic_v4l2_device.cc
+++ b/media/gpu/generic_v4l2_device.cc
@@ -418,23 +418,24 @@ void GenericV4L2Device::EnumerateDevicesForType(Type type) {
static const std::string kJpegDecoderDevicePattern = "/dev/jpeg-dec";
std::string device_pattern;
- v4l2_buf_type buf_type;
+ std::vector<v4l2_buf_type> buf_types;
switch (type) {
case Type::kDecoder:
device_pattern = kDecoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
break;
case Type::kEncoder:
device_pattern = kEncoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ buf_types.push_back(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
break;
case Type::kImageProcessor:
device_pattern = kImageProcessorDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
break;
case Type::kJpegDecoder:
device_pattern = kJpegDecoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+ buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT);
break;
}
@@ -457,11 +458,13 @@ void GenericV4L2Device::EnumerateDevicesForType(Type type) {
if (!OpenDevicePath(path, type))
continue;
- const auto& supported_pixelformats =
- EnumerateSupportedPixelformats(buf_type);
- if (!supported_pixelformats.empty()) {
- DVLOG(1) << "Found device: " << path;
- devices.push_back(std::make_pair(path, supported_pixelformats));
+ for (const auto& buf_type : buf_types) {
+ const auto& supported_pixelformats =
+ EnumerateSupportedPixelformats(buf_type);
+ if (!supported_pixelformats.empty()) {
+ DVLOG(1) << "Found device: " << path;
+ devices.push_back(std::make_pair(path, supported_pixelformats));
+ }
}
CloseDevice();
« no previous file with comments | « no previous file | media/gpu/jpeg_decode_accelerator_unittest.cc » ('j') | media/gpu/v4l2_jpeg_decode_accelerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698