[libcamera-devel] [PATCH v3 1/7] test: camera: buffer_import: Fix error messages
Niklas Söderlund
niklas.soderlund at ragnatech.se
Thu Mar 5 00:22:40 CET 2020
The error message for when a device name can't be resolved to a video
device is wrong and applies to the next operation below it. Move it to
its correct location and add a new error message to highlight the
resolution failure.
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
test/camera/buffer_import.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index ab6e74bd1671e6f5..6997ea78c9f608c9 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -74,13 +74,16 @@ public:
video_ = V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName);
if (!video_) {
+ std::cout << "Failed to get video device from entity "
+ << videoDeviceName << std::endl;
+ return TestFail;
+ }
+
+ if (video_->open()) {
std::cout << "Unable to open " << videoDeviceName << std::endl;
return TestFail;
}
- if (video_->open())
- return TestFail;
-
/* Configure the format. */
V4L2DeviceFormat format;
if (video_->getFormat(&format)) {
--
2.25.1
More information about the libcamera-devel
mailing list