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

Unified Diff: media/video/capture/linux/video_capture_device_factory_linux.cc

Issue 1031583002: Revert of Linux Video Capture: Add V4L2VideoCaptureDelegate{Single,Multi}Plane. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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/video/capture/linux/video_capture_device_factory_linux.cc
diff --git a/media/video/capture/linux/video_capture_device_factory_linux.cc b/media/video/capture/linux/video_capture_device_factory_linux.cc
index 966e4f7b90b22f4fa4941755b8996b8a08686890..9bbc50a7f9c1f26af89030e4547a6b5e23a0d621 100644
--- a/media/video/capture/linux/video_capture_device_factory_linux.cc
+++ b/media/video/capture/linux/video_capture_device_factory_linux.cc
@@ -25,7 +25,7 @@
namespace media {
static bool HasUsableFormats(int fd, uint32 capabilities) {
- const std::list<uint32_t>& usable_fourccs =
+ const std::list<int>& usable_fourccs =
VideoCaptureDeviceLinux::GetListOfUsableFourCCs(false);
static const struct {
@@ -48,7 +48,6 @@
}
}
}
- DLOG(ERROR) << "No usable formats found";
return false;
}
@@ -183,11 +182,9 @@
!(cap.capabilities & V4L2_CAP_VIDEO_OUTPUT) &&
!(cap.capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE)) &&
HasUsableFormats(fd.get(), cap.capabilities)) {
- device_names->push_back(VideoCaptureDevice::Name(
- base::StringPrintf("%s", cap.card), unique_id,
- (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE)
- ? VideoCaptureDevice::Name::V4L2_MULTI_PLANE
- : VideoCaptureDevice::Name::V4L2_SINGLE_PLANE));
+ VideoCaptureDevice::Name device_name(base::StringPrintf("%s", cap.card),
+ unique_id);
+ device_names->push_back(device_name);
}
}
}
@@ -203,14 +200,10 @@
return;
supported_formats->clear();
- DCHECK_NE(device.capture_api_type(),
- VideoCaptureDevice::Name::API_TYPE_UNKNOWN);
- const v4l2_buf_type buf_type =
- (device.capture_api_type() == VideoCaptureDevice::Name::V4L2_MULTI_PLANE)
- ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
- : V4L2_BUF_TYPE_VIDEO_CAPTURE;
- GetSupportedFormatsForV4L2BufferType(fd.get(), buf_type, supported_formats);
-
+ const v4l2_buf_type kCaptureTypes[] = {V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE};
+ for (const auto& buf_type : kCaptureTypes)
+ GetSupportedFormatsForV4L2BufferType(fd.get(), buf_type, supported_formats);
return;
}

Powered by Google App Engine
This is Rietveld 408576698